Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/738795/?format=api
{ "id": 738795, "url": "http://patchwork.ozlabs.org/api/patches/738795/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1489511727-10959-1-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": "<1489511727-10959-1-git-send-email-bimmy.pujari@intel.com>", "list_archive_url": null, "date": "2017-03-14T17:15:22", "name": "[next,S63,1/6] i40e/i40evf: Use length to determine if descriptor is done", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "60f50a4d9e2fc57e4f51e25d527649d066e5c29e", "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/1489511727-10959-1-git-send-email-bimmy.pujari@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/738795/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/738795/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 3vjKdg53Nyz9rxm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 15 Mar 2017 03:17:43 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D889A89675;\n\tTue, 14 Mar 2017 16:17:41 +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 Re69XisY+IAt; Tue, 14 Mar 2017 16:17:38 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 2523B896C7;\n\tTue, 14 Mar 2017 16:17:38 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 65B291BFEBB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:37 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 60E6E89670\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:37 +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 bYbJ-cPYrAM0 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:36 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 168A58959C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:36 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Mar 2017 09:17:35 -0700", "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([10.166.35.87])\n\tby orsmga001.jf.intel.com with ESMTP; 14 Mar 2017 09:17:34 -0700" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"jXmsh8Rg\"; 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=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1489508256; x=1521044256;\n\th=from:to:cc:subject:date:message-id;\n\tbh=5iSw4tcPYW5FtcIbLM5ci2PDSwICxBmfsOcbo+64Z8k=;\n\tb=jXmsh8RgnLH1oDafviAwwODOK6Zy0hQqi6/wa7u68i/657RWWn3ur4fd\n\tDN1dMapclH/gMOqBy4Tu/ikhhKOxbA==;", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.36,164,1486454400\"; d=\"scan'208\";\n\ta=\"1108362394\"", "From": "Bimmy Pujari <bimmy.pujari@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 14 Mar 2017 10:15:22 -0700", "Message-Id": "<1489511727-10959-1-git-send-email-bimmy.pujari@intel.com>", "X-Mailer": "git-send-email 2.4.11", "Subject": "[Intel-wired-lan] [next PATCH S63 1/6] i40e/i40evf: Use length to\n\tdetermine if descriptor is done", "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: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThis change makes it so that we use the length of the packet instead of the\nDD status bit to determine if a new descriptor is ready to be processed.\nThe obvious advantage is that it cuts down on reads as we don't really even\nneed the DD bit if going from a 0 to a non-zero value on size is enough to\ninform us that the packet has been completed.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\nChange-ID: Iebdf9cdb36c454ef092df27199b92ad09c374231\n---\nTesting Hints:\n Perform various Rx tests to verify we are not corrupting any Rx data.\n\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 24 ++++++++++++------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 24 ++++++++++++------------\n 2 files changed, 24 insertions(+), 24 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 9742beb..68936b6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1757,6 +1757,7 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\n * i40e_fetch_rx_buffer - Allocate skb and populate it\n * @rx_ring: rx descriptor ring to transact packets on\n * @rx_desc: descriptor containing info written by hardware\n+ * @size: size of buffer to add to skb\n *\n * This function allocates an skb on the fly, and populates it with the page\n * data from the current receive descriptor, taking care to set up the skb\n@@ -1766,13 +1767,9 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\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 struct sk_buff *skb)\n+\t\t\t\t struct sk_buff *skb,\n+\t\t\t\t unsigned int size)\n {\n-\tu64 local_status_error_len =\n-\t\tle64_to_cpu(rx_desc->wb.qword1.status_error_len);\n-\tunsigned int size =\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 page *page;\n \n@@ -1890,6 +1887,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion i40e_rx_desc *rx_desc;\n+\t\tunsigned int size;\n \t\tu16 vlan_tag;\n \t\tu8 rx_ptype;\n \t\tu64 qword;\n@@ -1906,19 +1904,21 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t/* status_error_len will always be zero for unused descriptors\n \t\t * because it's cleared in cleanup, and overlaps with hdr_addr\n \t\t * which is always zero because packet split isn't used, if the\n-\t\t * hardware wrote DD then it will be non-zero\n+\t\t * hardware wrote DD then the length will be non-zero\n \t\t */\n-\t\tif (!i40e_test_staterr(rx_desc,\n-\t\t\t\t BIT(I40E_RX_DESC_STATUS_DD_SHIFT)))\n+\t\tqword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);\n+\t\tsize = (qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\n+\t\t I40E_RXD_QW1_LENGTH_PBUF_SHIFT;\n+\t\tif (!size)\n \t\t\tbreak;\n \n \t\t/* This memory barrier is needed to keep us from reading\n-\t\t * any other fields out of the rx_desc until we know the\n-\t\t * DD bit is set.\n+\t\t * any other fields out of the rx_desc until we have\n+\t\t * verified the descriptor has been written back.\n \t\t */\n \t\tdma_rmb();\n \n-\t\tskb = i40e_fetch_rx_buffer(rx_ring, rx_desc, skb);\n+\t\tskb = i40e_fetch_rx_buffer(rx_ring, rx_desc, skb, size);\n \t\tif (!skb)\n \t\t\tbreak;\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex f1a99a8..e41eb46 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1116,6 +1116,7 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\n * i40evf_fetch_rx_buffer - Allocate skb and populate it\n * @rx_ring: rx descriptor ring to transact packets on\n * @rx_desc: descriptor containing info written by hardware\n+ * @size: size of buffer to add to skb\n *\n * This function allocates an skb on the fly, and populates it with the page\n * data from the current receive descriptor, taking care to set up the skb\n@@ -1125,13 +1126,9 @@ static bool i40e_add_rx_frag(struct i40e_ring *rx_ring,\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 struct sk_buff *skb)\n+\t\t\t\t struct sk_buff *skb,\n+\t\t\t\t unsigned int size)\n {\n-\tu64 local_status_error_len =\n-\t\tle64_to_cpu(rx_desc->wb.qword1.status_error_len);\n-\tunsigned int size =\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 page *page;\n \n@@ -1244,6 +1241,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion i40e_rx_desc *rx_desc;\n+\t\tunsigned int size;\n \t\tu16 vlan_tag;\n \t\tu8 rx_ptype;\n \t\tu64 qword;\n@@ -1260,19 +1258,21 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t/* status_error_len will always be zero for unused descriptors\n \t\t * because it's cleared in cleanup, and overlaps with hdr_addr\n \t\t * which is always zero because packet split isn't used, if the\n-\t\t * hardware wrote DD then it will be non-zero\n+\t\t * hardware wrote DD then the length will be non-zero\n \t\t */\n-\t\tif (!i40e_test_staterr(rx_desc,\n-\t\t\t\t BIT(I40E_RX_DESC_STATUS_DD_SHIFT)))\n+\t\tqword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);\n+\t\tsize = (qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\n+\t\t I40E_RXD_QW1_LENGTH_PBUF_SHIFT;\n+\t\tif (!size)\n \t\t\tbreak;\n \n \t\t/* This memory barrier is needed to keep us from reading\n-\t\t * any other fields out of the rx_desc until we know the\n-\t\t * DD bit is set.\n+\t\t * any other fields out of the rx_desc until we have\n+\t\t * verified the descriptor has been written back.\n \t\t */\n \t\tdma_rmb();\n \n-\t\tskb = i40evf_fetch_rx_buffer(rx_ring, rx_desc, skb);\n+\t\tskb = i40evf_fetch_rx_buffer(rx_ring, rx_desc, skb, size);\n \t\tif (!skb)\n \t\t\tbreak;\n \n", "prefixes": [ "next", "S63", "1/6" ] }