get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 566992,
    "url": "http://patchwork.ozlabs.org/api/patches/566992/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160113153111.4527.72349.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": "<20160113153111.4527.72349.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-13T15:31:11",
    "name": "[next,v2,1/4] ixgbe: Add support for generic Tx checksums",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "683546a88a684634540071d85c810d4bd5fcc330",
    "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/20160113153111.4527.72349.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/566992/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/566992/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 3CC89140307\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Jan 2016 02:31:16 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8C67F942EF;\n\tWed, 13 Jan 2016 15:31:15 +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 C3W8yCGfAHrJ; Wed, 13 Jan 2016 15:31:15 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 0AC789363A;\n\tWed, 13 Jan 2016 15:31:15 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id DA7311C0F8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:13 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D4F0393FF2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:13 +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 yLX0Zw8LLe1h for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:12 +0000 (UTC)",
            "from mail-pf0-f179.google.com (mail-pf0-f179.google.com\n\t[209.85.192.179])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 9EC5A9363A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:12 +0000 (UTC)",
            "by mail-pf0-f179.google.com with SMTP id e65so83170701pfe.0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 07:31:12 -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\tud10sm3409057pab.27.2016.01.13.07.31.11\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Jan 2016 07:31:11 -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=IXocMvoH; 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=Mqcs1usLyUn0hPWSbAKhumCsFqjwmE9/mGLxbLLPkYk=;\n\tb=IXocMvoHIVkiJxVavBjKwUhwdS7v7PW6sCqq29FvEpBPFR2RBidLosv6cQUA17WBiH\n\tTkob1dYhbrnpPNyNSo45BWz21TfrDES7qmr7rKpNJu5T41WxzDbevbTRHFhOJ96QdzHu\n\tJpwFH3KdbjI05+zlNKtUqfEoqeHEft5+xOgaM=",
        "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=Mqcs1usLyUn0hPWSbAKhumCsFqjwmE9/mGLxbLLPkYk=;\n\tb=N0KmJbOLC4sKnJK0VIzOxyWivYyRZ9+eI8d1B6dmdlNScQpIdWZLBtxp6OBFykFP3b\n\tSbqiQ72c5omizmzyQQ+hqycTBWGSK/9eI/3qyakh3S30iR3LpaXYdu0GffNSZjwdaWp8\n\tjDvzL3XblwLyOn/TfUm/om1WhsUsNkEGhXYFbBhco37gsjg9kVbwTAnm+bZOMMFcU3sS\n\tpCuU++9dd9qMiqCzvIKB1jX2pfPg3crSy628d0fFkilTjNc8xytDqDVBcQr+OQJtofcN\n\tcF5yAyUJXK2YmvAm8RYkfMAoNOHsy4nAUAYOJqbpnSQjm2fntW7LuNqon2Z0IflFedHF\n\tLbPg==",
        "X-Gm-Message-State": "ALoCoQkgt+5kJfaUVbZTtLWMFbn68ETuj7UYyxjZkgfpPyUJ9ZClwWD4SAx9J+DEGV/sLpfFh47MJdSzZjAZn8kved4zyI50Mg==",
        "X-Received": "by 10.98.8.218 with SMTP id 87mr43800188pfi.39.1452699072404;\n\tWed, 13 Jan 2016 07:31:12 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 13 Jan 2016 07:31:11 -0800",
        "Message-ID": "<20160113153111.4527.72349.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 1/4] ixgbe: 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 ixgbe 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.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  163 +++++++++----------------\n 1 file changed, 59 insertions(+), 104 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 77cdaed6de90..1e3a548cc612 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -7207,103 +7207,61 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,\n \treturn 1;\n }\n \n+static inline bool ixgbe_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 ixgbe_tx_csum(struct ixgbe_ring *tx_ring,\n \t\t\t  struct ixgbe_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\tif (!(first->tx_flags & IXGBE_TX_FLAGS_HW_VLAN) &&\n-\t\t    !(first->tx_flags & IXGBE_TX_FLAGS_CC))\n+csum_failed:\n+\t\tif (!(first->tx_flags & (IXGBE_TX_FLAGS_HW_VLAN |\n+\t\t\t\t\t IXGBE_TX_FLAGS_CC)))\n \t\t\treturn;\n-\t\tvlan_macip_lens = skb_network_offset(skb) <<\n-\t\t\t\t  IXGBE_ADVTXD_MACLEN_SHIFT;\n-\t} else {\n-\t\tu8 l4_hdr = 0;\n-\t\tunion {\n-\t\t\tstruct iphdr *ipv4;\n-\t\t\tstruct ipv6hdr *ipv6;\n-\t\t\tu8 *raw;\n-\t\t} network_hdr;\n-\t\tunion {\n-\t\t\tstruct tcphdr *tcphdr;\n-\t\t\tu8 *raw;\n-\t\t} transport_hdr;\n-\t\t__be16 frag_off;\n-\n-\t\tif (skb->encapsulation) {\n-\t\t\tnetwork_hdr.raw = skb_inner_network_header(skb);\n-\t\t\ttransport_hdr.raw = skb_inner_transport_header(skb);\n-\t\t\tvlan_macip_lens = skb_inner_network_offset(skb) <<\n-\t\t\t\t\t  IXGBE_ADVTXD_MACLEN_SHIFT;\n-\t\t} else {\n-\t\t\tnetwork_hdr.raw = skb_network_header(skb);\n-\t\t\ttransport_hdr.raw = skb_transport_header(skb);\n-\t\t\tvlan_macip_lens = skb_network_offset(skb) <<\n-\t\t\t\t\t  IXGBE_ADVTXD_MACLEN_SHIFT;\n-\t\t}\n-\n-\t\t/* use first 4 bits to determine IP version */\n-\t\tswitch (network_hdr.ipv4->version) {\n-\t\tcase IPVERSION:\n-\t\t\tvlan_macip_lens |= transport_hdr.raw - network_hdr.raw;\n-\t\t\ttype_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;\n-\t\t\tl4_hdr = network_hdr.ipv4->protocol;\n-\t\t\tbreak;\n-\t\tcase 6:\n-\t\t\tvlan_macip_lens |= transport_hdr.raw - network_hdr.raw;\n-\t\t\tl4_hdr = network_hdr.ipv6->nexthdr;\n-\t\t\tif (likely((transport_hdr.raw - network_hdr.raw) ==\n-\t\t\t\t   sizeof(struct ipv6hdr)))\n-\t\t\t\tbreak;\n-\t\t\tipv6_skip_exthdr(skb, network_hdr.raw - skb->data +\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+\t\tgoto no_csum;\n+\t}\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 = (transport_hdr.tcphdr->doff * 4) <<\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     ixgbe_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, version=%d, l4 proto=%x\\n\",\n-\t\t\t\t\t network_hdr.ipv4->version, 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 csum_failed;\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-\tixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, 0,\n-\t\t\t  type_tucmd, mss_l4len_idx);\n+\tixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, 0, type_tucmd, 0);\n }\n \n #define IXGBE_SET_FLAG(_input, _flag, _result) \\\n@@ -9012,40 +8970,37 @@ skip_sriov:\n \n #endif\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_HW_VLAN_CTAG_TX |\n-\t\t\t   NETIF_F_HW_VLAN_CTAG_RX |\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-\n-\tnetdev->hw_features = netdev->features | NETIF_F_HW_L2FW_DOFFLOAD;\n+\t\t\t   NETIF_F_RXCSUM |\n+\t\t\t   NETIF_F_HW_CSUM |\n+\t\t\t   NETIF_F_SCTP_CRC |\n+\t\t\t   NETIF_F_HW_VLAN_CTAG_TX |\n+\t\t\t   NETIF_F_HW_VLAN_CTAG_RX;\n \n-\tswitch (adapter->hw.mac.type) {\n-\tcase ixgbe_mac_82599EB:\n-\tcase ixgbe_mac_X540:\n-\tcase ixgbe_mac_X550:\n-\tcase ixgbe_mac_X550EM_x:\n+\tif (hw->mac.type >= ixgbe_mac_82599EB)\n \t\tnetdev->features |= NETIF_F_SCTP_CRC;\n-\t\tnetdev->hw_features |= NETIF_F_SCTP_CRC |\n-\t\t\t\t       NETIF_F_NTUPLE;\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n \n-\tnetdev->hw_features |= NETIF_F_RXALL;\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+\t\t\t       NETIF_F_HW_L2FW_DOFFLOAD;\n+\n+\tif (hw->mac.type >= ixgbe_mac_82599EB)\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_TSO6;\n-\tnetdev->vlan_features |= NETIF_F_IP_CSUM;\n-\tnetdev->vlan_features |= NETIF_F_IPV6_CSUM;\n-\tnetdev->vlan_features |= NETIF_F_SG;\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_HW_CSUM |\n+\t\t\t\t NETIF_F_SCTP_CRC;\n \n-\tnetdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;\n+\tnetdev->mpls_features |= NETIF_F_HW_CSUM;\n+\tnetdev->hw_enc_features |= NETIF_F_HW_CSUM;\n \n \tnetdev->priv_flags |= IFF_UNICAST_FLT;\n \tnetdev->priv_flags |= IFF_SUPP_NOFCS;\n",
    "prefixes": [
        "next",
        "v2",
        "1/4"
    ]
}