get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105547,
    "url": "http://patchwork.dpdk.org/api/patches/105547/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220103025806.14568-1-hyonkim@cisco.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20220103025806.14568-1-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220103025806.14568-1-hyonkim@cisco.com",
    "date": "2022-01-03T02:58:06",
    "name": "net/enic: support GENEVE flow item",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c8ba4fd74a2d25bf65afee5f45ca563fcf1b608e",
    "submitter": {
        "id": 948,
        "url": "http://patchwork.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220103025806.14568-1-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 21046,
            "url": "http://patchwork.dpdk.org/api/series/21046/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=21046",
            "date": "2022-01-03T02:58:06",
            "name": "net/enic: support GENEVE flow item",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/21046/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105547/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/105547/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8E213A0350;\n\tMon,  3 Jan 2022 03:58:21 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 162A54069F;\n\tMon,  3 Jan 2022 03:58:21 +0100 (CET)",
            "from rcdn-iport-7.cisco.com (rcdn-iport-7.cisco.com [173.37.86.78])\n by mails.dpdk.org (Postfix) with ESMTP id E809340042\n for <dev@dpdk.org>; Mon,  3 Jan 2022 03:58:18 +0100 (CET)",
            "from rcdn-core-9.cisco.com ([173.37.93.145])\n by rcdn-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 03 Jan 2022 02:58:16 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n by rcdn-core-9.cisco.com (8.15.2/8.15.2) with ESMTP id 2032wGVS021359;\n Mon, 3 Jan 2022 02:58:17 GMT",
            "by cisco.com (Postfix, from userid 508933)\n id AEF9820F2003; Sun,  2 Jan 2022 18:58:16 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=8134; q=dns/txt; s=iport;\n t=1641178698; x=1642388298;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=HJ5+fxcAFZn95SMaypCsbiWDb9wTCVEJmJ3DO0SvZ8E=;\n b=E5ZnW+uh+e49TCfVM1cyeAjrfGS+4ubZ/xaYLMsCSX2WrRNahn19V4rj\n 6O+hXejn8E4hp9C7Tc7t/jQ1zhqRYBkcc51gPUhE+CPEbpSsHJ3DCWB/9\n qnXOfGnagbF9JsZqLiIZBZBd8gJHqttK1gYKa8wSFXHIb5KAfb+IkoZVI E=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.88,256,1635206400\"; d=\"scan'208\";a=\"964196092\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>,\n John Daley <johndale@cisco.com>",
        "Subject": "[PATCH] net/enic: support GENEVE flow item",
        "Date": "Sun,  2 Jan 2022 18:58:06 -0800",
        "Message-Id": "<20220103025806.14568-1-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.33.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "rcdn-core-9.cisco.com",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Recent VIC models can parse GENEVE, including options, and inner\npacket headers. Enable GENEVE header and option flow items. Currently,\nonly the first option that follows the GENEVE header can be matched,\nand the GENEVE header item must specify option length.\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n doc/guides/rel_notes/release_22_03.rst |   3 +\n drivers/net/enic/enic_fm_flow.c        | 153 ++++++++++++++++++++++++-\n 2 files changed, 154 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex 6d99d1eaa9..b38dc54e62 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -55,6 +55,9 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Updated Cisco enic driver.**\n+\n+  * Added rte_flow support for matching GENEVE packets.\n \n Removed Items\n -------------\ndiff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c\nindex ae43f36bc0..752ffeb5c5 100644\n--- a/drivers/net/enic/enic_fm_flow.c\n+++ b/drivers/net/enic/enic_fm_flow.c\n@@ -8,6 +8,7 @@\n #include <ethdev_driver.h>\n #include <rte_flow_driver.h>\n #include <rte_ether.h>\n+#include <rte_geneve.h>\n #include <rte_hash.h>\n #include <rte_jhash.h>\n #include <rte_ip.h>\n@@ -205,6 +206,7 @@ struct copy_item_args {\n \tconst struct rte_flow_item *item;\n \tstruct fm_tcam_match_entry *fm_tcam_entry;\n \tuint8_t header_level;\n+\tstruct rte_flow_error *error;\n };\n \n /* functions for copying items into flowman match */\n@@ -233,6 +235,8 @@ static enic_copy_item_fn enic_fm_copy_item_udp;\n static enic_copy_item_fn enic_fm_copy_item_vlan;\n static enic_copy_item_fn enic_fm_copy_item_vxlan;\n static enic_copy_item_fn enic_fm_copy_item_gtp;\n+static enic_copy_item_fn enic_fm_copy_item_geneve;\n+static enic_copy_item_fn enic_fm_copy_item_geneve_opt;\n \n /* Ingress actions */\n static const enum rte_flow_action_type enic_fm_supported_ig_actions[] = {\n@@ -368,6 +372,26 @@ static const struct enic_fm_items enic_fm_items[] = {\n \t\t\t       RTE_FLOW_ITEM_TYPE_END,\n \t\t},\n \t},\n+\t[RTE_FLOW_ITEM_TYPE_GENEVE] = {\n+\t\t.copy_item = enic_fm_copy_item_geneve,\n+\t\t.valid_start_item = 1,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t       RTE_FLOW_ITEM_TYPE_ETH,\n+\t\t\t       RTE_FLOW_ITEM_TYPE_IPV4,\n+\t\t\t       RTE_FLOW_ITEM_TYPE_IPV6,\n+\t\t\t       RTE_FLOW_ITEM_TYPE_UDP,\n+\t\t\t       RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_GENEVE_OPT] = {\n+\t\t.copy_item = enic_fm_copy_item_geneve_opt,\n+\t\t.valid_start_item = 1,\n+\t\t/* Can match at most 1 option */\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t       RTE_FLOW_ITEM_TYPE_GENEVE,\n+\t\t\t       RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n };\n \n static int\n@@ -744,6 +768,115 @@ enic_fm_copy_item_gtp(struct copy_item_args *arg)\n \treturn 0;\n }\n \n+static int\n+enic_fm_copy_item_geneve(struct copy_item_args *arg)\n+{\n+\tconst struct rte_flow_item *item = arg->item;\n+\tconst struct rte_flow_item_geneve *spec = item->spec;\n+\tconst struct rte_flow_item_geneve *mask = item->mask;\n+\tstruct fm_tcam_match_entry *entry = arg->fm_tcam_entry;\n+\tstruct fm_header_set *fm_data, *fm_mask;\n+\tint off;\n+\n+\tENICPMD_FUNC_TRACE();\n+\t/* Only 2 header levels (outer and inner) allowed */\n+\tif (arg->header_level > 0)\n+\t\treturn -EINVAL;\n+\n+\tfm_data = &entry->ftm_data.fk_hdrset[0];\n+\tfm_mask = &entry->ftm_mask.fk_hdrset[0];\n+\tfm_data->fk_metadata |= FKM_GENEVE;\n+\tfm_mask->fk_metadata |= FKM_GENEVE;\n+\t/* items from here on out are inner header items, except options */\n+\targ->header_level = 1;\n+\n+\t/* Match all if no spec */\n+\tif (!spec)\n+\t\treturn 0;\n+\tif (!mask)\n+\t\tmask = &rte_flow_item_geneve_mask;\n+\n+\t/*\n+\t * Use the raw L4 buffer to match geneve as fm_header_set does\n+\t * not have geneve header. A UDP item may precede the geneve\n+\t * item. Using the raw buffer does not affect such UDP item,\n+\t * since we skip UDP in the raw buffer.\n+\t */\n+\tfm_data->fk_header_select |= FKH_L4RAW;\n+\tfm_mask->fk_header_select |= FKH_L4RAW;\n+\toff = sizeof(fm_data->l4.udp);\n+\tmemcpy(&fm_data->l4.rawdata[off], spec, sizeof(struct rte_geneve_hdr));\n+\tmemcpy(&fm_mask->l4.rawdata[off], mask, sizeof(struct rte_geneve_hdr));\n+\treturn 0;\n+}\n+\n+static int\n+enic_fm_copy_item_geneve_opt(struct copy_item_args *arg)\n+{\n+\tconst struct rte_flow_item *item = arg->item;\n+\tconst struct rte_flow_item_geneve_opt *spec = item->spec;\n+\tconst struct rte_flow_item_geneve_opt *mask = item->mask;\n+\tstruct fm_tcam_match_entry *entry = arg->fm_tcam_entry;\n+\tstruct fm_header_set *fm_data, *fm_mask;\n+\tstruct rte_geneve_hdr *geneve;\n+\tint off, len;\n+\n+\tENICPMD_FUNC_TRACE();\n+\tfm_data = &entry->ftm_data.fk_hdrset[0];\n+\tfm_mask = &entry->ftm_mask.fk_hdrset[0];\n+\t/* Match all if no spec */\n+\tif (!spec)\n+\t\treturn 0;\n+\tif (!mask)\n+\t\tmask = &rte_flow_item_geneve_opt_mask;\n+\n+\tif (spec->option_len > 0 &&\n+\t    (spec->data == NULL || mask->data == NULL)) {\n+\t\treturn rte_flow_error_set(arg->error, EINVAL,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\tNULL, \"enic: geneve_opt unexpected null data\");\n+\t}\n+\t/*\n+\t * Geneve item must already be in the raw buffer. Append the\n+\t * option pattern to it. There are two limitations.\n+\t * (1) Can match only the 1st option, the first one following Geneve\n+\t * (2) Geneve header must specify option length, as HW does not\n+\t *     have \"has Geneve option\" flag.\n+\t */\n+\tRTE_ASSERT((fm_data->fk_header_select & FKH_L4RAW) != 0);\n+\tRTE_ASSERT((fm_mask->fk_header_select & FKH_L4RAW) != 0);\n+\toff = sizeof(fm_data->l4.udp);\n+\tgeneve = (struct rte_geneve_hdr *)&fm_data->l4.rawdata[off];\n+\tif (geneve->opt_len == 0) {\n+\t\treturn rte_flow_error_set(arg->error, EINVAL,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\tNULL, \"enic: geneve_opt requires non-zero geneve option length\");\n+\t}\n+\tgeneve = (struct rte_geneve_hdr *)&fm_mask->l4.rawdata[off];\n+\tif (geneve->opt_len == 0) {\n+\t\treturn rte_flow_error_set(arg->error, EINVAL,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\tNULL, \"enic: geneve_opt requires non-zero geneve option length mask\");\n+\t}\n+\toff = sizeof(fm_data->l4.udp) + sizeof(struct rte_geneve_hdr);\n+\tif (off + (spec->option_len + 1) * 4 > FM_LAYER_SIZE) {\n+\t\treturn rte_flow_error_set(arg->error, EINVAL,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\tNULL, \"enic: geneve_opt too large\");\n+\t}\n+\t/* Copy option header */\n+\tmemcpy(&fm_data->l4.rawdata[off], spec, 4);\n+\tmemcpy(&fm_mask->l4.rawdata[off], mask, 4);\n+\t/* Copy option data */\n+\tif (spec->option_len > 0) {\n+\t\toff += 4;\n+\t\tlen = spec->option_len * 4;\n+\t\tmemcpy(&fm_data->l4.rawdata[off], spec->data, len);\n+\t\tmemcpy(&fm_mask->l4.rawdata[off], mask->data, len);\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * Currently, raw pattern match is very limited. It is intended for matching\n  * UDP tunnel header (e.g. vxlan or geneve).\n@@ -984,16 +1117,32 @@ enic_fm_copy_entry(struct enic_flowman *fm,\n \t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n \t\t\t\tNULL, \"enic: unsupported item\");\n \t\t}\n-\n+\t\t/*\n+\t\t * Check vNIC feature dependencies. Geneve item needs\n+\t\t * Geneve offload feature\n+\t\t */\n+\t\tif (item->type == RTE_FLOW_ITEM_TYPE_GENEVE &&\n+\t\t    !fm->user_enic->geneve) {\n+\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\tNULL, \"enic: geneve not supported\");\n+\t\t}\n \t\t/* check to see if item stacking is valid */\n \t\tif (!fm_item_stacking_valid(prev_item, item_info,\n \t\t\t\t\t    is_first_item))\n \t\t\tgoto stacking_error;\n \n \t\targs.item = item;\n+\t\targs.error = error;\n+\t\tif (error)\n+\t\t\terror->type = RTE_FLOW_ERROR_TYPE_NONE;\n \t\tret = item_info->copy_item(&args);\n-\t\tif (ret)\n+\t\tif (ret) {\n+\t\t\t/* If copy_item set the error, return that */\n+\t\t\tif (error->type != RTE_FLOW_ERROR_TYPE_NONE)\n+\t\t\t\treturn ret;\n \t\t\tgoto item_not_supported;\n+\t\t}\n \t\t/* Going from outer to inner? Treat it as a new packet start */\n \t\tif (prev_header_level != args.header_level) {\n \t\t\tprev_item = RTE_FLOW_ITEM_TYPE_END;\n",
    "prefixes": []
}