Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/846401/?format=api
{ "id": 846401, "url": "http://patchwork.ozlabs.org/api/patches/846401/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171208185336.3685.3975.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": "<20171208185336.3685.3975.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2017-12-08T18:55:04", "name": "[jkirsher/net-queue] i40e/i40evf: Account for frags split over multiple descriptors in check linearize", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "15957c82bc859b9757c29746ce362c6824f06b5e", "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/20171208185336.3685.3975.stgit@localhost.localdomain/mbox/", "series": [ { "id": 17612, "url": "http://patchwork.ozlabs.org/api/series/17612/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=17612", "date": "2017-12-08T18:55:04", "name": "[jkirsher/net-queue] i40e/i40evf: Account for frags split over multiple descriptors in check linearize", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/17612/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/846401/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/846401/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>)", "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=\"WseaNr78\"; dkim-atps=neutral" ], "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 3ythQN3p2yz9sxR\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Dec 2017 05:56:11 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E4D2A88849;\n\tFri, 8 Dec 2017 18:56:08 +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 hvFxNULAlP4p; Fri, 8 Dec 2017 18:56:08 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D0E46894EA;\n\tFri, 8 Dec 2017 18:55:45 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id E5B561BFBAD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Dec 2017 18:55:07 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E0E8E88B4B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Dec 2017 18:55:07 +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 w6zJYJRcoAqr for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Dec 2017 18:55:06 +0000 (UTC)", "from mail-pg0-f65.google.com (mail-pg0-f65.google.com\n\t[74.125.83.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id C0C1E88B49\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Dec 2017 18:55:06 +0000 (UTC)", "by mail-pg0-f65.google.com with SMTP id j9so7421145pgc.11\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 08 Dec 2017 10:55:06 -0800 (PST)", "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\tc8sm14437553pfm.92.2017.12.08.10.55.04\n\tfor <intel-wired-lan@lists.osuosl.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Dec 2017 10:55:05 -0800 (PST)" ], "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:user-agent:mime-version\n\t:content-transfer-encoding;\n\tbh=sIYCx3dXYqwWICQ/JOc3zNieJIEtY8EiiyC1YNnC0KY=;\n\tb=WseaNr783bbsamWrDz9L+hrqn3A2DQzt6ogkVcxzfg2RHE1NSs3bxTeU8CBg3NP1h+\n\tU6QoaxoKHBp70Oq+cVm9+xGtyvr9v+j9KWMpsriU/fvN55kSUOmvwRztZtMg9/AlG+fy\n\tcA/k0EowlRQHgWEbTOqWcza+QjeThk919SFDovgZyJkmiM8kHnWAjuJ6xbMHktT3aO9M\n\trlogfsYCo2j9m6FnYTQI0utrS4yuxtOjCRMK751NSvnYhLN+/S06f85RNnM2NBmPpA+z\n\tda8EW2EYTX91RA1++pYRSMJJnjWOza7kQlZBLwjKB63GeY4AGvnZuSHdroy5xS6XPWrl\n\tm6hQ==", "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:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=sIYCx3dXYqwWICQ/JOc3zNieJIEtY8EiiyC1YNnC0KY=;\n\tb=HbPZKgtT8uDeTMU8tB6m9XXNR4mxzeMABWwPHWBDxF3Elt0tUaTecXUea2PV2XHqUL\n\trLMZF8CDXYdz09rsIJAZGYe/t8idqIUw8BFgvShc1aPGqRq/clgCJpoZG2vuqPuXFvNc\n\tHflw/a9HlSaYArs2K+4lM1oZznhp2b26f6fYtYKB7gDU0crswoQk7EGB3ylfRTBN9JWJ\n\trZKf/rU/3m505mOZBDfDXVqKcKFJcPwnw7JzMy3WTvsT/ALEvQR0Z1bguOuqHENnqfZ8\n\tajPcK8tQov7tJXNbMl+Yld8t8ES8zIP8nXsM3FUPDSbjRXOrB9ZEP7UTYNTHlM+RL37i\n\tJGXQ==", "X-Gm-Message-State": "AKGB3mJdy8mAz7v9zx+bxpRhfSwL+LtUetVOWdZV0bK3rff2nv5svLj/\n\tZMSiQOPADwBaGNnR4KDTjY47aTxB", "X-Google-Smtp-Source": "AGs4zMblbLxvIOua6txKK+PYRWBeNbzDYYyVbTfN6ggrrIMPn+N8kJM2UVYgPZG8CWeNOYoeaB8oXA==", "X-Received": "by 10.84.137.3 with SMTP id 3mr8166687plm.158.1512759305895;\n\tFri, 08 Dec 2017 10:55:05 -0800 (PST)", "From": "Alexander Duyck <alexander.duyck@gmail.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 08 Dec 2017 10:55:04 -0800", "Message-ID": "<20171208185336.3685.3975.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [jkirsher/net-queue PATCH] i40e/i40evf: Account\n\tfor frags split over multiple descriptors in check linearize", "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": "From: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThe original code for __i40e_chk_linearize didn't take into account the\nfact that if a fragment is 16K in size or larger it has to be split over 2\ndescriptors and the smaller of those 2 descriptors will be on the trailing\nedge of the transmit. As a result we can get into situations where we didn't\ncatch requests that could result in a Tx hang.\n\nThis patch takes care of that by subtracting the length of all but the\ntrailing edge of the stale fragment before we test for sum. By doing this\nwe can guarantee that we have all cases covered, including the case of a\nfragment that spans multiple descriptors. We don't need to worry about\nchecking the inner portions of this since 12K is the maximum aligned DMA\nsize and that is larger than any MSS will ever be since the MTU limit for\njumbos is something on the order of 9K.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 26 ++++++++++++++++++++++---\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 26 ++++++++++++++++++++++---\n 2 files changed, 46 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 4566d66ffc7c..5bc2748ac468 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -3047,10 +3047,30 @@ bool __i40e_chk_linearize(struct sk_buff *skb)\n \t/* Walk through fragments adding latest fragment, testing it, and\n \t * then removing stale fragments from the sum.\n \t */\n-\tstale = &skb_shinfo(skb)->frags[0];\n-\tfor (;;) {\n+\tfor (stale = &skb_shinfo(skb)->frags[0];; stale++) {\n+\t\tint stale_size = skb_frag_size(stale);\n+\n \t\tsum += skb_frag_size(frag++);\n \n+\t\t/* The stale fragment may present us with a smaller\n+\t\t * descriptor than the actual fragment size. To account\n+\t\t * for that we need to remove all the data on the front and\n+\t\t * figure out what the remainder would be in the last\n+\t\t * descriptor associated with the fragment.\n+\t\t */\n+\t\tif (stale_size > I40E_MAX_DATA_PER_TXD) {\n+\t\t\tint align_pad = -(stale->page_offset) &\n+\t\t\t\t\t(I40E_MAX_READ_REQ_SIZE - 1);\n+\n+\t\t\tsum -= align_pad;\n+\t\t\tstale_size -= align_pad;\n+\n+\t\t\tdo {\n+\t\t\t\tsum -= I40E_MAX_DATA_PER_TXD_ALIGNED;\n+\t\t\t\tstale_size -= I40E_MAX_DATA_PER_TXD_ALIGNED;\n+\t\t\t} while (stale_size > I40E_MAX_DATA_PER_TXD);\n+\t\t}\n+\n \t\t/* if sum is negative we failed to make sufficient progress */\n \t\tif (sum < 0)\n \t\t\treturn true;\n@@ -3058,7 +3078,7 @@ bool __i40e_chk_linearize(struct sk_buff *skb)\n \t\tif (!nr_frags--)\n \t\t\tbreak;\n \n-\t\tsum -= skb_frag_size(stale++);\n+\t\tsum -= stale_size;\n \t}\n \n \treturn false;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 50864f99446d..1ba29bb85b67 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -2012,10 +2012,30 @@ bool __i40evf_chk_linearize(struct sk_buff *skb)\n \t/* Walk through fragments adding latest fragment, testing it, and\n \t * then removing stale fragments from the sum.\n \t */\n-\tstale = &skb_shinfo(skb)->frags[0];\n-\tfor (;;) {\n+\tfor (stale = &skb_shinfo(skb)->frags[0];; stale++) {\n+\t\tint stale_size = skb_frag_size(stale);\n+\n \t\tsum += skb_frag_size(frag++);\n \n+\t\t/* The stale fragment may present us with a smaller\n+\t\t * descriptor than the actual fragment size. To account\n+\t\t * for that we need to remove all the data on the front and\n+\t\t * figure out what the remainder would be in the last\n+\t\t * descriptor associated with the fragment.\n+\t\t */\n+\t\tif (stale_size > I40E_MAX_DATA_PER_TXD) {\n+\t\t\tint align_pad = -(stale->page_offset) &\n+\t\t\t\t\t(I40E_MAX_READ_REQ_SIZE - 1);\n+\n+\t\t\tsum -= align_pad;\n+\t\t\tstale_size -= align_pad;\n+\n+\t\t\tdo {\n+\t\t\t\tsum -= I40E_MAX_DATA_PER_TXD_ALIGNED;\n+\t\t\t\tstale_size -= I40E_MAX_DATA_PER_TXD_ALIGNED;\n+\t\t\t} while (stale_size > I40E_MAX_DATA_PER_TXD);\n+\t\t}\n+\n \t\t/* if sum is negative we failed to make sufficient progress */\n \t\tif (sum < 0)\n \t\t\treturn true;\n@@ -2023,7 +2043,7 @@ bool __i40evf_chk_linearize(struct sk_buff *skb)\n \t\tif (!nr_frags--)\n \t\t\tbreak;\n \n-\t\tsum -= skb_frag_size(stale++);\n+\t\tsum -= stale_size;\n \t}\n \n \treturn false;\n", "prefixes": [ "jkirsher/net-queue" ] }