get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 700232,
    "url": "http://patchwork.ozlabs.org/api/patches/700232/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1480377971-23412-12-git-send-email-bimmy.pujari@intel.com/",
    "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": "<1480377971-23412-12-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2016-11-29T00:06:08",
    "name": "[next,S55,11/14] i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cfaa22432b5b6e4f1c11fd828a9a890300089eac",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@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/1480377971-23412-12-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/700232/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/700232/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 3tSP5N5RdKz9vFD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Nov 2016 11:08:08 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1B28E8898B;\n\tTue, 29 Nov 2016 00:08: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 MxW-pIjpU-hJ; Tue, 29 Nov 2016 00:08:01 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 53EF888991;\n\tTue, 29 Nov 2016 00:07:54 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 385081C0C28\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:50 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 30B612FBCE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:50 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id bfkw6hC2yWyF for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:49 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 137E42DA9D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:49 +0000 (UTC)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga104.jf.intel.com with ESMTP; 28 Nov 2016 16:07:47 -0800",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby orsmga004.jf.intel.com with ESMTP; 28 Nov 2016 16:07:47 -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-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.31,565,1473145200\"; d=\"scan'208\";a=\"35284074\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 28 Nov 2016 16:06:08 -0800",
        "Message-Id": "<1480377971-23412-12-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1480377971-23412-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1480377971-23412-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S55 11/14] i40e/i40evf: Moves skb\n\tfrom i40e_rx_buffer to i40e_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>",
        "MIME-Version": "1.0",
        "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: \"Scott Peterson\" <scott.d.peterson@intel.com>\n\nThis patch reduces the size of struct i40e_rx_buffer by one pointer,\nand makes the i40e driver a little more consistent with the igb driver\nin terms of packets that span buffers.\n\nWe do this by moving the skb field from struct i40e_rx_buffer to\nstruct i40e_ring. We pass the skb we already have (or NULL if we\ndon't) to i40e_fetch_rx_buffer(), which skips the skb allocation if we\nalready have one for this packet.\n\nSigned-off-by: Scott Peterson <scott.d.peterson@intel.com>\nChange-ID: I4ad48a531844494ba0c5d8e1a62209a057f661b0\n---\nTesting Hints:\nGenerate traffic with jumbo frames (e.g. netperf), and observe\n\"non_eop_segs\" stat increases on receiver.  That confirms the\npath changed here was taken.\n\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 31 +++++++++++++--------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.h   |  9 +++++++-\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 30 +++++++++++++-------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.h |  9 +++++++-\n 4 files changed, 46 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 7b96ccb..43de4c4 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1013,14 +1013,15 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)\n \tif (!rx_ring->rx_bi)\n \t\treturn;\n \n+\tif (rx_ring->skb) {\n+\t\tdev_kfree_skb(rx_ring->skb);\n+\t\trx_ring->skb = NULL;\n+\t}\n+\n \t/* Free all the Rx ring sk_buffs */\n \tfor (i = 0; i < rx_ring->count; i++) {\n \t\tstruct i40e_rx_buffer *rx_bi = &rx_ring->rx_bi[i];\n \n-\t\tif (rx_bi->skb) {\n-\t\t\tdev_kfree_skb(rx_bi->skb);\n-\t\t\trx_bi->skb = NULL;\n-\t\t}\n \t\tif (!rx_bi->page)\n \t\t\tcontinue;\n \n@@ -1608,7 +1609,8 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\n  */\n static inline\n struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,\n-\t\t\t\t     union i40e_rx_desc *rx_desc)\n+\t\t\t\t     union i40e_rx_desc *rx_desc,\n+\t\t\t\t     struct sk_buff *skb)\n {\n \tu64 local_status_error_len =\n \t\tle64_to_cpu(rx_desc->wb.qword1.status_error_len);\n@@ -1616,15 +1618,12 @@ struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,\n \t\t(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\n \t\tI40E_RXD_QW1_LENGTH_PBUF_SHIFT;\n \tstruct i40e_rx_buffer *rx_buffer;\n-\tstruct sk_buff *skb;\n \tstruct page *page;\n \n \trx_buffer = &rx_ring->rx_bi[rx_ring->next_to_clean];\n \tpage = rx_buffer->page;\n \tprefetchw(page);\n \n-\tskb = rx_buffer->skb;\n-\n \tif (likely(!skb)) {\n \t\tvoid *page_addr = page_address(page) + rx_buffer->page_offset;\n \n@@ -1648,8 +1647,6 @@ struct sk_buff *i40e_fetch_rx_buffer(struct i40e_ring *rx_ring,\n \t\t * it now to avoid a possible cache miss\n \t\t */\n \t\tprefetchw(skb->data);\n-\t} else {\n-\t\trx_buffer->skb = NULL;\n \t}\n \n \t/* we are reusing so sync this buffer for CPU use */\n@@ -1702,7 +1699,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,\n #define staterrlen rx_desc->wb.qword1.status_error_len\n \tif (unlikely(i40e_rx_is_programming_status(le64_to_cpu(staterrlen)))) {\n \t\ti40e_clean_programming_status(rx_ring, rx_desc);\n-\t\trx_ring->rx_bi[ntc].skb = skb;\n \t\treturn true;\n \t}\n \t/* if we are the last buffer then there is nothing else to do */\n@@ -1710,8 +1706,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,\n \tif (likely(i40e_test_staterr(rx_desc, I40E_RXD_EOF)))\n \t\treturn false;\n \n-\t/* place skb in next buffer to be received */\n-\trx_ring->rx_bi[ntc].skb = skb;\n \trx_ring->rx_stats.non_eop_descs++;\n \n \treturn true;\n@@ -1732,12 +1726,12 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,\n static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n {\n \tunsigned int total_rx_bytes = 0, total_rx_packets = 0;\n+\tstruct sk_buff *skb = rx_ring->skb;\n \tu16 cleaned_count = I40E_DESC_UNUSED(rx_ring);\n \tbool failure = false;\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion i40e_rx_desc *rx_desc;\n-\t\tstruct sk_buff *skb;\n \t\tu16 vlan_tag;\n \t\tu8 rx_ptype;\n \t\tu64 qword;\n@@ -1766,7 +1760,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t */\n \t\tdma_rmb();\n \n-\t\tskb = i40e_fetch_rx_buffer(rx_ring, rx_desc);\n+\t\tskb = i40e_fetch_rx_buffer(rx_ring, rx_desc, skb);\n \t\tif (!skb)\n \t\t\tbreak;\n \n@@ -1785,8 +1779,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tif (i40e_cleanup_headers(rx_ring, skb))\n+\t\tif (i40e_cleanup_headers(rx_ring, skb)) {\n+\t\t\tskb = NULL;\n \t\t\tcontinue;\n+\t\t}\n \n \t\t/* probably a little skewed due to removing CRC */\n \t\ttotal_rx_bytes += skb->len;\n@@ -1811,11 +1807,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t\t   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;\n \n \t\ti40e_receive_skb(rx_ring, skb, vlan_tag);\n+\t\tskb = NULL;\n \n \t\t/* update budget accounting */\n \t\ttotal_rx_packets++;\n \t}\n \n+\trx_ring->skb = skb;\n+\n \tu64_stats_update_begin(&rx_ring->syncp);\n \trx_ring->stats.packets += total_rx_packets;\n \trx_ring->stats.bytes += total_rx_bytes;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex 1ea820e..f809790 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -253,7 +253,6 @@ struct i40e_tx_buffer {\n };\n \n struct i40e_rx_buffer {\n-\tstruct sk_buff *skb;\n \tdma_addr_t dma;\n \tstruct page *page;\n \tunsigned int page_offset;\n@@ -354,6 +353,14 @@ struct i40e_ring {\n \n \tstruct rcu_head rcu;\t\t/* to avoid race on free */\n \tu16 next_to_alloc;\n+\tstruct sk_buff *skb;\t\t/* When i40e_clean_rx_ring_irq() must\n+\t\t\t\t\t * return before it sees the EOP for\n+\t\t\t\t\t * the current packet, we save that skb\n+\t\t\t\t\t * here and resume receiving this\n+\t\t\t\t\t * packet the next time\n+\t\t\t\t\t * i40e_clean_rx_ring_irq() is called\n+\t\t\t\t\t * for this ring.\n+\t\t\t\t\t */\n } ____cacheline_internodealigned_in_smp;\n \n enum i40e_latency_range {\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex bb498c3..04c266c 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -501,14 +501,15 @@ void i40evf_clean_rx_ring(struct i40e_ring *rx_ring)\n \tif (!rx_ring->rx_bi)\n \t\treturn;\n \n+\tif (rx_ring->skb) {\n+\t\tdev_kfree_skb(rx_ring->skb);\n+\t\trx_ring->skb = NULL;\n+\t}\n+\n \t/* Free all the Rx ring sk_buffs */\n \tfor (i = 0; i < rx_ring->count; i++) {\n \t\tstruct i40e_rx_buffer *rx_bi = &rx_ring->rx_bi[i];\n \n-\t\tif (rx_bi->skb) {\n-\t\t\tdev_kfree_skb(rx_bi->skb);\n-\t\t\trx_bi->skb = NULL;\n-\t\t}\n \t\tif (!rx_bi->page)\n \t\t\tcontinue;\n \n@@ -1086,7 +1087,8 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\n  */\n static inline\n struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,\n-\t\t\t\t       union i40e_rx_desc *rx_desc)\n+\t\t\t\t     union i40e_rx_desc *rx_desc,\n+\t\t\t\t     struct sk_buff *skb)\n {\n \tu64 local_status_error_len =\n \t\tle64_to_cpu(rx_desc->wb.qword1.status_error_len);\n@@ -1094,15 +1096,12 @@ struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,\n \t\t(local_status_error_len & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\n \t\tI40E_RXD_QW1_LENGTH_PBUF_SHIFT;\n \tstruct i40e_rx_buffer *rx_buffer;\n-\tstruct sk_buff *skb;\n \tstruct page *page;\n \n \trx_buffer = &rx_ring->rx_bi[rx_ring->next_to_clean];\n \tpage = rx_buffer->page;\n \tprefetchw(page);\n \n-\tskb = rx_buffer->skb;\n-\n \tif (likely(!skb)) {\n \t\tvoid *page_addr = page_address(page) + rx_buffer->page_offset;\n \n@@ -1126,8 +1125,6 @@ struct sk_buff *i40evf_fetch_rx_buffer(struct i40e_ring *rx_ring,\n \t\t * it now to avoid a possible cache miss\n \t\t */\n \t\tprefetchw(skb->data);\n-\t} else {\n-\t\trx_buffer->skb = NULL;\n \t}\n \n \t/* we are reusing so sync this buffer for CPU use */\n@@ -1182,8 +1179,6 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,\n \tif (likely(i40e_test_staterr(rx_desc, I40E_RXD_EOF)))\n \t\treturn false;\n \n-\t/* place skb in next buffer to be received */\n-\trx_ring->rx_bi[ntc].skb = skb;\n \trx_ring->rx_stats.non_eop_descs++;\n \n \treturn true;\n@@ -1204,12 +1199,12 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,\n static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n {\n \tunsigned int total_rx_bytes = 0, total_rx_packets = 0;\n+\tstruct sk_buff *skb = rx_ring->skb;\n \tu16 cleaned_count = I40E_DESC_UNUSED(rx_ring);\n \tbool failure = false;\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion i40e_rx_desc *rx_desc;\n-\t\tstruct sk_buff *skb;\n \t\tu16 vlan_tag;\n \t\tu8 rx_ptype;\n \t\tu64 qword;\n@@ -1238,7 +1233,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t */\n \t\tdma_rmb();\n \n-\t\tskb = i40evf_fetch_rx_buffer(rx_ring, rx_desc);\n+\t\tskb = i40evf_fetch_rx_buffer(rx_ring, rx_desc, skb);\n \t\tif (!skb)\n \t\t\tbreak;\n \n@@ -1257,8 +1252,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tif (i40e_cleanup_headers(rx_ring, skb))\n+\t\tif (i40e_cleanup_headers(rx_ring, skb)) {\n+\t\t\tskb = NULL;\n \t\t\tcontinue;\n+\t\t}\n \n \t\t/* probably a little skewed due to removing CRC */\n \t\ttotal_rx_bytes += skb->len;\n@@ -1275,11 +1272,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t\t   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;\n \n \t\ti40e_receive_skb(rx_ring, skb, vlan_tag);\n+\t\tskb = NULL;\n \n \t\t/* update budget accounting */\n \t\ttotal_rx_packets++;\n \t}\n \n+\trx_ring->skb = skb;\n+\n \tu64_stats_update_begin(&rx_ring->syncp);\n \trx_ring->stats.packets += total_rx_packets;\n \trx_ring->stats.bytes += total_rx_bytes;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\nindex a5fc789..8274ba6 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n@@ -239,7 +239,6 @@ struct i40e_tx_buffer {\n };\n \n struct i40e_rx_buffer {\n-\tstruct sk_buff *skb;\n \tdma_addr_t dma;\n \tstruct page *page;\n \tunsigned int page_offset;\n@@ -340,6 +339,14 @@ struct i40e_ring {\n \n \tstruct rcu_head rcu;\t\t/* to avoid race on free */\n \tu16 next_to_alloc;\n+\tstruct sk_buff *skb;\t\t/* When i40evf_clean_rx_ring_irq() must\n+\t\t\t\t\t * return before it sees the EOP for\n+\t\t\t\t\t * the current packet, we save that skb\n+\t\t\t\t\t * here and resume receiving this\n+\t\t\t\t\t * packet the next time\n+\t\t\t\t\t * i40evf_clean_rx_ring_irq() is called\n+\t\t\t\t\t * for this ring.\n+\t\t\t\t\t */\n } ____cacheline_internodealigned_in_smp;\n \n enum i40e_latency_range {\n",
    "prefixes": [
        "next",
        "S55",
        "11/14"
    ]
}