get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/712023/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 712023,
    "url": "http://patchwork.ozlabs.org/api/patches/712023/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170106160647.1501.24838.stgit@localhost.localdomain/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170106160647.1501.24838.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2017-01-06T16:06:48",
    "name": "[next,03/11] ixgbe: Update driver to make use of DMA attributes in Rx path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d7cb4739c256d96d6b4826f70c974fe9a2b5d63f",
    "submitter": {
        "id": 252,
        "url": "http://patchwork.ozlabs.org/api/people/252/?format=api",
        "name": "Alexander Duyck",
        "email": "alexander.duyck@gmail.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170106160647.1501.24838.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/712023/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/712023/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3tw96Q2Z6Vz9sfH\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Jan 2017 03:31:26 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AB4D087144;\n\tFri,  6 Jan 2017 16:31:24 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OBzdBiBqBiYK; Fri,  6 Jan 2017 16:31:23 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 971548712A;\n\tFri,  6 Jan 2017 16:31:23 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id B62971BFA57\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:31:22 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B121F88ECC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:31:22 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id fAz2XCVIeVMS for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:31:21 +0000 (UTC)",
            "from mail-pg0-f65.google.com (mail-pg0-f65.google.com\n\t[74.125.83.65])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id DFE4388CD9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:31:21 +0000 (UTC)",
            "by mail-pg0-f65.google.com with SMTP id 75so6242642pgf.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 06 Jan 2017 08:31:21 -0800 (PST)",
            "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\tr88sm161009957pfe.93.2017.01.06.08.06.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 06 Jan 2017 08:06:49 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"jzPUyJRZ\"; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-transfer-encoding;\n\tbh=usHpIRYA2JUL312Isy/ZxK6ck8Tnmte6GDigPcCikKM=;\n\tb=jzPUyJRZ9aVEzjvw9kt6RqdQPKaJzrafirNTaXbfqFND8rHpiy9d1pro89gFYz77/U\n\tqzWkkbBymScjTjPHRYjlVwADbdp3uWg0c9lM0Ldkb3sDBnEFNujNmt8elKnn3p9m22E4\n\tHY8weW5n0D9uNGrpGPErMW8h4O08TzoerLcj11z7jP0K0x4ZP8YbcDSCVEVT/aTCZXvI\n\tyOEAsDtkT8y6HcOxkpi8VFQb2ULXjAAHHYD07u/s+QHYQVnnwZwX5GqCv2nT0qzjxWX5\n\tkFRYkFS+K5qBB75ARFCAG4vrX38Kd7lV838yxp2N3pvBx1vSbqHk9MGK8+sGtB8xiQYq\n\tG8UQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=usHpIRYA2JUL312Isy/ZxK6ck8Tnmte6GDigPcCikKM=;\n\tb=KE2i+7ZsVrtNXJQSBg6VvL/gmncwx8zHjuOefB0pp+rCadObqpxHyOhI0j+LkvEBa9\n\tGn62Ob5uXeLsf/tGrUL0rwIMwwRCM/aaVdmqCWin7oRmttjlnNoyD/p4CWJy0R1RAtd4\n\tTbEeenrBQ+VICTn7JfQRJLOc6PWd8NqLpnQe6sX85UMMDv2EgZReD9V/m6+rxm3Cr6LZ\n\tGcM7mJEdb9SaGpiI56DdjVNwT/a1jEzRyau8CJ7qdEEHD0qpFsesT4q7yxDVl2pN/Thh\n\tiQL+Tvnh979OI1dUSz+doS4GYitaFZzCIHusetkvfpWzX2Y/iKZLCUXjQF/MdsJEjSZ6\n\tkg2A==",
        "X-Gm-Message-State": "AIkVDXLb9s86X6aHayf90wpoepvx/HLDEahm5GJDBKLWV9MmLQtsnmcY1eFyBVxieektBw==",
        "X-Received": "by 10.84.175.3 with SMTP id s3mr166396021plb.66.1483718809845;\n\tFri, 06 Jan 2017 08:06:49 -0800 (PST)",
        "From": "Alexander Duyck <alexander.duyck@gmail.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Fri, 06 Jan 2017 08:06:48 -0800",
        "Message-ID": "<20170106160647.1501.24838.stgit@localhost.localdomain>",
        "In-Reply-To": "<20170106155448.1501.31298.stgit@localhost.localdomain>",
        "References": "<20170106155448.1501.31298.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Cc": "netdev@vger.kernel.org",
        "Subject": "[Intel-wired-lan] [next PATCH 03/11] ixgbe: Update driver to make\n\tuse of DMA attributes in Rx path",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThis patch adds support for DMA_ATTR_SKIP_CPU_SYNC and\nDMA_ATTR_WEAK_ORDERING.  By enabling both of these for the Rx path we are\nable to see performance improvements on architectures that implement either\none due to the fact that page mapping and unmapping only has to sync what\nis actually being used instead of the entire buffer.  In addition by\nenabling the weak ordering attribute enables a performance improvement for\narchitectures that can associate a memory ordering with a DMA buffer such\nas Sparc.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    3 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   56 +++++++++++++++++--------\n 2 files changed, 40 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 9c6ccfc34177..97e74deecae2 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -107,6 +107,9 @@\n /* How many Rx Buffers do we bundle into one write to the hardware ? */\n #define IXGBE_RX_BUFFER_WRITE\t16\t/* Must be power of 2 */\n \n+#define IXGBE_RX_DMA_ATTR \\\n+\t(DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING)\n+\n enum ixgbe_tx_flags {\n \t/* cmd_type flags */\n \tIXGBE_TX_FLAGS_HW_VLAN\t= 0x01,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex dbbf5223ace2..062b984ffdf4 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1583,8 +1583,10 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,\n \t}\n \n \t/* map page for use */\n-\tdma = dma_map_page(rx_ring->dev, page, 0,\n-\t\t\t   ixgbe_rx_pg_size(rx_ring), DMA_FROM_DEVICE);\n+\tdma = dma_map_page_attrs(rx_ring->dev, page, 0,\n+\t\t\t\t ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t DMA_FROM_DEVICE,\n+\t\t\t\t IXGBE_RX_DMA_ATTR);\n \n \t/*\n \t * if mapping failed free memory back to system since\n@@ -1627,6 +1629,12 @@ void ixgbe_alloc_rx_buffers(struct ixgbe_ring *rx_ring, u16 cleaned_count)\n \t\tif (!ixgbe_alloc_mapped_page(rx_ring, bi))\n \t\t\tbreak;\n \n+\t\t/* sync the buffer for use by the device */\n+\t\tdma_sync_single_range_for_device(rx_ring->dev, bi->dma,\n+\t\t\t\t\t\t bi->page_offset,\n+\t\t\t\t\t\t ixgbe_rx_bufsz(rx_ring),\n+\t\t\t\t\t\t DMA_FROM_DEVICE);\n+\n \t\t/*\n \t\t * Refresh the desc even if buffer_addrs didn't change\n \t\t * because each write-back erases this info.\n@@ -1849,8 +1857,10 @@ static void ixgbe_dma_sync_frag(struct ixgbe_ring *rx_ring,\n {\n \t/* if the page was released unmap it, else just sync our portion */\n \tif (unlikely(IXGBE_CB(skb)->page_released)) {\n-\t\tdma_unmap_page(rx_ring->dev, IXGBE_CB(skb)->dma,\n-\t\t\t       ixgbe_rx_pg_size(rx_ring), DMA_FROM_DEVICE);\n+\t\tdma_unmap_page_attrs(rx_ring->dev, IXGBE_CB(skb)->dma,\n+\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t     DMA_FROM_DEVICE,\n+\t\t\t\t     IXGBE_RX_DMA_ATTR);\n \t\tIXGBE_CB(skb)->page_released = false;\n \t} else {\n \t\tstruct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];\n@@ -1934,12 +1944,6 @@ static void ixgbe_reuse_rx_page(struct ixgbe_ring *rx_ring,\n \n \t/* transfer page from old buffer to new buffer */\n \t*new_buff = *old_buff;\n-\n-\t/* sync the buffer for use by the device */\n-\tdma_sync_single_range_for_device(rx_ring->dev, new_buff->dma,\n-\t\t\t\t\t new_buff->page_offset,\n-\t\t\t\t\t ixgbe_rx_bufsz(rx_ring),\n-\t\t\t\t\t DMA_FROM_DEVICE);\n }\n \n static inline bool ixgbe_page_is_reserved(struct page *page)\n@@ -2105,9 +2109,10 @@ static struct sk_buff *ixgbe_fetch_rx_buffer(struct ixgbe_ring *rx_ring,\n \t\tIXGBE_CB(skb)->page_released = true;\n \t} else {\n \t\t/* we are not reusing the buffer so unmap it */\n-\t\tdma_unmap_page(rx_ring->dev, rx_buffer->dma,\n-\t\t\t       ixgbe_rx_pg_size(rx_ring),\n-\t\t\t       DMA_FROM_DEVICE);\n+\t\tdma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,\n+\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t     DMA_FROM_DEVICE,\n+\t\t\t\t     IXGBE_RX_DMA_ATTR);\n \t}\n \n \t/* clear contents of buffer_info */\n@@ -4941,10 +4946,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)\n \t\tif (rx_buffer->skb) {\n \t\t\tstruct sk_buff *skb = rx_buffer->skb;\n \t\t\tif (IXGBE_CB(skb)->page_released)\n-\t\t\t\tdma_unmap_page(dev,\n-\t\t\t\t\t       IXGBE_CB(skb)->dma,\n-\t\t\t\t\t       ixgbe_rx_bufsz(rx_ring),\n-\t\t\t\t\t       DMA_FROM_DEVICE);\n+\t\t\t\tdma_unmap_page_attrs(dev,\n+\t\t\t\t\t\t     IXGBE_CB(skb)->dma,\n+\t\t\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t\t\t     DMA_FROM_DEVICE,\n+\t\t\t\t\t\t     IXGBE_RX_DMA_ATTR);\n \t\t\tdev_kfree_skb(skb);\n \t\t\trx_buffer->skb = NULL;\n \t\t}\n@@ -4952,8 +4958,20 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)\n \t\tif (!rx_buffer->page)\n \t\t\tcontinue;\n \n-\t\tdma_unmap_page(dev, rx_buffer->dma,\n-\t\t\t       ixgbe_rx_pg_size(rx_ring), DMA_FROM_DEVICE);\n+\t\t/* Invalidate cache lines that may have been written to by\n+\t\t * device so that we avoid corrupting memory.\n+\t\t */\n+\t\tdma_sync_single_range_for_cpu(rx_ring->dev,\n+\t\t\t\t\t      rx_buffer->dma,\n+\t\t\t\t\t      rx_buffer->page_offset,\n+\t\t\t\t\t      ixgbe_rx_bufsz(rx_ring),\n+\t\t\t\t\t      DMA_FROM_DEVICE);\n+\n+\t\t/* free resources associated with mapping */\n+\t\tdma_unmap_page_attrs(dev, rx_buffer->dma,\n+\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t     DMA_FROM_DEVICE,\n+\t\t\t\t     IXGBE_RX_DMA_ATTR);\n \t\t__free_pages(rx_buffer->page, ixgbe_rx_pg_order(rx_ring));\n \n \t\trx_buffer->page = NULL;\n",
    "prefixes": [
        "next",
        "03/11"
    ]
}