Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/572581/?format=api
{ "id": 572581, "url": "http://patchwork.ozlabs.org/api/patches/572581/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160125051612.12004.32828.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": "<20160125051612.12004.32828.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2016-01-25T05:16:13", "name": "[next,v3,01/15] i40e/i40evf: Drop outer checksum offload that was not requested", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "561180f8b5b9842129ed7661b5afa47791b2596e", "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/20160125051612.12004.32828.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/572581/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/572581/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 B57271402BF\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Jan 2016 16:16:20 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8E7BB8C3DA;\n\tMon, 25 Jan 2016 05:16:18 +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 ksOz-1d+J+30; Mon, 25 Jan 2016 05:16:17 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 16F338C363;\n\tMon, 25 Jan 2016 05:16:17 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0A8BD1C107C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:17 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9DED28C3BF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:15 +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 R910ERKTS5fr for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:14 +0000 (UTC)", "from mail-pf0-f169.google.com (mail-pf0-f169.google.com\n\t[209.85.192.169])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 70B278C363\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 05:16:14 +0000 (UTC)", "by mail-pf0-f169.google.com with SMTP id q63so78045739pfb.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun, 24 Jan 2016 21:16:15 -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\tv26sm24965478pfi.56.2016.01.24.21.16.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 24 Jan 2016 21:16:15 -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=dD5Rw12Z; 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=CH9hm7EVDQjnB7ESBsSJ+wMVrJZb/948mHryRPkXpZw=;\n\tb=dD5Rw12ZJbPpATwWThxXOvn18aNOE1S8M9rAVYQrRvB6591gLYI2VLjWlpUhDDxSad\n\tRFig4pwkERKp7A3uXIT8UmAMvBY+E7l+5NUpUU6S2KXlBxlPihDllcuA0uavmltfd0Ae\n\tK6l3BOiloyIx9WdAaDlVDfGr7zcxDRUOBKw+E=", "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=CH9hm7EVDQjnB7ESBsSJ+wMVrJZb/948mHryRPkXpZw=;\n\tb=mc+qouqsC3Bk8nvrW0khOZfVa75EhryDIzgzTYwI5zdiVFSnA22DQdfTnXybPUx7nV\n\tX4rLsma8+sfOhCC+vTw46d1LxvETJmg74hvPDx2cPiHMQATvAwq5opz03w/MpPTQclwq\n\tO73k1gnN6Rj5xpv676/WhfYcDobkgLtf4CXcPPIXVX3YJ2vcxgMVv/e/7/R/Dib0AfaR\n\t7OqAQsYr22LQPGOkBYn4XE/6dDQEbtECMTwpt6yF5rSI0ZDMmZSXqx+oT7BNg++s6Vo/\n\trVTPySZp6+b76CxmCprw/+aTpONfsT1+/CbED/zlYp0fhZ9V3HIEt09nwKMHDFZVn6Nz\n\ty4Tg==", "X-Gm-Message-State": "AG10YOR2UuPpHQGgcjufd5Y+dCLTBmc9YQzAvn0vYN8I12DYOKFHFoS+xf9tutz8XKdqfAyX", "X-Received": "by 10.98.32.156 with SMTP id m28mr23326409pfj.74.1453698975512; \n\tSun, 24 Jan 2016 21:16:15 -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:13 -0800", "Message-ID": "<20160125051612.12004.32828.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 01/15] i40e/i40evf: Drop outer\n\tchecksum offload that was not requested", "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": "The i40e and i40evf drivers contained code for inserting an outer checksum\non UDP tunnels. The issue however is that the upper levels of the stack\nnever requested such an offload and it results in possible errors.\n\nIn addition the same logic was being applied to the Rx side where it was\nattempting to validate the outer checksum, but the logic there was\nincorrect in that it was testing for the resultant sum to be equal to the\nheader checksum instead of being equal to 0.\n\nSince this code is so massively flawed, and doing things that we didn't ask\nfor it to do I am just dropping it, and will bring it back later to use as\nan offload for SKB_GSO_UDP_TUNNEL_CSUM which can make use of such a\nfeature.\n\nAs far as the Rx feature I am dropping it completely since it would need to\nbe massively expanded and applied to IPv4 and IPv6 checksums for all parts,\nnot just the one that supports Tx checksum offload for the outer.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 2 -\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 47 +++----------------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 -\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 46 +++---------------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 1 -\n 5 files changed, 10 insertions(+), 87 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 06b2204860a9..1316b9958e7e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -7465,8 +7465,6 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi)\n \t\ttx_ring->dcb_tc = 0;\n \t\tif (vsi->back->flags & I40E_FLAG_WB_ON_ITR_CAPABLE)\n \t\t\ttx_ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;\n-\t\tif (vsi->back->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE)\n-\t\t\ttx_ring->flags |= I40E_TXR_FLAGS_OUTER_UDP_CSUM;\n \t\tvsi->tx_rings[i] = tx_ring;\n \n \t\trx_ring = &tx_ring[1];\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 7702e5faf609..c92198e7f5bc 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1391,9 +1391,6 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \tstruct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype);\n \tbool ipv4 = false, ipv6 = false;\n \tbool ipv4_tunnel, ipv6_tunnel;\n-\t__wsum rx_udp_csum;\n-\tstruct iphdr *iph;\n-\t__sum16 csum;\n \n \tipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) &&\n \t\t (rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4);\n@@ -1443,37 +1440,12 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \tif (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT))\n \t\treturn;\n \n-\t/* If VXLAN/GENEVE traffic has an outer UDPv4 checksum we need to check\n-\t * it in the driver, hardware does not do it for us.\n-\t * Since L3L4P bit was set we assume a valid IHL value (>=5)\n-\t * so the total length of IPv4 header is IHL*4 bytes\n-\t * The UDP_0 bit *may* bet set if the *inner* header is UDP\n+\t/* The hardware supported by this driver does not validate outer\n+\t * checksums for tunneled VXLAN or GENEVE frames. I don't agree\n+\t * with it but the specification states that you \"MAY validate\", it\n+\t * doesn't make it a hard requirement so if we have validated the\n+\t * inner checksum report CHECKSUM_UNNECESSARY.\n \t */\n-\tif (!(vsi->back->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE) &&\n-\t (ipv4_tunnel)) {\n-\t\tskb->transport_header = skb->mac_header +\n-\t\t\t\t\tsizeof(struct ethhdr) +\n-\t\t\t\t\t(ip_hdr(skb)->ihl * 4);\n-\n-\t\t/* Add 4 bytes for VLAN tagged packets */\n-\t\tskb->transport_header += (skb->protocol == htons(ETH_P_8021Q) ||\n-\t\t\t\t\t skb->protocol == htons(ETH_P_8021AD))\n-\t\t\t\t\t ? VLAN_HLEN : 0;\n-\n-\t\tif ((ip_hdr(skb)->protocol == IPPROTO_UDP) &&\n-\t\t (udp_hdr(skb)->check != 0)) {\n-\t\t\trx_udp_csum = udp_csum(skb);\n-\t\t\tiph = ip_hdr(skb);\n-\t\t\tcsum = csum_tcpudp_magic(\n-\t\t\t\t\tiph->saddr, iph->daddr,\n-\t\t\t\t\t(skb->len - skb_transport_offset(skb)),\n-\t\t\t\t\tIPPROTO_UDP, rx_udp_csum);\n-\n-\t\t\tif (udp_hdr(skb)->check != csum)\n-\t\t\t\tgoto checksum_fail;\n-\n-\t\t} /* else its GRE and so no outer UDP header */\n-\t}\n \n \tskb->ip_summed = CHECKSUM_UNNECESSARY;\n \tskb->csum_level = ipv4_tunnel || ipv6_tunnel;\n@@ -2454,15 +2426,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\t\t*tx_flags &= ~I40E_TX_FLAGS_IPV4;\n \t\t\t*tx_flags |= I40E_TX_FLAGS_IPV6;\n \t\t}\n-\t\tif ((tx_ring->flags & I40E_TXR_FLAGS_OUTER_UDP_CSUM) &&\n-\t\t (l4_tunnel == I40E_TXD_CTX_UDP_TUNNELING) &&\n-\t\t (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)) {\n-\t\t\toudph->check = ~csum_tcpudp_magic(oiph->saddr,\n-\t\t\t\t\toiph->daddr,\n-\t\t\t\t\t(skb->len - skb_transport_offset(skb)),\n-\t\t\t\t\tIPPROTO_UDP, 0);\n-\t\t\t*cd_tunneling |= I40E_TXD_CTX_QW0_L4T_CS_MASK;\n-\t\t}\n \t} else {\n \t\tnetwork_hdr_len = skb_network_header_len(skb);\n \t\tthis_ip_hdr = ip_hdr(skb);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex 45496dfa5fd7..e1f4dedf6754 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -277,7 +277,6 @@ struct i40e_ring {\n \n \tu16 flags;\n #define I40E_TXR_FLAGS_WB_ON_ITR\tBIT(0)\n-#define I40E_TXR_FLAGS_OUTER_UDP_CSUM\tBIT(1)\n #define I40E_TXR_FLAGS_LAST_XMIT_MORE_SET BIT(2)\n \n \t/* stats structs */\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex ecd2df28d8b8..f7ac254b79f0 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -863,9 +863,6 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \tstruct i40e_rx_ptype_decoded decoded = decode_rx_desc_ptype(rx_ptype);\n \tbool ipv4 = false, ipv6 = false;\n \tbool ipv4_tunnel, ipv6_tunnel;\n-\t__wsum rx_udp_csum;\n-\tstruct iphdr *iph;\n-\t__sum16 csum;\n \n \tipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) &&\n \t\t (rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4);\n@@ -915,36 +912,12 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \tif (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT))\n \t\treturn;\n \n-\t/* If VXLAN traffic has an outer UDPv4 checksum we need to check\n-\t * it in the driver, hardware does not do it for us.\n-\t * Since L3L4P bit was set we assume a valid IHL value (>=5)\n-\t * so the total length of IPv4 header is IHL*4 bytes\n-\t * The UDP_0 bit *may* bet set if the *inner* header is UDP\n+\t/* The hardware supported by this driver does not validate outer\n+\t * checksums for tunneled VXLAN or GENEVE frames. I don't agree\n+\t * with it but the specification states that you \"MAY validate\", it\n+\t * doesn't make it a hard requirement so if we have validated the\n+\t * inner checksum report CHECKSUM_UNNECESSARY.\n \t */\n-\tif (ipv4_tunnel) {\n-\t\tskb->transport_header = skb->mac_header +\n-\t\t\t\t\tsizeof(struct ethhdr) +\n-\t\t\t\t\t(ip_hdr(skb)->ihl * 4);\n-\n-\t\t/* Add 4 bytes for VLAN tagged packets */\n-\t\tskb->transport_header += (skb->protocol == htons(ETH_P_8021Q) ||\n-\t\t\t\t\t skb->protocol == htons(ETH_P_8021AD))\n-\t\t\t\t\t ? VLAN_HLEN : 0;\n-\n-\t\tif ((ip_hdr(skb)->protocol == IPPROTO_UDP) &&\n-\t\t (udp_hdr(skb)->check != 0)) {\n-\t\t\trx_udp_csum = udp_csum(skb);\n-\t\t\tiph = ip_hdr(skb);\n-\t\t\tcsum = csum_tcpudp_magic(iph->saddr, iph->daddr,\n-\t\t\t\t\t\t (skb->len -\n-\t\t\t\t\t\t skb_transport_offset(skb)),\n-\t\t\t\t\t\t IPPROTO_UDP, rx_udp_csum);\n-\n-\t\t\tif (udp_hdr(skb)->check != csum)\n-\t\t\t\tgoto checksum_fail;\n-\n-\t\t} /* else its GRE and so no outer UDP header */\n-\t}\n \n \tskb->ip_summed = CHECKSUM_UNNECESSARY;\n \tskb->csum_level = ipv4_tunnel || ipv6_tunnel;\n@@ -1667,15 +1640,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\t\t*tx_flags |= I40E_TX_FLAGS_IPV6;\n \t\t}\n \n-\t\tif ((tx_ring->flags & I40E_TXR_FLAGS_OUTER_UDP_CSUM) &&\n-\t\t (l4_tunnel == I40E_TXD_CTX_UDP_TUNNELING) &&\n-\t\t (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)) {\n-\t\t\toudph->check = ~csum_tcpudp_magic(oiph->saddr,\n-\t\t\t\t\toiph->daddr,\n-\t\t\t\t\t(skb->len - skb_transport_offset(skb)),\n-\t\t\t\t\tIPPROTO_UDP, 0);\n-\t\t\t*cd_tunneling |= I40E_TXD_CTX_QW0_L4T_CS_MASK;\n-\t\t}\n \t} else {\n \t\tnetwork_hdr_len = skb_network_header_len(skb);\n \t\tthis_ip_hdr = ip_hdr(skb);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\nindex bbd98b785ae0..ce1898fe4094 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n@@ -275,7 +275,6 @@ struct i40e_ring {\n \n \tu16 flags;\n #define I40E_TXR_FLAGS_WB_ON_ITR\tBIT(0)\n-#define I40E_TXR_FLAGS_OUTER_UDP_CSUM\tBIT(1)\n \n \t/* stats structs */\n \tstruct i40e_queue_stats\tstats;\n", "prefixes": [ "next", "v3", "01/15" ] }