get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 847164,
    "url": "http://patchwork.ozlabs.org/api/patches/847164/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171211183730.21524.65151.stgit@localhost6.localdomain6/",
    "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": "<20171211183730.21524.65151.stgit@localhost6.localdomain6>",
    "list_archive_url": null,
    "date": "2017-12-11T18:37:31",
    "name": "[9/9] ixgbevf: don't bother clearing tx_buffer_info in ixgbevf_clean_tx_ring()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8d17da147e4537a1e6c69c7741c5474187d2afe9",
    "submitter": {
        "id": 1670,
        "url": "http://patchwork.ozlabs.org/api/people/1670/?format=api",
        "name": "Tantilov, Emil S",
        "email": "emil.s.tantilov@intel.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/20171211183730.21524.65151.stgit@localhost6.localdomain6/mbox/",
    "series": [
        {
            "id": 17925,
            "url": "http://patchwork.ozlabs.org/api/series/17925/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=17925",
            "date": "2017-12-11T18:36:44",
            "name": "ixgbevf: update Rx/Tx code path for build_skb",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/17925/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/847164/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/847164/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "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 3ywWml2w0kz9s03\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Dec 2017 05:33:27 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E507086E3E;\n\tMon, 11 Dec 2017 18:33: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 s9JmcyR8R62z; Mon, 11 Dec 2017 18:33:22 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 807F186E32;\n\tMon, 11 Dec 2017 18:33:22 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id D9EFC1BFA4B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Dec 2017 18:33:21 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D6AE487268\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Dec 2017 18:33:21 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 5YnqCnbHc6Ki for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Dec 2017 18:33:21 +0000 (UTC)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 1E5FF87267\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Dec 2017 18:33:21 +0000 (UTC)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Dec 2017 10:33:20 -0800",
            "from estantil-desk3.jf.intel.com (HELO localhost6.localdomain6)\n\t([134.134.177.96])\n\tby fmsmga008.fm.intel.com with ESMTP; 11 Dec 2017 10:33:20 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.45,392,1508828400\"; d=\"scan'208\";a=\"1705093\"",
        "From": "Emil Tantilov <emil.s.tantilov@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 11 Dec 2017 10:37:31 -0800",
        "Message-ID": "<20171211183730.21524.65151.stgit@localhost6.localdomain6>",
        "In-Reply-To": "<20171211183537.21524.10133.stgit@localhost6.localdomain6>",
        "References": "<20171211183537.21524.10133.stgit@localhost6.localdomain6>",
        "User-Agent": "StGit/0.17.1-17-ge4e0",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH 9/9] ixgbevf: don't bother clearing\n\ttx_buffer_info in ixgbevf_clean_tx_ring()",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  115 +++++++++++++--------\n 1 file changed, 72 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex d3415ee..9b3d43d 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -206,28 +206,6 @@ static void ixgbevf_set_ivar(struct ixgbevf_adapter *adapter, s8 direction,\n \t}\n }\n \n-static void ixgbevf_unmap_and_free_tx_resource(struct ixgbevf_ring *tx_ring,\n-\t\t\t\t\tstruct ixgbevf_tx_buffer *tx_buffer)\n-{\n-\tif (tx_buffer->skb) {\n-\t\tdev_kfree_skb_any(tx_buffer->skb);\n-\t\tif (dma_unmap_len(tx_buffer, len))\n-\t\t\tdma_unmap_single(tx_ring->dev,\n-\t\t\t\t\t dma_unmap_addr(tx_buffer, dma),\n-\t\t\t\t\t dma_unmap_len(tx_buffer, len),\n-\t\t\t\t\t DMA_TO_DEVICE);\n-\t} else if (dma_unmap_len(tx_buffer, len)) {\n-\t\tdma_unmap_page(tx_ring->dev,\n-\t\t\t       dma_unmap_addr(tx_buffer, dma),\n-\t\t\t       dma_unmap_len(tx_buffer, len),\n-\t\t\t       DMA_TO_DEVICE);\n-\t}\n-\ttx_buffer->next_to_watch = NULL;\n-\ttx_buffer->skb = NULL;\n-\tdma_unmap_len_set(tx_buffer, len, 0);\n-\t/* tx_buffer must be completely set up in the transmit path */\n-}\n-\n static u64 ixgbevf_get_tx_completed(struct ixgbevf_ring *ring)\n {\n \treturn ring->stats.packets;\n@@ -349,7 +327,6 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,\n \t\t\t\t DMA_TO_DEVICE);\n \n \t\t/* clear tx_buffer data */\n-\t\ttx_buffer->skb = NULL;\n \t\tdma_unmap_len_set(tx_buffer, len, 0);\n \n \t\t/* unmap remaining buffers */\n@@ -1576,6 +1553,10 @@ static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter,\n \ttxdctl |= (1u << 8) |    /* HTHRESH = 1 */\n \t\t   32;           /* PTHRESH = 32 */\n \n+\t/* reinitialize tx_buffer_info */\n+\tmemset(ring->tx_buffer_info, 0,\n+\t       sizeof(struct ixgbevf_tx_buffer) * ring->count);\n+\n \tclear_bit(__IXGBEVF_HANG_CHECK_ARMED, &ring->state);\n \n \tIXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(reg_idx), txdctl);\n@@ -2184,23 +2165,57 @@ static void ixgbevf_clean_rx_ring(struct ixgbevf_ring *rx_ring)\n  **/\n static void ixgbevf_clean_tx_ring(struct ixgbevf_ring *tx_ring)\n {\n-\tstruct ixgbevf_tx_buffer *tx_buffer_info;\n-\tunsigned long size;\n-\tunsigned int i;\n+\tu16 i = tx_ring->next_to_clean;\n+\tstruct ixgbevf_tx_buffer *tx_buffer = &tx_ring->tx_buffer_info[i];\n \n-\tif (!tx_ring->tx_buffer_info)\n-\t\treturn;\n+\twhile (i != tx_ring->next_to_use) {\n+\t\tunion ixgbe_adv_tx_desc *eop_desc, *tx_desc;\n+\n+\t\t/* Free all the Tx ring sk_buffs */\n+\t\tdev_kfree_skb_any(tx_buffer->skb);\n+\n+\t\t/* unmap skb header data */\n+\t\tdma_unmap_single(tx_ring->dev,\n+\t\t\t\t dma_unmap_addr(tx_buffer, dma),\n+\t\t\t\t dma_unmap_len(tx_buffer, len),\n+\t\t\t\t DMA_TO_DEVICE);\n+\n+\t\t/* check for eop_desc to determine the end of the packet */\n+\t\teop_desc = tx_buffer->next_to_watch;\n+\t\ttx_desc = IXGBEVF_TX_DESC(tx_ring, i);\n+\n+\t\t/* unmap remaining buffers */\n+\t\twhile (tx_desc != eop_desc) {\n+\t\t\ttx_buffer++;\n+\t\t\ttx_desc++;\n+\t\t\ti++;\n+\t\t\tif (unlikely(i == tx_ring->count)) {\n+\t\t\t\ti = 0;\n+\t\t\t\ttx_buffer = tx_ring->tx_buffer_info;\n+\t\t\t\ttx_desc = IXGBEVF_TX_DESC(tx_ring, 0);\n+\t\t\t}\n+\n+\t\t\t/* unmap any remaining paged data */\n+\t\t\tif (dma_unmap_len(tx_buffer, len))\n+\t\t\t\tdma_unmap_page(tx_ring->dev,\n+\t\t\t\t\t       dma_unmap_addr(tx_buffer, dma),\n+\t\t\t\t\t       dma_unmap_len(tx_buffer, len),\n+\t\t\t\t\t       DMA_TO_DEVICE);\n+\t\t}\n \n-\t/* Free all the Tx ring sk_buffs */\n-\tfor (i = 0; i < tx_ring->count; i++) {\n-\t\ttx_buffer_info = &tx_ring->tx_buffer_info[i];\n-\t\tixgbevf_unmap_and_free_tx_resource(tx_ring, tx_buffer_info);\n+\t\t/* move us one more past the eop_desc for start of next pkt */\n+\t\ttx_buffer++;\n+\t\ti++;\n+\t\tif (unlikely(i == tx_ring->count)) {\n+\t\t\ti = 0;\n+\t\t\ttx_buffer = tx_ring->tx_buffer_info;\n+\t\t}\n \t}\n \n-\tsize = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;\n-\tmemset(tx_ring->tx_buffer_info, 0, size);\n+\t/* reset next_to_use and next_to_clean */\n+\ttx_ring->next_to_use = 0;\n+\ttx_ring->next_to_clean = 0;\n \n-\tmemset(tx_ring->desc, 0, tx_ring->size);\n }\n \n /**\n@@ -3030,7 +3045,7 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_ring *tx_ring)\n \tint size;\n \n \tsize = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;\n-\ttx_ring->tx_buffer_info = vzalloc(size);\n+\ttx_ring->tx_buffer_info = vmalloc(size);\n \tif (!tx_ring->tx_buffer_info)\n \t\tgoto err;\n \n@@ -3634,18 +3649,32 @@ static void ixgbevf_tx_map(struct ixgbevf_ring *tx_ring,\n \treturn;\n dma_error:\n \tdev_err(tx_ring->dev, \"TX DMA map failed\\n\");\n+\ttx_buffer = &tx_ring->tx_buffer_info[i];\n \n \t/* clear dma mappings for failed tx_buffer_info map */\n-\tfor (;;) {\n+\twhile (tx_buffer != first) {\n+\t\tif (dma_unmap_len(tx_buffer, len))\n+\t\t\tdma_unmap_page(tx_ring->dev,\n+\t\t\t\t       dma_unmap_addr(tx_buffer, dma),\n+\t\t\t\t       dma_unmap_len(tx_buffer, len),\n+\t\t\t\t       DMA_TO_DEVICE);\n+\t\tdma_unmap_len_set(tx_buffer, len, 0);\n+\n+\t\tif (i-- == 0)\n+\t\t\ti += tx_ring->count;\n \t\ttx_buffer = &tx_ring->tx_buffer_info[i];\n-\t\tixgbevf_unmap_and_free_tx_resource(tx_ring, tx_buffer);\n-\t\tif (tx_buffer == first)\n-\t\t\tbreak;\n-\t\tif (i == 0)\n-\t\t\ti = tx_ring->count;\n-\t\ti--;\n \t}\n \n+\tif (dma_unmap_len(tx_buffer, len))\n+\t\tdma_unmap_single(tx_ring->dev,\n+\t\t\t\t dma_unmap_addr(tx_buffer, dma),\n+\t\t\t\t dma_unmap_len(tx_buffer, len),\n+\t\t\t\t DMA_TO_DEVICE);\n+\tdma_unmap_len_set(tx_buffer, len, 0);\n+\n+\tdev_kfree_skb_any(tx_buffer->skb);\n+\ttx_buffer->skb = NULL;\n+\n \ttx_ring->next_to_use = i;\n }\n \n",
    "prefixes": [
        "9/9"
    ]
}