Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/566993/?format=api
{ "id": 566993, "url": "http://patchwork.ozlabs.org/api/patches/566993/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160113153117.4527.6404.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": "<20160113153117.4527.6404.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2016-01-13T15:31:17", "name": "[next,v2,2/4] ixgbevf: Add support for generic Tx checksums", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c076b473b0cfb949e9facea32d183035849c462e", "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/20160113153117.4527.6404.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/566993/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/566993/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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id 188A8140307\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Jan 2016 02:31:24 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6BEE39434E;\n\tWed, 13 Jan 2016 15:31:23 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OR7FJLHX3qCB; Wed, 13 Jan 2016 15:31:22 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 40FCF9363A;\n\tWed, 13 Jan 2016 15:31:22 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id B39591C0F8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:20 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 992B9306C5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:20 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cQmtEdL-BrMR for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:19 +0000 (UTC)", "from mail-pa0-f49.google.com (mail-pa0-f49.google.com\n\t[209.85.220.49])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E01B625610\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:18 +0000 (UTC)", "by mail-pa0-f49.google.com with SMTP id uo6so344062650pac.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 07:31:18 -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\twa17sm3368912pac.38.2016.01.13.07.31.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Jan 2016 07:31:18 -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=JQWa3rn9; 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=sUCIE+gE0bJw621M9cxaBWFCUPU0//ConJ2jeGn6zyc=;\n\tb=JQWa3rn9ZW0pYsTMvVDKkqkBukAWfOmDcdtKA4PYyyAAcTFQ/x8RTStWSYz1PNh9+D\n\ttvuKK5V7bvXQhFz9CO/F8nTzVNKdxzAe+Pw+I3ERMgQL9pDEY8v97Ez1kHIA+IDp0I7l\n\t0IRLz6RwyBxj117SkdgqretdR8geQFPXTPWtE=", "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=sUCIE+gE0bJw621M9cxaBWFCUPU0//ConJ2jeGn6zyc=;\n\tb=XhVwis8bEPneCv2bnlxsCLKyhf2e3aYPcEFuTvMbhxY4Uzf5RLZNmYQ4232KUBL69l\n\txk8bkff/90DcmKX7U+QlU7QjggrqYASM6T10dqaRkAyYJZdU76bmsqanzmtX2hAmBcXK\n\t7pAi20ZbhvajSxPfr2A7sh1tOmWrKICfp1/Gje11WNWKJZRSXSIiZT/VBpr1v45Qffp+\n\tibVIESCE24sgj16JVtP4bDu00LzVG82qOtR9bWMddqjOTsndvFjnDeEt/2Pc3cohmNEm\n\t/zl+7NISxzcjvQC6S3td21+2l/VeqolGpMDblR2ipYR+fCVeO0cDcVrM0S0Jv02/2Qop\n\ttaag==", "X-Gm-Message-State": "ALoCoQl+lB51leABY4AFZN5LvM9eTE7t6y3xWXk0jTtMsce6rAefiQM8wXxAeyo+YRaclVhqyITmfgCuvji/+eeuvGRM2Dw24A==", "X-Received": "by 10.67.6.67 with SMTP id cs3mr21731958pad.143.1452699078513;\n\tWed, 13 Jan 2016 07:31:18 -0800 (PST)", "From": "Alexander Duyck <aduyck@mirantis.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 13 Jan 2016 07:31:17 -0800", "Message-ID": "<20160113153117.4527.6404.stgit@localhost.localdomain>", "In-Reply-To": "<20160113153001.4527.91152.stgit@localhost.localdomain>", "References": "<20160113153001.4527.91152.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next PATCH v2 2/4] ixgbevf: Add support for\n\tgeneric Tx checksums", "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 ixgbevf 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\ninsert VLAN 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. In\nthe case of the VF drivers this meant adding support for SCTP CRCs, and\ninner checksum offloads for MPLS and various tunnel types.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 104 +++++++++------------\n 1 file changed, 43 insertions(+), 61 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex 0b451d9eddb0..e58bebf6ea1d 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -3334,76 +3334,55 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \treturn 1;\n }\n \n+static inline bool ixgbevf_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 ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,\n \t\t\t struct ixgbevf_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-\t\tu8 l4_hdr = 0;\n-\t\t__be16 frag_off;\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 |= IXGBE_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\tif (likely(skb_network_header_len(skb) ==\n-\t\t\t\t sizeof(struct ipv6hdr)))\n-\t\t\t\tbreak;\n-\t\t\tipv6_skip_exthdr(skb, skb_network_offset(skb) +\n-\t\t\t\t\t sizeof(struct ipv6hdr),\n-\t\t\t\t\t &l4_hdr, &frag_off);\n-\t\t\tif (unlikely(frag_off))\n-\t\t\t\tl4_hdr = NEXTHDR_FRAGMENT;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tbreak;\n-\t\t}\n+\tif (skb->ip_summed != CHECKSUM_PARTIAL)\n+\t\tgoto no_csum;\n \n-\t\tswitch (l4_hdr) {\n-\t\tcase IPPROTO_TCP:\n-\t\t\ttype_tucmd |= IXGBE_ADVTXD_TUCMD_L4T_TCP;\n-\t\t\tmss_l4len_idx = tcp_hdrlen(skb) <<\n-\t\t\t\t\tIXGBE_ADVTXD_L4LEN_SHIFT;\n-\t\t\tbreak;\n-\t\tcase IPPROTO_SCTP:\n-\t\t\ttype_tucmd |= IXGBE_ADVTXD_TUCMD_L4T_SCTP;\n-\t\t\tmss_l4len_idx = sizeof(struct sctphdr) <<\n-\t\t\t\t\tIXGBE_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\tIXGBE_ADVTXD_L4LEN_SHIFT;\n+\tswitch (skb->csum_offset) {\n+\tcase offsetof(struct tcphdr, check):\n+\t\ttype_tucmd = IXGBE_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 ixgbevf_ipv6_csum_is_sctp(skb))) {\n+\t\t\ttype_tucmd = IXGBE_ADVTXD_TUCMD_L4T_SCTP;\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, l3 proto=%x, l4 proto=%x\\n\",\n-\t\t\t\t\t first->protocol, l4_hdr);\n-\t\t\t}\n-\t\t\tskb_checksum_help(skb);\n-\t\t\tgoto no_csum;\n \t\t}\n-\n-\t\t/* update TX checksum flag */\n-\t\tfirst->tx_flags |= IXGBE_TX_FLAGS_CSUM;\n+\t\t/* fall through */\n+\tdefault:\n+\t\tskb_checksum_help(skb);\n+\t\tgoto no_csum;\n \t}\n-\n+\t/* update TX checksum flag */\n+\tfirst->tx_flags |= IXGBE_TX_FLAGS_CSUM;\n+\tvlan_macip_lens = skb_checksum_start_offset(skb) -\n+\t\t\t skb_network_offset(skb);\n no_csum:\n \t/* vlan_macip_lens: MACLEN, VLAN tag */\n \tvlan_macip_lens |= skb_network_offset(skb) << IXGBE_ADVTXD_MACLEN_SHIFT;\n \tvlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;\n \n-\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens,\n-\t\t\t type_tucmd, mss_l4len_idx);\n+\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0);\n }\n \n static __le32 ixgbevf_tx_cmd_type(u32 tx_flags)\n@@ -4006,22 +3985,25 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t}\n \n \tnetdev->hw_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_RXCSUM;\n+\t\t\t NETIF_F_RXCSUM |\n+\t\t\t NETIF_F_HW_CSUM |\n+\t\t\t NETIF_F_SCTP_CRC;\n \n \tnetdev->features = netdev->hw_features |\n \t\t\t NETIF_F_HW_VLAN_CTAG_TX |\n \t\t\t NETIF_F_HW_VLAN_CTAG_RX |\n \t\t\t 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+\tnetdev->mpls_features |= NETIF_F_HW_CSUM;\n+\tnetdev->hw_enc_features |= NETIF_F_HW_CSUM;\n \n \tif (pci_using_dac)\n \t\tnetdev->features |= NETIF_F_HIGHDMA;\n", "prefixes": [ "next", "v2", "2/4" ] }