Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/566060/?format=api
{ "id": 566060, "url": "http://patchwork.ozlabs.org/api/patches/566060/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160111175409.4101.73461.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": "<20160111175409.4101.73461.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2016-01-11T17:54:09", "name": "[next,3/4] igb: Add support for generic Tx checksums", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "c1f16ae70854a671e2949c889246f87a06cba7fd", "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/20160111175409.4101.73461.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/566060/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/566060/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 620EF1402F0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Jan 2016 04:54:14 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id EDEC186A78;\n\tMon, 11 Jan 2016 17:54:12 +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 Qnoljo8aSmoi; Mon, 11 Jan 2016 17:54:12 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 0754D86D24;\n\tMon, 11 Jan 2016 17:54:12 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6259E1C1E4E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Jan 2016 17:54:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id ABEA986A78\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Jan 2016 17:54:10 +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 ltI3jci0Q5kp for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Jan 2016 17:54:10 +0000 (UTC)", "from mail-pf0-f176.google.com (mail-pf0-f176.google.com\n\t[209.85.192.176])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 068198694F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Jan 2016 17:54:10 +0000 (UTC)", "by mail-pf0-f176.google.com with SMTP id 65so48034732pff.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 11 Jan 2016 09:54:10 -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\tb28sm24715023pfd.24.2016.01.11.09.54.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Jan 2016 09:54:09 -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=GC/P58CX; 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=N6rdfgRGpyRyvXhAzjDXSdFE2EGFWCkl044zSEfvtWY=;\n\tb=GC/P58CXVy5eLKbMDJOdyw+RfWPpqZpaAUjICinUV0MXjftlym2Uod5pJmMK5J7z67\n\tJ2KkSsDh/p/rDckAMuycJ7XEiKUgaJ7YTiS1/wPCBRpT6JBCNxPlQk3IrHsP0Fit8N9b\n\twWHZBLZOFVFsRmqhfFWI109m4dzOsW5ySqYzc=", "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=N6rdfgRGpyRyvXhAzjDXSdFE2EGFWCkl044zSEfvtWY=;\n\tb=HXG2zsAmmnyTSOJ6SKQOViF1CpKMgpWV8UEjR13V7zl/6t6iVBQOPukpMI01UJWTm4\n\ti42I84s4UNU5Loq9chZ0IPAseWqYR3SZcQh/Kg/KOsVPQRYwmOaB+V1yL/wzdKRJU8nM\n\tEvTgP9LbfIdaYaHEZI00nTyTLQMaPFBO5ispXndr3mMXEzeC442fjgGxq9bD7jaXMVSx\n\tEOVJIz3KlKax6C8RyY6IDaxfGZ+TJ+55n3/FCkB238JuPZgie5YPcUzL13WQEx7MiIeZ\n\tGCgbSnMsoknzrJo9TIGZW40MTlka4Adt17Isjpqkclhh0BMr5+IXhaaPRPcEqERjGNuR\n\t2oRg==", "X-Gm-Message-State": "ALoCoQky3DeHlLAXQBMGWJx566dIENExC0LyFqanEN3u9FlYS0rdGMv6YtifoS9reqBC6BRhpV1MTMMfJzllifEPWgJqKkxTUQ==", "X-Received": "by 10.98.15.66 with SMTP id x63mr18421287pfi.19.1452534850422;\n\tMon, 11 Jan 2016 09:54:10 -0800 (PST)", "From": "Alexander Duyck <aduyck@mirantis.com>", "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com", "Date": "Mon, 11 Jan 2016 09:54:09 -0800", "Message-ID": "<20160111175409.4101.73461.stgit@localhost.localdomain>", "In-Reply-To": "<20160111173724.4101.35798.stgit@localhost.localdomain>", "References": "<20160111173724.4101.35798.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Cc": "tom@herbertland.com, netdev@vger.kernel.org", "Subject": "[Intel-wired-lan] [next PATCH 3/4] igb: Add support for generic Tx\n\tchecksums", "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 adds support for generic Tx checksums to the igb driver. It\nturns out this is actually pretty easy after going over the datasheet as we\nwere doing a number of steps we didn't need to.\n\nIn order to perform a Tx checksum for an L4 header we need to fill in the\nfollowing fields in the Tx descriptor:\n MACLEN (maximum of 127), retrieved from:\n\t\tskb_network_offset()\n IPLEN (maximum of 511), retrieved from:\n\t\tskb_checksum_start_offset() - skb_network_offset()\n TUCMD.L4T indicates offset and if checksum or crc32c, based on:\n\t\tskb->csum_offset\n\nThe added advantage to doing this is that we can support inner checksum\noffloads for tunnels and MPLS while still being able to transparently insert\nVLAN tags.\n\nI also took the opportunity to clean-up many of the feature flag\nconfiguration bits to make them a bit more consistent between drivers.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/igb/igb_main.c | 114 ++++++++++++-----------------\n 1 file changed, 47 insertions(+), 67 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex ade8dee55fb8..8cd71cf39001 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -2437,37 +2437,35 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t * assignment.\n \t */\n \tnetdev->features |= NETIF_F_SG |\n-\t\t\t NETIF_F_IP_CSUM |\n-\t\t\t NETIF_F_IPV6_CSUM |\n \t\t\t NETIF_F_TSO |\n \t\t\t NETIF_F_TSO6 |\n \t\t\t NETIF_F_RXHASH |\n \t\t\t NETIF_F_RXCSUM |\n+\t\t\t NETIF_F_HW_CSUM |\n \t\t\t NETIF_F_HW_VLAN_CTAG_RX |\n \t\t\t NETIF_F_HW_VLAN_CTAG_TX;\n \n+\tif (hw->mac.type >= e1000_82576)\n+\t\tnetdev->features |= NETIF_F_SCTP_CRC;\n+\n \t/* copy netdev features into list of user selectable features */\n \tnetdev->hw_features |= netdev->features;\n \tnetdev->hw_features |= NETIF_F_RXALL;\n \n+\tif (hw->mac.type >= e1000_i350)\n+\t\tnetdev->hw_features |= NETIF_F_NTUPLE;\n+\n \t/* set this bit last since it cannot be part of hw_features */\n \tnetdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;\n \n-\tnetdev->vlan_features |= NETIF_F_TSO |\n+\tnetdev->vlan_features |= NETIF_F_SG |\n+\t\t\t\t NETIF_F_TSO |\n \t\t\t\t NETIF_F_TSO6 |\n-\t\t\t\t NETIF_F_IP_CSUM |\n-\t\t\t\t NETIF_F_IPV6_CSUM |\n-\t\t\t\t NETIF_F_SG;\n+\t\t\t\t NETIF_F_HW_CSUM |\n+\t\t\t\t NETIF_F_SCTP_CRC;\n \n-\tswitch (hw->mac.type) {\n-\tcase e1000_i210:\n-\tcase e1000_i211:\n-\tcase e1000_i350:\n-\t\tnetdev->hw_features |= NETIF_F_NTUPLE;\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n+\tnetdev->mpls_features |= NETIF_F_HW_CSUM;\n+\tnetdev->hw_enc_features |= NETIF_F_HW_CSUM;\n \n \tnetdev->priv_flags |= IFF_SUPP_NOFCS;\n \n@@ -2476,11 +2474,6 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t\tnetdev->vlan_features |= NETIF_F_HIGHDMA;\n \t}\n \n-\tif (hw->mac.type >= e1000_82576) {\n-\t\tnetdev->hw_features |= NETIF_F_SCTP_CRC;\n-\t\tnetdev->features |= NETIF_F_SCTP_CRC;\n-\t}\n-\n \tnetdev->priv_flags |= IFF_UNICAST_FLT;\n \n \tadapter->en_mng_pt = igb_enable_mng_pass_thru(hw);\n@@ -4967,70 +4960,57 @@ static int igb_tso(struct igb_ring *tx_ring,\n \treturn 1;\n }\n \n+static inline bool igb_ipv6_csum_is_sctp(struct sk_buff *skb)\n+{\n+\tunsigned int offset = 0;\n+\n+\tipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL);\n+\n+\treturn offset == skb_checksum_start_offset(skb);\n+}\n+\n static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first)\n {\n \tstruct sk_buff *skb = first->skb;\n \tu32 vlan_macip_lens = 0;\n-\tu32 mss_l4len_idx = 0;\n \tu32 type_tucmd = 0;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL) {\n+csum_failed:\n \t\tif (!(first->tx_flags & IGB_TX_FLAGS_VLAN))\n \t\t\treturn;\n-\t} else {\n-\t\tu8 l4_hdr = 0;\n-\n-\t\tswitch (first->protocol) {\n-\t\tcase htons(ETH_P_IP):\n-\t\t\tvlan_macip_lens |= skb_network_header_len(skb);\n-\t\t\ttype_tucmd |= E1000_ADVTXD_TUCMD_IPV4;\n-\t\t\tl4_hdr = ip_hdr(skb)->protocol;\n-\t\t\tbreak;\n-\t\tcase htons(ETH_P_IPV6):\n-\t\t\tvlan_macip_lens |= skb_network_header_len(skb);\n-\t\t\tl4_hdr = ipv6_hdr(skb)->nexthdr;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tif (unlikely(net_ratelimit())) {\n-\t\t\t\tdev_warn(tx_ring->dev,\n-\t\t\t\t\t \"partial checksum but proto=%x!\\n\",\n-\t\t\t\t\t first->protocol);\n-\t\t\t}\n-\t\t\tbreak;\n-\t\t}\n+\t\tgoto no_csum;\n+\t}\n \n-\t\tswitch (l4_hdr) {\n-\t\tcase IPPROTO_TCP:\n-\t\t\ttype_tucmd |= E1000_ADVTXD_TUCMD_L4T_TCP;\n-\t\t\tmss_l4len_idx = tcp_hdrlen(skb) <<\n-\t\t\t\t\tE1000_ADVTXD_L4LEN_SHIFT;\n-\t\t\tbreak;\n-\t\tcase IPPROTO_SCTP:\n-\t\t\ttype_tucmd |= E1000_ADVTXD_TUCMD_L4T_SCTP;\n-\t\t\tmss_l4len_idx = sizeof(struct sctphdr) <<\n-\t\t\t\t\tE1000_ADVTXD_L4LEN_SHIFT;\n-\t\t\tbreak;\n-\t\tcase IPPROTO_UDP:\n-\t\t\tmss_l4len_idx = sizeof(struct udphdr) <<\n-\t\t\t\t\tE1000_ADVTXD_L4LEN_SHIFT;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tif (unlikely(net_ratelimit())) {\n-\t\t\t\tdev_warn(tx_ring->dev,\n-\t\t\t\t\t \"partial checksum but l4 proto=%x!\\n\",\n-\t\t\t\t\t l4_hdr);\n-\t\t\t}\n+\tswitch (skb->csum_offset) {\n+\tcase offsetof(struct tcphdr, check):\n+\t\ttype_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;\n+\t\t/* fall through */\n+\tcase offsetof(struct udphdr, check):\n+\t\tbreak;\n+\tcase offsetof(struct sctphdr, checksum):\n+\t\t/* validate that this is actually an SCTP request */\n+\t\tif (((first->protocol == htons(ETH_P_IP)) &&\n+\t\t (ip_hdr(skb)->protocol == IPPROTO_SCTP)) ||\n+\t\t ((first->protocol == htons(ETH_P_IPV6)) &&\n+\t\t igb_ipv6_csum_is_sctp(skb))) {\n+\t\t\ttype_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP;\n \t\t\tbreak;\n \t\t}\n-\n-\t\t/* update TX checksum flag */\n-\t\tfirst->tx_flags |= IGB_TX_FLAGS_CSUM;\n+\tdefault:\n+\t\tskb_checksum_help(skb);\n+\t\tgoto csum_failed;\n \t}\n \n+\t/* update TX checksum flag */\n+\tfirst->tx_flags |= IGB_TX_FLAGS_CSUM;\n+\tvlan_macip_lens = skb_checksum_start_offset(skb) -\n+\t\t\t skb_network_offset(skb);\n+no_csum:\n \tvlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT;\n \tvlan_macip_lens |= first->tx_flags & IGB_TX_FLAGS_VLAN_MASK;\n \n-\tigb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx);\n+\tigb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0);\n }\n \n #define IGB_SET_FLAG(_input, _flag, _result) \\\n", "prefixes": [ "next", "3/4" ] }