get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50757,
    "url": "http://patches.dpdk.org/api/patches/50757/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-12-hyonkim@cisco.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190302104251.32565-12-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190302104251.32565-12-hyonkim@cisco.com",
    "date": "2019-03-02T10:42:49",
    "name": "[v2,11/13] net/enic: fix a couple issues with VXLAN match",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "68c3877a64eaccdef433afa477630a19d3256b96",
    "submitter": {
        "id": 948,
        "url": "http://patches.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-12-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 3613,
            "url": "http://patches.dpdk.org/api/series/3613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3613",
            "date": "2019-03-02T10:42:38",
            "name": "net/enic: 19.05 updates",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/3613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50757/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50757/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 034BF4C8F;\n\tSat,  2 Mar 2019 11:45:51 +0100 (CET)",
            "from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73])\n\tby dpdk.org (Postfix) with ESMTP id 29DC72B9E;\n\tSat,  2 Mar 2019 11:45:49 +0100 (CET)",
            "from alln-core-1.cisco.com ([173.36.13.131])\n\tby rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Mar 2019 10:45:48 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id x22AjmwV024496;\n\tSat, 2 Mar 2019 10:45:48 GMT",
            "by cisco.com (Postfix, from userid 508933)\n\tid 2EEBD20F2001; Sat,  2 Mar 2019 02:45:48 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=4058; q=dns/txt; s=iport;\n\tt=1551523549; x=1552733149;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=fari03nMWiH7RL1Syo4YrEl7wR62zhIXiwbUqVq61qE=;\n\tb=Wypp+cZLXWmTQEaJyRv+j29JE20UdfA0gtvAk/Ypzdc1rWhrpAhQM1c/\n\tPhONTuhUxToYoBvJr8soHDmE1uAoBWexaUxaCOAftyWIxZrbc9MpAtgNg\n\tVZEYYIepl8B7AU7QztvsZvgONv7Do0qIQ8fGnazWLr2WCQV1qPQCwC4yE 4=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,431,1544486400\"; d=\"scan'208\";a=\"530643476\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, John Daley <johndale@cisco.com>,\n\tHyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org",
        "Date": "Sat,  2 Mar 2019 02:42:49 -0800",
        "Message-Id": "<20190302104251.32565-12-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.16.2",
        "In-Reply-To": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "References": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-1.cisco.com",
        "Subject": "[dpdk-dev] [PATCH v2 11/13] net/enic: fix a couple issues with\n\tVXLAN match",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The filter API does not have flags for \"match VXLAN\". Explicitly set\nthe UDP destination port and mask in the L4 pattern. Otherwise, UDP\npackets with non-VXLAN ports may be falsely reported as VXLAN.\n\n1400 series VIC adapters have hardware VXLAN parsing. The L5 buffer on\nthe NIC starts with the inner Ethernet header, and the VXLAN header is\nnow in the L4 buffer following the UDP header. So the VXLAN spec/mask\nneeds to be in the L4 pattern, not L5. Older models still expect the\nVXLAN spec/mask in the L5 pattern. Fix up the L4/L5 patterns\naccordingly.\n\nFixes: 6ced137607d0 (\"net/enic: flow API for NICs with advanced filters enabled\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\n---\n drivers/net/enic/enic_flow.c | 46 +++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 45 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c\nindex ffc6ce1da..da43b31dc 100644\n--- a/drivers/net/enic/enic_flow.c\n+++ b/drivers/net/enic/enic_flow.c\n@@ -830,12 +830,23 @@ enic_copy_item_vxlan_v2(struct copy_item_args *arg)\n \tconst struct rte_flow_item_vxlan *spec = item->spec;\n \tconst struct rte_flow_item_vxlan *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n+\tstruct udp_hdr *udp;\n \n \tFLOW_TRACE();\n \n \tif (*inner_ofst)\n \t\treturn EINVAL;\n \n+\t/*\n+\t * The NIC filter API has no flags for \"match vxlan\". Set UDP port to\n+\t * avoid false positives.\n+\t */\n+\tgp->mask_flags |= FILTER_GENERIC_1_UDP;\n+\tgp->val_flags |= FILTER_GENERIC_1_UDP;\n+\tudp = (struct udp_hdr *)gp->layer[FILTER_GENERIC_1_L4].mask;\n+\tudp->dst_port = 0xffff;\n+\tudp = (struct udp_hdr *)gp->layer[FILTER_GENERIC_1_L4].val;\n+\tudp->dst_port = RTE_BE16(4789);\n \t/* Match all if no spec */\n \tif (!spec)\n \t\treturn 0;\n@@ -931,6 +942,36 @@ item_stacking_valid(enum rte_flow_item_type prev_item,\n \treturn 0;\n }\n \n+/*\n+ * Fix up the L5 layer.. HW vxlan parsing removes vxlan header from L5.\n+ * Instead it is in L4 following the UDP header. Append the vxlan\n+ * pattern to L4 (udp) and shift any inner packet pattern in L5.\n+ */\n+static void\n+fixup_l5_layer(struct enic *enic, struct filter_generic_1 *gp,\n+\t       uint8_t inner_ofst)\n+{\n+\tuint8_t layer[FILTER_GENERIC_1_KEY_LEN];\n+\tuint8_t inner;\n+\tuint8_t vxlan;\n+\n+\tif (!(inner_ofst > 0 && enic->vxlan))\n+\t\treturn;\n+\tFLOW_TRACE();\n+\tvxlan = sizeof(struct vxlan_hdr);\n+\tmemcpy(gp->layer[FILTER_GENERIC_1_L4].mask + sizeof(struct udp_hdr),\n+\t       gp->layer[FILTER_GENERIC_1_L5].mask, vxlan);\n+\tmemcpy(gp->layer[FILTER_GENERIC_1_L4].val + sizeof(struct udp_hdr),\n+\t       gp->layer[FILTER_GENERIC_1_L5].val, vxlan);\n+\tinner = inner_ofst - vxlan;\n+\tmemset(layer, 0, sizeof(layer));\n+\tmemcpy(layer, gp->layer[FILTER_GENERIC_1_L5].mask + vxlan, inner);\n+\tmemcpy(gp->layer[FILTER_GENERIC_1_L5].mask, layer, sizeof(layer));\n+\tmemset(layer, 0, sizeof(layer));\n+\tmemcpy(layer, gp->layer[FILTER_GENERIC_1_L5].val + vxlan, inner);\n+\tmemcpy(gp->layer[FILTER_GENERIC_1_L5].val, layer, sizeof(layer));\n+}\n+\n /**\n  * Build the intenal enic filter structure from the provided pattern. The\n  * pattern is validated as the items are copied.\n@@ -945,6 +986,7 @@ item_stacking_valid(enum rte_flow_item_type prev_item,\n static int\n enic_copy_filter(const struct rte_flow_item pattern[],\n \t\t const struct enic_filter_cap *cap,\n+\t\t struct enic *enic,\n \t\t struct filter_v2 *enic_filter,\n \t\t struct rte_flow_error *error)\n {\n@@ -989,6 +1031,8 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \t\tprev_item = item->type;\n \t\tis_first_item = 0;\n \t}\n+\tfixup_l5_layer(enic, &enic_filter->u.generic_1, inner_ofst);\n+\n \treturn 0;\n \n item_not_supported:\n@@ -1481,7 +1525,7 @@ enic_flow_parse(struct rte_eth_dev *dev,\n \t\treturn -rte_errno;\n \t}\n \tenic_filter->type = enic->flow_filter_mode;\n-\tret = enic_copy_filter(pattern, enic_filter_cap,\n+\tret = enic_copy_filter(pattern, enic_filter_cap, enic,\n \t\t\t\t       enic_filter, error);\n \treturn ret;\n }\n",
    "prefixes": [
        "v2",
        "11/13"
    ]
}