get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 635635,
    "url": "http://patchwork.ozlabs.org/api/patches/635635/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160614224542.9471.71002.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": "<20160614224542.9471.71002.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-06-14T22:45:42",
    "name": "[net] i40e/i40evf: Fix i40e_rx_checksum",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3ad5a6356923e19b92d537d419d8916e2d39059c",
    "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/20160614224542.9471.71002.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/635635/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/635635/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\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rTl9V6ZYtz9t0G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 15 Jun 2016 08:45:49 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AB3D98B3B3;\n\tTue, 14 Jun 2016 22:45:47 +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 LwvdMzHbvy4b; Tue, 14 Jun 2016 22:45:46 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 60FB68B382;\n\tTue, 14 Jun 2016 22:45:46 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id D924F1C1EE6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Jun 2016 22:45:45 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D215988B50\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Jun 2016 22:45:45 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id jxXff8yj96kx for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Jun 2016 22:45:45 +0000 (UTC)",
            "from mail-pf0-f176.google.com (mail-pf0-f176.google.com\n\t[209.85.192.176])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id E8CA287FFC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Jun 2016 22:45:44 +0000 (UTC)",
            "by mail-pf0-f176.google.com with SMTP id t190so1793290pfb.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Jun 2016 15:45:44 -0700 (PDT)",
            "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\tr64sm47759253pfi.54.2016.06.14.15.45.43\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 14 Jun 2016 15:45:43 -0700 (PDT)"
        ],
        "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=Xx+IK20q; 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:user-agent:mime-version\n\t:content-transfer-encoding;\n\tbh=DNXmCldB6mTn8whz5LWGRjXAzIvgtLkMRyorwDh7H+c=;\n\tb=Xx+IK20q2LGDyAZCTAXiteTLEH6iQ2o9J4pD6cIicFMEsNuGIEWeA50+vQ3CIN19zd\n\tTae54CDnkJUIt4Y+02kG+DKTMh7Z7xOvzNIxOu+yjPOQ1tB4FQP9obZ4+SRJ5imHN8h4\n\ty1puztyRPAy7fMWFBFpFxGcHYwM74AT2M1mW8=",
        "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:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=DNXmCldB6mTn8whz5LWGRjXAzIvgtLkMRyorwDh7H+c=;\n\tb=XmC4LlcFtysrd7jJ/vjJzM3ejeaqHIJJe5Vdd5ekikemA+LLJC5bEfof/BLRs7WmJZ\n\tym7r8mpCsvd+MpLfqZkG5xqmxZzOrbMqAgX2WFIlymDBDOXniv81/L8zMY7d8pBHkGQP\n\trgcX9DW3jQQODsNkajc7vLUjEkqi8Zyl8zTlAqvkkrDdamsUB7clQf0qvj6l/gf6EMx4\n\tKTiPkML5eGeYBwYEBfQ6L/xB8flcTzskE9zJYof8QWfkiHWCd7oxCnWswPSh3CI1GZCE\n\tBQdhp484SnIuy51iSqcq6ZWWzeuuXcaYtk4GmqfRe3OWv1GHkyLf3WbOlnVsYFhST2jL\n\tF4oQ==",
        "X-Gm-Message-State": "ALyK8tL8tjVbEX9eBBhkWTeT9+bfqcLTRlQBquEqHjN4aMWNY0OOwbjaQ72JeTJ3cePy2ho5",
        "X-Received": "by 10.66.255.102 with SMTP id ap6mr74589pad.2.1465944344421;\n\tTue, 14 Jun 2016 15:45:44 -0700 (PDT)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 14 Jun 2016 15:45:42 -0700",
        "Message-ID": "<20160614224542.9471.71002.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [net PATCH] i40e/i40evf: Fix i40e_rx_checksum",
        "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": "There are a couple of issues I found in i40e_rx_checksum while doing some\nrecent testing.  As a result I have found the Rx checksum logic is pretty\nmuch broken and returning that the checksum is valid for tunnels in cases\nwhere it is not.\n\nFirst the inner types are not the correct values to use to test for if a\ntunnel is present or not.  In addition the inner protocol types are not a\nbitmask as such performing an OR of the values doesn't make sense.  I have\ninstead changed the code so that the inner protocol types are used to\ndetermine if we report CHECKSUM_UNNECESSARY or not.  For anything that does\nnot end in UDP, TCP, or SCTP it doesn't make much sense to report a\nchecksum offload since it won't contain a checksum anyway.\n\nThis leaves us with the need to set the csum_level based on some value.\nFor that purpose I am using the tunnel_type field.  If the tunnel type is\nGRENAT or greater then this means we have a GRE or UDP tunnel with an inner\nheader.  In the case of GRE or UDP we will have a possible checksum present\nso for this reason it should be safe to set the csum_level to 1 to indicate\nthat we are reporting the state of the inner header.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   30 ++++++++++++++-----------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c |   30 ++++++++++++++-----------\n 2 files changed, 34 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 55f151fca1dc..a8868e1bf832 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1280,8 +1280,8 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \t\t\t\t    union i40e_rx_desc *rx_desc)\n {\n \tstruct i40e_rx_ptype_decoded decoded;\n-\tbool ipv4, ipv6, tunnel = false;\n \tu32 rx_error, rx_status;\n+\tbool ipv4, ipv6;\n \tu8 ptype;\n \tu64 qword;\n \n@@ -1336,19 +1336,23 @@ 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/* 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/* If there is an outer header present that might contain a checksum\n+\t * we need to bump the checksum level by 1 to reflect the fact that\n+\t * we are indicating we validated the inner checksum.\n \t */\n-\tif (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP |\n-\t\t\t\t  I40E_RX_PTYPE_INNER_PROT_UDP |\n-\t\t\t\t  I40E_RX_PTYPE_INNER_PROT_SCTP))\n-\t\ttunnel = true;\n-\n-\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n-\tskb->csum_level = tunnel ? 1 : 0;\n+\tif (decoded.tunnel_type >= I40E_RX_PTYPE_TUNNEL_IP_GRENAT)\n+\t\tskb->csum_level = 1;\n+\n+\t/* Only report checksum unnecessary for TCP, UDP, or SCTP */\n+\tswitch (decoded.inner_prot) {\n+\tcase I40E_RX_PTYPE_INNER_PROT_TCP:\n+\tcase I40E_RX_PTYPE_INNER_PROT_UDP:\n+\tcase I40E_RX_PTYPE_INNER_PROT_SCTP:\n+\t\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n+\t\t/* fall though */\n+\tdefault:\n+\t\tbreak;\n+\t}\n \n \treturn;\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex be99189da925..79d99cd91b24 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -752,8 +752,8 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \t\t\t\t    union i40e_rx_desc *rx_desc)\n {\n \tstruct i40e_rx_ptype_decoded decoded;\n-\tbool ipv4, ipv6, tunnel = false;\n \tu32 rx_error, rx_status;\n+\tbool ipv4, ipv6;\n \tu8 ptype;\n \tu64 qword;\n \n@@ -808,19 +808,23 @@ 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/* 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/* If there is an outer header present that might contain a checksum\n+\t * we need to bump the checksum level by 1 to reflect the fact that\n+\t * we are indicating we validated the inner checksum.\n \t */\n-\tif (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP |\n-\t\t\t\t  I40E_RX_PTYPE_INNER_PROT_UDP |\n-\t\t\t\t  I40E_RX_PTYPE_INNER_PROT_SCTP))\n-\t\ttunnel = true;\n-\n-\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n-\tskb->csum_level = tunnel ? 1 : 0;\n+\tif (decoded.tunnel_type >= I40E_RX_PTYPE_TUNNEL_IP_GRENAT)\n+\t\tskb->csum_level = 1;\n+\n+\t/* Only report checksum unnecessary for TCP, UDP, or SCTP */\n+\tswitch (decoded.inner_prot) {\n+\tcase I40E_RX_PTYPE_INNER_PROT_TCP:\n+\tcase I40E_RX_PTYPE_INNER_PROT_UDP:\n+\tcase I40E_RX_PTYPE_INNER_PROT_SCTP:\n+\t\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n+\t\t/* fall though */\n+\tdefault:\n+\t\tbreak;\n+\t}\n \n \treturn;\n \n",
    "prefixes": [
        "net"
    ]
}