get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 572584,
    "url": "http://patchwork.ozlabs.org/api/patches/572584/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160125051635.12004.43998.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": "<20160125051635.12004.43998.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-25T05:16:35",
    "name": "[next,v3,04/15] i40e/i40evf: Consolidate all header changes into TSO function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3f40fe26e2216215642d4b94584d8666478df90e",
    "submitter": {
        "id": 67293,
        "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api",
        "name": "Alexander Duyck",
        "email": "aduyck@mirantis.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/20160125051635.12004.43998.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/572584/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/572584/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\tby ozlabs.org (Postfix) with ESMTP id BC1AE1402BF\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Jan 2016 16:16:41 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AD1648C40C;\n\tMon, 25 Jan 2016 05:16:39 +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 aeBP0zYVs8jI; Mon, 25 Jan 2016 05:16:38 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D75808C363;\n\tMon, 25 Jan 2016 05:16:38 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2C1321C107C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:39 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 640B18C363\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16: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 SushksKP-bkp for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:36 +0000 (UTC)",
            "from mail-pf0-f182.google.com (mail-pf0-f182.google.com\n\t[209.85.192.182])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 2F3E48C3DF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:36 +0000 (UTC)",
            "by mail-pf0-f182.google.com with SMTP id e65so76269922pfe.0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun, 24 Jan 2016 21:16:37 -0800 (PST)",
            "from localhost.localdomain\n\t(static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36])\n\tby smtp.gmail.com with ESMTPSA id\n\t191sm25004920pfa.23.2016.01.24.21.16.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 24 Jan 2016 21:16:36 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=G9Wp8JgI; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-type:content-transfer-encoding;\n\tbh=olnDCYjl0ruc7gsY+tIMTLr7okQrHOoXfMzyd100V/E=;\n\tb=G9Wp8JgI4hRmpoDa7GO5mK8LRx1l6KS6L5f6PC2imq7b4/cIMRX5S6jtmUICTFKs6g\n\tcVZEJVGP8zz/fnRL+Hd9JOVdCZ82g0/pv79052NGevUUjTF9vPKH2/rwYvgbs6WO1Xaz\n\t8bwED6mSF5xGraT7WeKQHW9xBs6kNJ4ywve2k=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-type\n\t:content-transfer-encoding;\n\tbh=olnDCYjl0ruc7gsY+tIMTLr7okQrHOoXfMzyd100V/E=;\n\tb=YwzQ+/+intY+G9krOsPmLnCZqFfHh5RsClDf6IpfOC6qk51A6TVsDRp66RuS2yJ6Zc\n\tBtf3ZbW6gDIIsNlb891w/rX0Gw1Dz1FFiCXUkfc4EzwUq97/NgvsYRkQbCqwJ2VzH9+R\n\t/bt8hWv2eMas8Apnow71Vxa8sGrZ50YtIJxoGI5gIYspqSsDTVOuVSw2QMVxQw2pPq4+\n\t7RZTduxs43YXNmgsA5C5WNDloKWNg6ZDCreGBeActhNYqQjgLv2+R0JTWyhuDR/O9KAC\n\te9xPeMBam4cUYgFEN6xzzQ4p8Zl4+s1AhRd6h50X9+SCJpZxFI+RlyAbHqjMiGzwPa9V\n\tWfsQ==",
        "X-Gm-Message-State": "AG10YOR7uB+I1svJ2mk6dFAX2mf8nPu1vwvlGS5f+ubikW4pIJ9BhB2RJjQ0y99zReVr9P1c",
        "X-Received": "by 10.98.9.220 with SMTP id 89mr23327295pfj.17.1453698997256;\n\tSun, 24 Jan 2016 21:16:37 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Sun, 24 Jan 2016 21:16:35 -0800",
        "Message-ID": "<20160125051635.12004.43998.stgit@localhost.localdomain>",
        "In-Reply-To": "<20160125050602.12004.38884.stgit@localhost.localdomain>",
        "References": "<20160125050602.12004.38884.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH v3 04/15] i40e/i40evf: Consolidate\n\tall header changes into TSO function",
        "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": "This patch goes through and pulls all of the spots where we were updating\neither the TCP or IP checksums in the TSO and checksum path into the TSO\nfunction.  The general idea here is that we should only be updating the\nheader after we verify we have completed a skb_cow_head check to verify the\nhead is writable.\n\nOne other advantage to doing this is that it makes things much more\nobvious.  For example, in the case of IPv6 there was one spot where the\noffset of the IPv4 header checksum was being updated which is obviously\nincorrect.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   44 +++++++++++++++----------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c |   44 +++++++++++++++----------\n 2 files changed, 52 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex b09859e55996..c84ba5d4634a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2268,8 +2268,11 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\t    u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n {\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n-\tstruct ipv6hdr *ipv6h;\n-\tstruct iphdr *iph;\n+\tunion {\n+\t\tstruct iphdr *v4;\n+\t\tstruct ipv6hdr *v6;\n+\t\tunsigned char *hdr;\n+\t} ip;\n \tunion {\n \t\tstruct tcphdr *tcp;\n \t\tunsigned char *hdr;\n@@ -2287,16 +2290,29 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tif (err < 0)\n \t\treturn err;\n \n-\tiph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);\n-\tipv6h = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);\n-\tl4.hdr = skb->encapsulation ? skb_inner_transport_header(skb) :\n-\t\t\t\t      skb_transport_header(skb);\n+\tip.hdr = skb_network_header(skb);\n+\tl4.hdr = skb_transport_header(skb);\n \n-\tif (iph->version == 4) {\n-\t\tiph->tot_len = 0;\n-\t\tiph->check = 0;\n+\t/* initialize outer IP header fields */\n+\tif (ip.v4->version == 4) {\n+\t\tip.v4->tot_len = 0;\n+\t\tip.v4->check = 0;\n \t} else {\n-\t\tipv6h->payload_len = 0;\n+\t\tip.v6->payload_len = 0;\n+\t}\n+\n+\tif (skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL | SKB_GSO_GRE)) {\n+\t\t/* reset pointers to inner headers */\n+\t\tip.hdr = skb_inner_network_header(skb);\n+\t\tl4.hdr = skb_inner_transport_header(skb);\n+\n+\t\t/* initialize inner IP header fields */\n+\t\tif (ip.v4->version == 4) {\n+\t\t\tip.v4->tot_len = 0;\n+\t\t\tip.v4->check = 0;\n+\t\t} else {\n+\t\t\tip.v6->payload_len = 0;\n+\t\t}\n \t}\n \n \t/* determine offset of inner transport header */\n@@ -2381,15 +2397,11 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \tstruct iphdr *this_ip_hdr;\n \tu32 network_hdr_len;\n \tu8 l4_hdr = 0;\n-\tstruct udphdr *oudph = NULL;\n-\tstruct iphdr *oiph = NULL;\n \tu32 l4_tunnel = 0;\n \n \tif (skb->encapsulation) {\n \t\tswitch (ip_hdr(skb)->protocol) {\n \t\tcase IPPROTO_UDP:\n-\t\t\toudph = udp_hdr(skb);\n-\t\t\toiph = ip_hdr(skb);\n \t\t\tl4_tunnel = I40E_TXD_CTX_UDP_TUNNELING;\n \t\t\t*tx_flags |= I40E_TX_FLAGS_TUNNEL;\n \t\t\tbreak;\n@@ -2408,15 +2420,12 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\tif (*tx_flags & I40E_TX_FLAGS_IPV4) {\n \t\t\tif (*tx_flags & I40E_TX_FLAGS_TSO) {\n \t\t\t\t*cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV4;\n-\t\t\t\tip_hdr(skb)->check = 0;\n \t\t\t} else {\n \t\t\t\t*cd_tunneling |=\n \t\t\t\t\t I40E_TX_CTX_EXT_IP_IPV4_NO_CSUM;\n \t\t\t}\n \t\t} else if (*tx_flags & I40E_TX_FLAGS_IPV6) {\n \t\t\t*cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV6;\n-\t\t\tif (*tx_flags & I40E_TX_FLAGS_TSO)\n-\t\t\t\tip_hdr(skb)->check = 0;\n \t\t}\n \n \t\t/* Now set the ctx descriptor fields */\n@@ -2445,7 +2454,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\t */\n \t\tif (*tx_flags & I40E_TX_FLAGS_TSO) {\n \t\t\t*td_cmd |= I40E_TX_DESC_CMD_IIPT_IPV4_CSUM;\n-\t\t\tthis_ip_hdr->check = 0;\n \t\t} else {\n \t\t\t*td_cmd |= I40E_TX_DESC_CMD_IIPT_IPV4;\n \t\t}\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex b0dc21af3cc8..1b2788093425 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1528,8 +1528,11 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\t    u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n {\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n-\tstruct ipv6hdr *ipv6h;\n-\tstruct iphdr *iph;\n+\tunion {\n+\t\tstruct iphdr *v4;\n+\t\tstruct ipv6hdr *v6;\n+\t\tunsigned char *hdr;\n+\t} ip;\n \tunion {\n \t\tstruct tcphdr *tcp;\n \t\tunsigned char *hdr;\n@@ -1547,16 +1550,29 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tif (err < 0)\n \t\treturn err;\n \n-\tiph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);\n-\tipv6h = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);\n-\tl4.hdr = skb->encapsulation ? skb_inner_transport_header(skb) :\n-\t\t\t\t      skb_transport_header(skb);\n+\tip.hdr = skb_network_header(skb);\n+\tl4.hdr = skb_transport_header(skb);\n \n-\tif (iph->version == 4) {\n-\t\tiph->tot_len = 0;\n-\t\tiph->check = 0;\n+\t/* initialize outer IP header fields */\n+\tif (ip.v4->version == 4) {\n+\t\tip.v4->tot_len = 0;\n+\t\tip.v4->check = 0;\n \t} else {\n-\t\tipv6h->payload_len = 0;\n+\t\tip.v6->payload_len = 0;\n+\t}\n+\n+\tif (skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL | SKB_GSO_GRE)) {\n+\t\t/* reset pointers to inner headers */\n+\t\tip.hdr = skb_inner_network_header(skb);\n+\t\tl4.hdr = skb_inner_transport_header(skb);\n+\n+\t\t/* initialize inner IP header fields */\n+\t\tif (ip.v4->version == 4) {\n+\t\t\tip.v4->tot_len = 0;\n+\t\t\tip.v4->check = 0;\n+\t\t} else {\n+\t\t\tip.v6->payload_len = 0;\n+\t\t}\n \t}\n \n \t/* determine offset of inner transport header */\n@@ -1598,15 +1614,11 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \tstruct iphdr *this_ip_hdr;\n \tu32 network_hdr_len;\n \tu8 l4_hdr = 0;\n-\tstruct udphdr *oudph;\n-\tstruct iphdr *oiph;\n \tu32 l4_tunnel = 0;\n \n \tif (skb->encapsulation) {\n \t\tswitch (ip_hdr(skb)->protocol) {\n \t\tcase IPPROTO_UDP:\n-\t\t\toudph = udp_hdr(skb);\n-\t\t\toiph = ip_hdr(skb);\n \t\t\tl4_tunnel = I40E_TXD_CTX_UDP_TUNNELING;\n \t\t\t*tx_flags |= I40E_TX_FLAGS_TUNNEL;\n \t\t\tbreak;\n@@ -1621,15 +1633,12 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\tif (*tx_flags & I40E_TX_FLAGS_IPV4) {\n \t\t\tif (*tx_flags & I40E_TX_FLAGS_TSO) {\n \t\t\t\t*cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV4;\n-\t\t\t\tip_hdr(skb)->check = 0;\n \t\t\t} else {\n \t\t\t\t*cd_tunneling |=\n \t\t\t\t\t I40E_TX_CTX_EXT_IP_IPV4_NO_CSUM;\n \t\t\t}\n \t\t} else if (*tx_flags & I40E_TX_FLAGS_IPV6) {\n \t\t\t*cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV6;\n-\t\t\tif (*tx_flags & I40E_TX_FLAGS_TSO)\n-\t\t\t\tip_hdr(skb)->check = 0;\n \t\t}\n \n \t\t/* Now set the ctx descriptor fields */\n@@ -1659,7 +1668,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\t */\n \t\tif (*tx_flags & I40E_TX_FLAGS_TSO) {\n \t\t\t*td_cmd |= I40E_TX_DESC_CMD_IIPT_IPV4_CSUM;\n-\t\t\tthis_ip_hdr->check = 0;\n \t\t} else {\n \t\t\t*td_cmd |= I40E_TX_DESC_CMD_IIPT_IPV4;\n \t\t}\n",
    "prefixes": [
        "next",
        "v3",
        "04/15"
    ]
}