get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 566994,
    "url": "http://patchwork.ozlabs.org/api/patches/566994/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160113153123.4527.81111.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": "<20160113153123.4527.81111.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-13T15:31:23",
    "name": "[next,v2,3/4] igb: Add support for generic Tx checksums",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "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/20160113153123.4527.81111.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/566994/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/566994/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 C31A914076E\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Jan 2016 02:31:28 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 08F9D86B4C;\n\tWed, 13 Jan 2016 15:31:28 +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 b0SZtell-XK4; Wed, 13 Jan 2016 15:31:27 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 775F6815D9;\n\tWed, 13 Jan 2016 15:31:27 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 874421C0F8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:26 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8312E93FF2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:26 +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 bDiIIhPbobdo for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:25 +0000 (UTC)",
            "from mail-pf0-f180.google.com (mail-pf0-f180.google.com\n\t[209.85.192.180])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 45AF59363A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 15:31:25 +0000 (UTC)",
            "by mail-pf0-f180.google.com with SMTP id n128so82907439pfn.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Jan 2016 07:31:25 -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\tg10sm3420801pfd.49.2016.01.13.07.31.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Jan 2016 07:31:24 -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=iXLCYhD1; 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=+fd5F7nwxj7qCS4gZpi4osJAQMyc81dI4r9df5L6uIU=;\n\tb=iXLCYhD1jBHiaN7rJi5I/K9vJut0evGaZpRbbA0k+cIYp+1CJFkG+HAukRtGrPOY3k\n\tGGXkXbMk/fqrCRUgwcKB9gG86y7K8T1DKiFPO1gfdmI9Nu+LSsFTrFSM2k+AjdStjIjx\n\tYFY383SuP5S4qucFu5H3zbVS+LQUoV/l5MsAM=",
        "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=+fd5F7nwxj7qCS4gZpi4osJAQMyc81dI4r9df5L6uIU=;\n\tb=TZSznlgdWFDDCAvVbLkw3Dg+8Se6Tq6ELGCAXDPfwzrqrFKBjh9jp5Gok9G0UZg2hu\n\t+zU3rrGyhvhIiDS5TKUBLat1jP+rXb1zvFwlnU41K2G7P7ah2IVYB/dhxHUuux9yB+LL\n\ttPOl27Yt1hJf2PsZK7Py9m4JPZFtvM74Wm97n0/uh8UevysKs0UL2HFoo5AoM5eNdBnV\n\tlFMx3+Vww7lm3KIhdgKjNmvqajHOZAzRLhHYKvM1USFMco3eWfc9OIWVzc8YiISGu3XX\n\tmq5qKwSylKIAOmNYH8/QCnn6MZL+BAmHOUBkCKAtOh9RoAp9/FADxgF7GLvBvjumMOs/\n\tn0kA==",
        "X-Gm-Message-State": "ALoCoQmHgUXHhPpkRm/Pl62uFwvN2j3G7XcBLJE8WSU+lWrMp6X1r/ziJ6c2IMgvSnn0S7nJVrWcfQwPYYC7fH3i5iBPSo3DTA==",
        "X-Received": "by 10.98.14.29 with SMTP id w29mr42703972pfi.160.1452699085024; \n\tWed, 13 Jan 2016 07:31:25 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 13 Jan 2016 07:31:23 -0800",
        "Message-ID": "<20160113153123.4527.81111.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 3/4] igb: Add support for generic\n\tTx 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 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\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/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",
        "v2",
        "3/4"
    ]
}