get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 711991,
    "url": "http://patchwork.ozlabs.org/api/patches/711991/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170106161100.2030.27875.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": "<20170106161100.2030.27875.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2017-01-06T16:11:01",
    "name": "[next,4/9] igb: Don't bother clearing Tx buffer_info in igb_clean_tx_ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "86f5c2f8cb7b18f374a34804010e90c19da10a62",
    "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/20170106161100.2030.27875.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/711991/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/711991/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 3tw8g04j7Mz9t0X\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Jan 2017 03:11:08 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 2803487075;\n\tFri,  6 Jan 2017 16:11:07 +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 zniHjhalWBIF; Fri,  6 Jan 2017 16:11:04 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A0655820CE;\n\tFri,  6 Jan 2017 16:11:04 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 4F44A1BFA57\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:11:03 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 47B83820CE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:11:03 +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 6n-uafpbHNqK for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:11:02 +0000 (UTC)",
            "from mail-pg0-f65.google.com (mail-pg0-f65.google.com\n\t[74.125.83.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 9D8A481E96\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:11:02 +0000 (UTC)",
            "by mail-pg0-f65.google.com with SMTP id b1so44406317pgc.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 06 Jan 2017 08:11:02 -0800 (PST)",
            "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\tp1sm162611231pgc.29.2017.01.06.08.11.01\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 06 Jan 2017 08:11:01 -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=\"QSn7nF1e\"; 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:date:message-id:in-reply-to:references:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=QSfKX1Rtt7abHwYfaak2RCedfp1v7GSgpmkv5VhHJpg=;\n\tb=QSn7nF1eyRum67Wpor7KsXQMs/AuWFDzGlAs361LAeUWL1lrjrMzWQxuW5S0YmSLXb\n\tZeCgMHHInk+ZjQL0a8gTWem2xtSXxRyoy0KT4hr2CId3P9KfsPz7ZJOLy7JHJuISpA57\n\tv57ToO+lfJft//RRTbNMadgU2TASDPPsBN4nx33731kVgPdgVAkcnojlZYT95A5Vnhce\n\tAM2WqVDvXTHnITXZLW2ybAFRDuUTVJCEYnLLTUCFW0Ec+mLHwJNfL1R09+p7RSk3Emd2\n\tSXRcH50KMGblx/rWoCWYa8lxQtz4Y0GQ+BfUflsqmGsZ+gdwds9CoKGxu0iQnhtdbuCg\n\tcYug==",
        "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:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=QSfKX1Rtt7abHwYfaak2RCedfp1v7GSgpmkv5VhHJpg=;\n\tb=eWqGqzHz4Bxuecu/mW6ESw4YSHP8NHJYDyGXvYytVEiR0sw1zTvw1tp7fMGROfxnqT\n\tlRpp5xDvDmju38YNNGeFUaz1fi5s374kUXXE1yd7UsR7bVCorpMnUSq3HHFi+IWf2zMo\n\tMzK7H6nBbF8hzuZle2DvN/NgpN63TmovrWmi7cNiD8OZhxfF0J17Yr8EQ1kgjgmBYKF+\n\tAx4Syg1x0aKoK7g5VFefdRC3tvZffwFCKUYTZj2vSOImWQlwVfipwq7WTxq0nMkv8osq\n\t/0uHm9KewvTT1wkw7ulAIj2/f1swf3/FwSFRTOBl70alzUpn6yQSq9CmCdUGzJmb2PqI\n\tIbYw==",
        "X-Gm-Message-State": "AIkVDXIhycIU66AlDGrnsioziqy8XwThu3w7QrJarDEfV5lL8z9VBhUNlC6rK7yoXBJZEQ==",
        "X-Received": "by 10.84.178.195 with SMTP id\n\tz61mr171029015plb.176.1483719062047; \n\tFri, 06 Jan 2017 08:11:02 -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:11:01 -0800",
        "Message-ID": "<20170106161100.2030.27875.stgit@localhost.localdomain>",
        "In-Reply-To": "<20170106160850.2030.39073.stgit@localhost.localdomain>",
        "References": "<20170106160850.2030.39073.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH 4/9] igb: Don't bother clearing Tx\n\tbuffer_info in igb_clean_tx_ring",
        "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\nIn the case of the Tx rings we need to only clear the Tx buffer_info when\nwe are resetting the rings.  Ideally we do this when we configure the ring\nto bring it back up instead of when we are taking it down in order to avoid\ndirtying pages we don't need to.\n\nIn addition we don't need to clear the Tx descriptor ring since we will\nfully repopulate it when we begin transmitting frames and next_to_watch can\nbe cleared to prevent the ring from being cleaned beyond that point instead\nof needing to touch anything in the Tx descriptor ring.\n\nFinally with these changes we can avoid having to reset the skb member of\nthe Tx buffer_info structure in the cleanup path since the skb will always\nbe associated with the first buffer which has next_to_watch set.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/igb/igb.h         |    1 \n drivers/net/ethernet/intel/igb/igb_ethtool.c |   11 ++\n drivers/net/ethernet/intel/igb/igb_main.c    |  119 ++++++++++++++++----------\n 3 files changed, 82 insertions(+), 49 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex 87c9fe9d6f18..a638254f4e06 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -594,7 +594,6 @@ enum igb_boards {\n void igb_setup_tctl(struct igb_adapter *);\n void igb_setup_rctl(struct igb_adapter *);\n netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *);\n-void igb_unmap_and_free_tx_resource(struct igb_ring *, struct igb_tx_buffer *);\n void igb_alloc_rx_buffers(struct igb_ring *, u16);\n void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);\n bool igb_has_link(struct igb_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex 737b664d004c..6f037d7d96b8 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -1833,7 +1833,16 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,\n \n \t\t/* unmap buffer on Tx side */\n \t\ttx_buffer_info = &tx_ring->tx_buffer_info[tx_ntc];\n-\t\tigb_unmap_and_free_tx_resource(tx_ring, tx_buffer_info);\n+\n+\t\t/* Free all the Tx ring sk_buffs */\n+\t\tdev_kfree_skb_any(tx_buffer_info->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_info, dma),\n+\t\t\t\t dma_unmap_len(tx_buffer_info, len),\n+\t\t\t\t DMA_TO_DEVICE);\n+\t\tdma_unmap_len_set(tx_buffer_info, len, 0);\n \n \t\t/* increment Rx/Tx next to clean counters */\n \t\trx_ntc++;\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 79a8f3a3356e..bd7e7fbe7862 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -3293,7 +3293,7 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)\n \n \tsize = sizeof(struct igb_tx_buffer) * tx_ring->count;\n \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@@ -3404,6 +3404,10 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,\n \ttxdctl |= IGB_TX_HTHRESH << 8;\n \ttxdctl |= IGB_TX_WTHRESH << 16;\n \n+\t/* reinitialize tx_buffer_info */\n+\tmemset(ring->tx_buffer_info, 0,\n+\t       sizeof(struct igb_tx_buffer) * ring->count);\n+\n \ttxdctl |= E1000_TXDCTL_QUEUE_ENABLE;\n \twr32(E1000_TXDCTL(reg_idx), txdctl);\n }\n@@ -3831,55 +3835,63 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)\n \t\t\tigb_free_tx_resources(adapter->tx_ring[i]);\n }\n \n-void igb_unmap_and_free_tx_resource(struct igb_ring *ring,\n-\t\t\t\t    struct igb_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(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(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/* buffer_info must be completely set up in the transmit path */\n-}\n-\n /**\n  *  igb_clean_tx_ring - Free Tx Buffers\n  *  @tx_ring: ring to be cleaned\n  **/\n static void igb_clean_tx_ring(struct igb_ring *tx_ring)\n {\n-\tstruct igb_tx_buffer *buffer_info;\n-\tunsigned long size;\n-\tu16 i;\n+\tu16 i = tx_ring->next_to_clean;\n+\tstruct igb_tx_buffer *tx_buffer = &tx_ring->tx_buffer_info[i];\n \n-\tif (!tx_ring->tx_buffer_info)\n-\t\treturn;\n-\t/* Free all the Tx ring sk_buffs */\n+\twhile (i != tx_ring->next_to_use) {\n+\t\tunion e1000_adv_tx_desc *eop_desc, *tx_desc;\n \n-\tfor (i = 0; i < tx_ring->count; i++) {\n-\t\tbuffer_info = &tx_ring->tx_buffer_info[i];\n-\t\tigb_unmap_and_free_tx_resource(tx_ring, buffer_info);\n-\t}\n+\t\t/* Free all the Tx ring sk_buffs */\n+\t\tdev_kfree_skb_any(tx_buffer->skb);\n \n-\tnetdev_tx_reset_queue(txring_txq(tx_ring));\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-\tsize = sizeof(struct igb_tx_buffer) * tx_ring->count;\n-\tmemset(tx_ring->tx_buffer_info, 0, size);\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 = IGB_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 = IGB_TX_DESC(tx_ring, 0);\n+\t\t\t}\n \n-\t/* Zero out the descriptor ring */\n-\tmemset(tx_ring->desc, 0, tx_ring->size);\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\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+\t/* reset BQL for queue */\n+\tnetdev_tx_reset_queue(txring_txq(tx_ring));\n+\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@@ -5256,16 +5268,29 @@ static void igb_tx_map(struct igb_ring *tx_ring,\n \tdev_err(tx_ring->dev, \"TX DMA map failed\\n\");\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--)\n+\t\t\ti += tx_ring->count;\n \t\ttx_buffer = &tx_ring->tx_buffer_info[i];\n-\t\tigb_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@@ -5337,7 +5362,8 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,\n \treturn NETDEV_TX_OK;\n \n out_drop:\n-\tigb_unmap_and_free_tx_resource(tx_ring, first);\n+\tdev_kfree_skb_any(first->skb);\n+\tfirst->skb = NULL;\n \n \treturn NETDEV_TX_OK;\n }\n@@ -6686,7 +6712,6 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector, int napi_budget)\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/* clear last DMA location and unmap remaining buffers */\n",
    "prefixes": [
        "next",
        "4/9"
    ]
}