get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86530,
    "url": "https://patches.dpdk.org/api/patches/86530/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210114070743.2377-3-shirik@nvidia.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210114070743.2377-3-shirik@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210114070743.2377-3-shirik@nvidia.com",
    "date": "2021-01-14T07:07:36",
    "name": "[v6,2/9] app/testpmd: add GENEVE option item support",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2e4cdbe126b8ce3529be2546095f33b0e94b517c",
    "submitter": {
        "id": 1894,
        "url": "https://patches.dpdk.org/api/people/1894/?format=api",
        "name": "Shiri Kuzin",
        "email": "shirik@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210114070743.2377-3-shirik@nvidia.com/mbox/",
    "series": [
        {
            "id": 14717,
            "url": "https://patches.dpdk.org/api/series/14717/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14717",
            "date": "2021-01-14T07:07:34",
            "name": "ethdev: introduce GENEVE header TLV option item",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/14717/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/86530/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/86530/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 29006A0A02;\n\tThu, 14 Jan 2021 08:08:36 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 146C0140EFF;\n\tThu, 14 Jan 2021 08:08:33 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 2BC12140EF5\n for <dev@dpdk.org>; Thu, 14 Jan 2021 08:08:32 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n shirik@nvidia.com) with SMTP; 14 Jan 2021 09:08:27 +0200",
            "from nvidia.com (c-141-140-1-007.mtl.labs.mlnx [10.141.140.7])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10E78GjF013095;\n Thu, 14 Jan 2021 09:08:27 +0200"
        ],
        "From": "Shiri Kuzin <shirik@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "viacheslavo@nvidia.com, adrien.mazarguil@6wind.com, orika@nvidia.com,\n ferruh.yigit@intel.com, thomas@monjalon.net, rasland@nvidia.com,\n andrew.rybchenko@oktetlabs.ru",
        "Date": "Thu, 14 Jan 2021 09:07:36 +0200",
        "Message-Id": "<20210114070743.2377-3-shirik@nvidia.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20210114070743.2377-1-shirik@nvidia.com>",
        "References": "<20210112140241.15914-1-shirik@nvidia.com>\n <20210114070743.2377-1-shirik@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 2/9] app/testpmd: add GENEVE option item\n support",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n\nThe patch adds the GENEVE option rte flow item support to\ncommand line interpreter. The flow command with GENEVE\noption items looks like:\n\n  flow create 0 ingress pattern eth / ipv4 / udp / geneve vni is 100 /\n       geneve-opt class is 99 length is 1 type is 0 data is 0x669988 /\n       end actions drop / end\n\nThe option length should be specified in 32-bit words, this\nvalue specifies the length of the data pattern/mask arrays (should be\nmultiplied by sizeof(uint32_t) to be expressed in bytes. If match\non the length itself is not needed the mask should be set to zero, in\nthis case length is used to specify the pattern/mask array lengths only.\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n app/test-pmd/cmdline_flow.c                 | 101 ++++++++++++++++++--\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |   8 ++\n 2 files changed, 103 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 585cab98b4..98afde82cc 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -283,6 +283,11 @@ enum index {\n \tITEM_ECPRI_MSG_IQ_DATA_PCID,\n \tITEM_ECPRI_MSG_RTC_CTRL_RTCID,\n \tITEM_ECPRI_MSG_DLY_MSR_MSRID,\n+\tITEM_GENEVE_OPT,\n+\tITEM_GENEVE_OPT_CLASS,\n+\tITEM_GENEVE_OPT_TYPE,\n+\tITEM_GENEVE_OPT_LENGTH,\n+\tITEM_GENEVE_OPT_DATA,\n \n \t/* Validate/create actions. */\n \tACTIONS,\n@@ -413,6 +418,9 @@ enum index {\n /** Maximum size for pattern in struct rte_flow_item_raw. */\n #define ITEM_RAW_PATTERN_SIZE 40\n \n+/** Maximum size for GENEVE option data pattern in bytes. */\n+#define ITEM_GENEVE_OPT_DATA_SIZE 124\n+\n /** Storage size for struct rte_flow_item_raw including pattern. */\n #define ITEM_RAW_SIZE \\\n \t(sizeof(struct rte_flow_item_raw) + ITEM_RAW_PATTERN_SIZE)\n@@ -428,7 +436,7 @@ struct action_rss_data {\n };\n \n /** Maximum data size in struct rte_flow_action_raw_encap. */\n-#define ACTION_RAW_ENCAP_MAX_DATA 128\n+#define ACTION_RAW_ENCAP_MAX_DATA 512\n #define RAW_ENCAP_CONFS_MAX_NUM 8\n \n /** Storage for struct rte_flow_action_raw_encap. */\n@@ -658,6 +666,16 @@ struct token {\n \t\t.mask = (const void *)&(const s){ .f = (1 << (b)) - 1 }, \\\n \t})\n \n+/** Static initializer for ARGS() to target a field with limits. */\n+#define ARGS_ENTRY_BOUNDED(s, f, i, a) \\\n+\t(&(const struct arg){ \\\n+\t\t.bounded = 1, \\\n+\t\t.min = (i), \\\n+\t\t.max = (a), \\\n+\t\t.offset = offsetof(s, f), \\\n+\t\t.size = sizeof(((s *)0)->f), \\\n+\t})\n+\n /** Static initializer for ARGS() to target an arbitrary bit-mask. */\n #define ARGS_ENTRY_MASK(s, f, m) \\\n \t(&(const struct arg){ \\\n@@ -903,6 +921,7 @@ static const enum index next_item[] = {\n \tITEM_AH,\n \tITEM_PFCP,\n \tITEM_ECPRI,\n+\tITEM_GENEVE_OPT,\n \tEND_SET,\n \tZERO,\n };\n@@ -1244,6 +1263,15 @@ static const enum index item_ecpri_common_type[] = {\n \tZERO,\n };\n \n+static const enum index item_geneve_opt[] = {\n+\tITEM_GENEVE_OPT_CLASS,\n+\tITEM_GENEVE_OPT_TYPE,\n+\tITEM_GENEVE_OPT_LENGTH,\n+\tITEM_GENEVE_OPT_DATA,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n static const enum index next_action[] = {\n \tACTION_END,\n \tACTION_VOID,\n@@ -3230,6 +3258,47 @@ static const struct token token_list[] = {\n \t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri,\n \t\t\t\thdr.type5.msr_id)),\n \t},\n+\t[ITEM_GENEVE_OPT] = {\n+\t\t.name = \"geneve-opt\",\n+\t\t.help = \"GENEVE header option\",\n+\t\t.priv = PRIV_ITEM(GENEVE_OPT,\n+\t\t\t\t  sizeof(struct rte_flow_item_geneve_opt) +\n+\t\t\t\t  ITEM_GENEVE_OPT_DATA_SIZE),\n+\t\t.next = NEXT(item_geneve_opt),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_GENEVE_OPT_CLASS]\t= {\n+\t\t.name = \"class\",\n+\t\t.help = \"GENEVE option class\",\n+\t\t.next = NEXT(item_geneve_opt, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve_opt,\n+\t\t\t\t\t     option_class)),\n+\t},\n+\t[ITEM_GENEVE_OPT_TYPE] = {\n+\t\t.name = \"type\",\n+\t\t.help = \"GENEVE option type\",\n+\t\t.next = NEXT(item_geneve_opt, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_geneve_opt,\n+\t\t\t\t\toption_type)),\n+\t},\n+\t[ITEM_GENEVE_OPT_LENGTH] = {\n+\t\t.name = \"length\",\n+\t\t.help = \"GENEVE option data length (in 32b words)\",\n+\t\t.next = NEXT(item_geneve_opt, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_BOUNDED(\n+\t\t\t\tstruct rte_flow_item_geneve_opt, option_len,\n+\t\t\t\t0, 31)),\n+\t},\n+\t[ITEM_GENEVE_OPT_DATA] = {\n+\t\t.name = \"data\",\n+\t\t.help = \"GENEVE option data pattern\",\n+\t\t.next = NEXT(item_geneve_opt, NEXT_ENTRY(HEX), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_geneve_opt, data),\n+\t\t\t     ARGS_ENTRY_ARB(0, 0),\n+\t\t\t     ARGS_ENTRY_ARB\n+\t\t\t\t(sizeof(struct rte_flow_item_geneve_opt),\n+\t\t\t\tITEM_GENEVE_OPT_DATA_SIZE)),\n+\t},\n \t/* Validate/create actions. */\n \t[ACTIONS] = {\n \t\t.name = \"actions\",\n@@ -6482,11 +6551,14 @@ parse_hex(struct context *ctx, const struct token *token,\n \tret = snprintf(tmp, sizeof(tmp), \"%u\", hexlen);\n \tif (ret < 0)\n \t\tgoto error;\n-\tpush_args(ctx, arg_len);\n-\tret = parse_int(ctx, token, tmp, ret, NULL, 0);\n-\tif (ret < 0) {\n-\t\tpop_args(ctx);\n-\t\tgoto error;\n+\t/* Save length if requested. */\n+\tif (arg_len->size) {\n+\t\tpush_args(ctx, arg_len);\n+\t\tret = parse_int(ctx, token, tmp, ret, NULL, 0);\n+\t\tif (ret < 0) {\n+\t\t\tpop_args(ctx);\n+\t\t\tgoto error;\n+\t\t}\n \t}\n \tbuf = (uint8_t *)ctx->object + arg_data->offset;\n \t/* Output buffer is not necessarily NUL-terminated. */\n@@ -7486,6 +7558,9 @@ flow_item_default_mask(const struct rte_flow_item *item)\n \tcase RTE_FLOW_ITEM_TYPE_GENEVE:\n \t\tmask = &rte_flow_item_geneve_mask;\n \t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_GENEVE_OPT:\n+\t\tmask = &rte_flow_item_geneve_opt_mask;\n+\t\tbreak;\n \tcase RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:\n \t\tmask = &rte_flow_item_pppoe_proto_id_mask;\n \t\tbreak;\n@@ -7598,6 +7673,8 @@ cmd_set_raw_parsed(const struct buffer *in)\n \t/* process hdr from upper layer to low layer (L3/L4 -> L2). */\n \tdata_tail = data + ACTION_RAW_ENCAP_MAX_DATA;\n \tfor (i = n - 1 ; i >= 0; --i) {\n+\t\tconst struct rte_flow_item_geneve_opt *opt;\n+\n \t\titem = in->args.vc.pattern + i;\n \t\tif (item->spec == NULL)\n \t\t\titem->spec = flow_item_default_mask(item);\n@@ -7650,6 +7727,18 @@ cmd_set_raw_parsed(const struct buffer *in)\n \t\tcase RTE_FLOW_ITEM_TYPE_GENEVE:\n \t\t\tsize = sizeof(struct rte_geneve_hdr);\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GENEVE_OPT:\n+\t\t\topt = (const struct rte_flow_item_geneve_opt *)\n+\t\t\t\t\t\t\t\titem->spec;\n+\t\t\tsize = offsetof(struct rte_flow_item_geneve_opt, data);\n+\t\t\tif (opt->option_len && opt->data) {\n+\t\t\t\t*total_size += opt->option_len *\n+\t\t\t\t\t       sizeof(uint32_t);\n+\t\t\t\trte_memcpy(data_tail - (*total_size),\n+\t\t\t\t\t   opt->data,\n+\t\t\t\t\t   opt->option_len * sizeof(uint32_t));\n+\t\t\t}\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_L2TPV3OIP:\n \t\t\tsize = sizeof(rte_be32_t);\n \t\t\tproto = 0x73;\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 9be450066e..37278d31d6 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3680,6 +3680,14 @@ This section lists supported pattern items and their attributes, if any.\n   - ``vni {unsigned}``: virtual network identifier.\n   - ``protocol {unsigned}``: protocol type.\n \n+- ``geneve-opt``: match GENEVE header option.\n+\n+  - ``class {unsigned}``: GENEVE option class.\n+  - ``type {unsigned}``: GENEVE option type.\n+  - ``length {unsigned}``: GENEVE option length in 32-bit words.\n+  - ``data {hex string}``: GENEVE option data, the legnt is defined by\n+    ``length`` field\n+\n - ``vxlan-gpe``: match VXLAN-GPE header.\n \n   - ``vni {unsigned}``: VXLAN-GPE identifier.\n",
    "prefixes": [
        "v6",
        "2/9"
    ]
}