Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/572583/?format=api
{ "id": 572583, "url": "http://patchwork.ozlabs.org/api/patches/572583/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160125051628.12004.51971.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": "<20160125051628.12004.51971.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2016-01-25T05:16:28", "name": "[next,v3,03/15] i40e/i40evf: Factor out L4 header and checksum from L3 bits in TSO path", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1d544f49d079c1f815213104791abf6d1cf670d2", "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/20160125051628.12004.51971.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/572583/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/572583/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 D06031402DD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Jan 2016 16:16:34 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BE6038C3DF;\n\tMon, 25 Jan 2016 05:16:32 +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 Dth4bNazLFbx; Mon, 25 Jan 2016 05:16:31 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 956D48C363;\n\tMon, 25 Jan 2016 05:16:31 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id B8C431C107C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:31 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B3F4E89E42\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:31 +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 L6fii2Eau87r for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:30 +0000 (UTC)", "from mail-pa0-f47.google.com (mail-pa0-f47.google.com\n\t[209.85.220.47])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id E3A0D89D36\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:30 +0000 (UTC)", "by mail-pa0-f47.google.com with SMTP id uo6so76338946pac.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun, 24 Jan 2016 21:16:30 -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\t89sm25050290pfi.2.2016.01.24.21.16.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 24 Jan 2016 21:16:29 -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=RT+riI/x; 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=At+7Vnjp707LT9W4T26XwBHo7+LYED2VGaBNj1vDxjs=;\n\tb=RT+riI/x6AVsaLwyOdJagGJe+zlTQVfpJvUbx0B4/yLO+Td3vCLMEBltqMUO2NK4Fr\n\t/YYmHjhcMy109HpjD3OX2+0O+Sl1IQwh36zXfUwTYnRlknzkTLm4dorhkqUlLUGAZK9v\n\tlERJGiMpKRXEcAXmrPyXpYN0TtGGDC0/Lhd2I=", "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=At+7Vnjp707LT9W4T26XwBHo7+LYED2VGaBNj1vDxjs=;\n\tb=f0e7GUlZ+53ZuLIvDEkx5Z6s74F/h9k/KFazS0VgTcGDu/ZoJDuvUA5i2MO+tvxnEP\n\t59r0hZvpiW2aIwZ29jHF7lBJpjPKrGtz14qWX5bgJKgg85gn1uZX8PbMiFNOu+FLZblk\n\tHHEWVtLbt73O0FwvMufjSaOg84CayOZoqHAOYAzupj0uINRaYVVv2XOa9flqPtjvPOSm\n\tcFpORMhC5JM4Io5qEqU1OtxBuXQTfaUC3b/6O6Y8vuf7qwtirzyI5mSRyQeuDB6AeVyD\n\t/DrhGB+Z5KMnNIknW11vzPaTFPyW/S1og8KI75wNZ7DGIRml0CRCzeUFTERS8bx/56lZ\n\tHHDQ==", "X-Gm-Message-State": "AG10YOSH5aVoBvbVlqzk6H3Y8NT0WRKZkKtKklo6mblhHvnDiJuqizWK5bc5/SSllrwfoi5E", "X-Received": "by 10.66.124.200 with SMTP id mk8mr23460446pab.43.1453698990434; \n\tSun, 24 Jan 2016 21:16:30 -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:28 -0800", "Message-ID": "<20160125051628.12004.51971.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 03/15] i40e/i40evf: Factor out L4\n\theader and checksum from L3 bits in TSO path", "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 makes it so that the L4 header offsets and such can be ignored\nwhen dealing with the L3 checksum and length update. This is done making\nuse of two things.\n\nFirst we can just use the offset from the L4 header to the start of the\npacket to determine the L4 offset, and from that we can then make use of\nthe data offset to determine the full length of the headers.\n\nAs far as adjusting the checksum to remove the length we can simply add the\ninverse of the length instead of having to recompute the entire\npseudo-header without the length. In the case of an IPv6 header this\nshould be significantly cheaper since we can make use of a value we already\nneeded instead of having to read the source and destination address out of\nthe packet.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 31 +++++++++++++++----------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 31 +++++++++++++++----------\n 2 files changed, 36 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex d201bedaca27..b09859e55996 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2269,9 +2269,12 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n {\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n \tstruct ipv6hdr *ipv6h;\n-\tstruct tcphdr *tcph;\n \tstruct iphdr *iph;\n-\tu32 l4len;\n+\tunion {\n+\t\tstruct tcphdr *tcp;\n+\t\tunsigned char *hdr;\n+\t} l4;\n+\tu32 paylen, l4_offset;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -2286,24 +2289,26 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\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 \n \tif (iph->version == 4) {\n-\t\ttcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb);\n \t\tiph->tot_len = 0;\n \t\tiph->check = 0;\n-\t\ttcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,\n-\t\t\t\t\t\t 0, IPPROTO_TCP, 0);\n-\t} else if (ipv6h->version == 6) {\n-\t\ttcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb);\n+\t} else {\n \t\tipv6h->payload_len = 0;\n-\t\ttcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr,\n-\t\t\t\t\t 0, IPPROTO_TCP, 0);\n \t}\n \n-\tl4len = skb->encapsulation ? inner_tcp_hdrlen(skb) : tcp_hdrlen(skb);\n-\t*hdr_len = (skb->encapsulation\n-\t\t ? (skb_inner_transport_header(skb) - skb->data)\n-\t\t : skb_transport_offset(skb)) + l4len;\n+\t/* determine offset of inner transport header */\n+\tl4_offset = l4.hdr - skb->data;\n+\n+\t/* remove payload length from inner checksum */\n+\tpaylen = (__force u16)l4.tcp->check;\n+\tpaylen += ntohs(1) * (u16)~(skb->len - l4_offset);\n+\tl4.tcp->check = ~csum_fold((__force __wsum)paylen);\n+\n+\t/* compute length of segmentation header */\n+\t*hdr_len = (l4.tcp->doff * 4) + l4_offset;\n \n \t/* find the field values */\n \tcd_cmd = I40E_TX_CTX_DESC_TSO;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 07d6b5d5a2ae..b0dc21af3cc8 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1529,9 +1529,12 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\n {\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n \tstruct ipv6hdr *ipv6h;\n-\tstruct tcphdr *tcph;\n \tstruct iphdr *iph;\n-\tu32 l4len;\n+\tunion {\n+\t\tstruct tcphdr *tcp;\n+\t\tunsigned char *hdr;\n+\t} l4;\n+\tu32 paylen, l4_offset;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -1546,24 +1549,26 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,\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 \n \tif (iph->version == 4) {\n-\t\ttcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb);\n \t\tiph->tot_len = 0;\n \t\tiph->check = 0;\n-\t\ttcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,\n-\t\t\t\t\t\t 0, IPPROTO_TCP, 0);\n-\t} else if (ipv6h->version == 6) {\n-\t\ttcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb);\n+\t} else {\n \t\tipv6h->payload_len = 0;\n-\t\ttcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr,\n-\t\t\t\t\t 0, IPPROTO_TCP, 0);\n \t}\n \n-\tl4len = skb->encapsulation ? inner_tcp_hdrlen(skb) : tcp_hdrlen(skb);\n-\t*hdr_len = (skb->encapsulation\n-\t\t ? (skb_inner_transport_header(skb) - skb->data)\n-\t\t : skb_transport_offset(skb)) + l4len;\n+\t/* determine offset of inner transport header */\n+\tl4_offset = l4.hdr - skb->data;\n+\n+\t/* remove payload length from inner checksum */\n+\tpaylen = (__force u16)l4.tcp->check;\n+\tpaylen += ntohs(1) * (u16)~(skb->len - l4_offset);\n+\tl4.tcp->check = ~csum_fold((__force __wsum)paylen);\n+\n+\t/* compute length of segmentation header */\n+\t*hdr_len = (l4.tcp->doff * 4) + l4_offset;\n \n \t/* find the field values */\n \tcd_cmd = I40E_TX_CTX_DESC_TSO;\n", "prefixes": [ "next", "v3", "03/15" ] }