get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 470208,
    "url": "http://patchwork.ozlabs.org/api/patches/470208/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.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": "<20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.intel.com>",
    "list_archive_url": null,
    "date": "2015-05-08T22:35:52",
    "name": "[net,1/2] i40e/i40evf: Fix mixed size frags and linearization",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "12d49fbcebb306e600607219612421925dc2dd92",
    "submitter": {
        "id": 189,
        "url": "http://patchwork.ozlabs.org/api/people/189/?format=api",
        "name": "Jesse Brandeburg",
        "email": "jesse.brandeburg@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/20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/470208/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/470208/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 fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 3969014018C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 May 2015 08:35:56 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6FF71A1F1E;\n\tFri,  8 May 2015 22:35:55 +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 wRqngg8Iw7_S; Fri,  8 May 2015 22:35:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DD426A1F12;\n\tFri,  8 May 2015 22:35:54 +0000 (UTC)",
            "from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 7EF541C1FD1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 May 2015 22:35:53 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 77504A1F19\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 May 2015 22:35:53 +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 3I018-YYxIYx for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 May 2015 22:35:52 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D22CEA1F12\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 May 2015 22:35:52 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP; 08 May 2015 15:35:52 -0700",
            "from jbrandeb-cp2.jf.intel.com ([134.134.3.82])\n\tby fmsmga001.fm.intel.com with ESMTP; 08 May 2015 15:35:52 -0700"
        ],
        "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.13,393,1427785200\"; d=\"scan'208\";a=\"707509040\"",
        "To": "intel-wired-lan@lists.osuosl.org",
        "From": "Jesse Brandeburg <jesse.brandeburg@intel.com>",
        "Date": "Fri, 08 May 2015 15:35:52 -0700",
        "Message-ID": "<20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.intel.com>",
        "User-Agent": "StGit/0.16-44-gd947d-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [net PATCH 1/2] i40e/i40evf: Fix mixed size frags\n\tand linearization",
        "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: Anjali Singhai Jain <anjali.singhai@intel.com>\n\nThis patch fixes a bug where the i40e tx queue will hang if this\nskb is passed to the driver.\n\nWith mixed size fragments while using TSO there was a corner case\nwhere we needed to linearize but we were not. This was seen with\niSCSI traffic and could be reproduced with a frag list that looks\nlike this:\n\nnum_frags = 17, gso_segs = 17, hdr_len = 66,\nskb_shinfo(skb)->gso_size = 1448\nsize = 3002, j = 1, frag_size = 2936, num_frags = 17\nsize = 4268, j = 1, frag_size = 4096, num_frags = 16\nsize = 5534, j = 1, frag_size = 4096, num_frags = 15\nsize = 5352, j = 1, frag_size = 4096, num_frags = 14\nsize = 5170, j = 1, frag_size = 4096, num_frags = 13\nsize = 3468, j = 1, frag_size = 2576, num_frags = 12\nsize = 750, j = 1, frag_size = 112, num_frags = 11\nsize = 862, j = 2, frag_size = 112, num_frags = 10\nsize = 974, j = 3, frag_size = 112, num_frags = 9\nsize = 1126, j = 4, frag_size = 152, num_frags = 8\nsize = 1330, j = 5, frag_size = 204, num_frags = 7\nsize = 1534, j = 6, frag_size = 204, num_frags = 6\nsize = 356, j = 1, frag_size = 204, num_frags = 5\nsize = 560, j = 2, frag_size = 204, num_frags = 4\nsize = 764, j = 3, frag_size = 204, num_frags = 3\nsize = 968, j = 4, frag_size = 204, num_frags = 2\nsize = 1140, j = 5, frag_size = 172, num_frags = 1\nresult: linearize = 0, j = 6\n\nChange-ID: I79bb1aeab0af255fe2ce28e93672a85d85bf47e8\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   25 ++++++++++---------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c |   25 ++++++++++---------------\n 2 files changed, 20 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 4bd3a80..9d95042d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2410,14 +2410,12 @@ static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)\n  * i40e_chk_linearize - Check if there are more than 8 fragments per packet\n  * @skb:      send buffer\n  * @tx_flags: collected send information\n- * @hdr_len:  size of the packet header\n  *\n  * Note: Our HW can't scatter-gather more than 8 fragments to build\n  * a packet on the wire and so we need to figure out the cases where we\n  * need to linearize the skb.\n  **/\n-static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n-\t\t\t       const u8 hdr_len)\n+static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags)\n {\n \tstruct skb_frag_struct *frag;\n \tbool linearize = false;\n@@ -2429,7 +2427,7 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n \tgso_segs = skb_shinfo(skb)->gso_segs;\n \n \tif (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) {\n-\t\tu16 j = 1;\n+\t\tu16 j = 0;\n \n \t\tif (num_frags < (I40E_MAX_BUFFER_TXD))\n \t\t\tgoto linearize_chk_done;\n@@ -2440,21 +2438,18 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n \t\t\tgoto linearize_chk_done;\n \t\t}\n \t\tfrag = &skb_shinfo(skb)->frags[0];\n-\t\tsize = hdr_len;\n \t\t/* we might still have more fragments per segment */\n \t\tdo {\n \t\t\tsize += skb_frag_size(frag);\n \t\t\tfrag++; j++;\n+\t\t\tif ((size >= skb_shinfo(skb)->gso_size) &&\n+\t\t\t    (j < I40E_MAX_BUFFER_TXD)) {\n+\t\t\t\tsize = (size % skb_shinfo(skb)->gso_size);\n+\t\t\t\tj = (size) ? 1 : 0;\n+\t\t\t}\n \t\t\tif (j == I40E_MAX_BUFFER_TXD) {\n-\t\t\t\tif (size < skb_shinfo(skb)->gso_size) {\n-\t\t\t\t\tlinearize = true;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\tj = 1;\n-\t\t\t\tsize -= skb_shinfo(skb)->gso_size;\n-\t\t\t\tif (size)\n-\t\t\t\t\tj++;\n-\t\t\t\tsize += hdr_len;\n+\t\t\t\tlinearize = true;\n+\t\t\t\tbreak;\n \t\t\t}\n \t\t\tnum_frags--;\n \t\t} while (num_frags);\n@@ -2724,7 +2719,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \tif (tsyn)\n \t\ttx_flags |= I40E_TX_FLAGS_TSYN;\n \n-\tif (i40e_chk_linearize(skb, tx_flags, hdr_len))\n+\tif (i40e_chk_linearize(skb, tx_flags))\n \t\tif (skb_linearize(skb))\n \t\t\tgoto out_drop;\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex b077e02..458fbb4 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1619,14 +1619,12 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,\n  * i40e_chk_linearize - Check if there are more than 8 fragments per packet\n  * @skb:      send buffer\n  * @tx_flags: collected send information\n- * @hdr_len:  size of the packet header\n  *\n  * Note: Our HW can't scatter-gather more than 8 fragments to build\n  * a packet on the wire and so we need to figure out the cases where we\n  * need to linearize the skb.\n  **/\n-static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n-\t\t\t       const u8 hdr_len)\n+static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags)\n {\n \tstruct skb_frag_struct *frag;\n \tbool linearize = false;\n@@ -1638,7 +1636,7 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n \tgso_segs = skb_shinfo(skb)->gso_segs;\n \n \tif (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) {\n-\t\tu16 j = 1;\n+\t\tu16 j = 0;\n \n \t\tif (num_frags < (I40E_MAX_BUFFER_TXD))\n \t\t\tgoto linearize_chk_done;\n@@ -1649,21 +1647,18 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,\n \t\t\tgoto linearize_chk_done;\n \t\t}\n \t\tfrag = &skb_shinfo(skb)->frags[0];\n-\t\tsize = hdr_len;\n \t\t/* we might still have more fragments per segment */\n \t\tdo {\n \t\t\tsize += skb_frag_size(frag);\n \t\t\tfrag++; j++;\n+\t\t\tif ((size >= skb_shinfo(skb)->gso_size) &&\n+\t\t\t    (j < I40E_MAX_BUFFER_TXD)) {\n+\t\t\t\tsize = (size % skb_shinfo(skb)->gso_size);\n+\t\t\t\tj = (size) ? 1 : 0;\n+\t\t\t}\n \t\t\tif (j == I40E_MAX_BUFFER_TXD) {\n-\t\t\t\tif (size < skb_shinfo(skb)->gso_size) {\n-\t\t\t\t\tlinearize = true;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\tj = 1;\n-\t\t\t\tsize -= skb_shinfo(skb)->gso_size;\n-\t\t\t\tif (size)\n-\t\t\t\t\tj++;\n-\t\t\t\tsize += hdr_len;\n+\t\t\t\tlinearize = true;\n+\t\t\t\tbreak;\n \t\t\t}\n \t\t\tnum_frags--;\n \t\t} while (num_frags);\n@@ -1950,7 +1945,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \telse if (tso)\n \t\ttx_flags |= I40E_TX_FLAGS_TSO;\n \n-\tif (i40e_chk_linearize(skb, tx_flags, hdr_len))\n+\tif (i40e_chk_linearize(skb, tx_flags))\n \t\tif (skb_linearize(skb))\n \t\t\tgoto out_drop;\n \n",
    "prefixes": [
        "net",
        "1/2"
    ]
}