get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102403,
    "url": "https://patches.dpdk.org/api/patches/102403/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211020093224.1410449-4-jie1x.wang@intel.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": "<20211020093224.1410449-4-jie1x.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211020093224.1410449-4-jie1x.wang@intel.com",
    "date": "2021-10-20T09:32:24",
    "name": "[v6,3/3] app/testpmd: support L2TPV2 and PPP protocol pattern",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4d396fa620c004d109f7c485258286aecfb4fe52",
    "submitter": {
        "id": 2201,
        "url": "https://patches.dpdk.org/api/people/2201/?format=api",
        "name": "Jie Wang",
        "email": "jie1x.wang@intel.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/20211020093224.1410449-4-jie1x.wang@intel.com/mbox/",
    "series": [
        {
            "id": 19831,
            "url": "https://patches.dpdk.org/api/series/19831/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19831",
            "date": "2021-10-20T09:32:21",
            "name": "support PPPoL2TPv2oUDP RSS Hash",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/19831/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/102403/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/102403/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 BA1CDA0C43;\n\tWed, 20 Oct 2021 11:37:33 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EA9CD411D8;\n\tWed, 20 Oct 2021 11:37:31 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id AA2E9411C4\n for <dev@dpdk.org>; Wed, 20 Oct 2021 11:37:30 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Oct 2021 02:37:30 -0700",
            "from dpdk.cd.intel.com ([10.240.178.133])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Oct 2021 02:37:26 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10142\"; a=\"229009974\"",
            "E=Sophos;i=\"5.87,166,1631602800\"; d=\"scan'208\";a=\"229009974\"",
            "E=Sophos;i=\"5.87,166,1631602800\"; d=\"scan'208\";a=\"494544891\""
        ],
        "From": "Jie Wang <jie1x.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "orika@nvidia.com, ferruh.yigit@intel.com, thomas@monjalon.net,\n andrew.rybchenko@oktetlabs.ru, xiaoyun.li@intel.com, stevex.yang@intel.com,\n jingjing.wu@intel.com, beilei.xing@intel.com, wenjun1.wu@intel.com,\n qi.z.zhang@intel.com, Jie Wang <jie1x.wang@intel.com>",
        "Date": "Wed, 20 Oct 2021 17:32:24 +0800",
        "Message-Id": "<20211020093224.1410449-4-jie1x.wang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211020093224.1410449-1-jie1x.wang@intel.com>",
        "References": "<20211019030824.932102-1-jie1x.wang@intel.com>\n <20211020093224.1410449-1-jie1x.wang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 3/3] app/testpmd: support L2TPV2 and PPP\n protocol pattern",
        "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": "Add support for test-pmd to parse protocol pattern L2TPv2 and PPP.\n\nSigned-off-by: Wenjun Wu <wenjun1.wu@intel.com>\nSigned-off-by: Jie Wang <jie1x.wang@intel.com>\n---\n app/test-pmd/cmdline_flow.c | 251 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 251 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex a90822b660..c1046e3e28 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -310,6 +310,23 @@ enum index {\n \tITEM_PORT_REPRESENTOR_PORT_ID,\n \tITEM_REPRESENTED_PORT,\n \tITEM_REPRESENTED_PORT_ETHDEV_PORT_ID,\n+\tITEM_L2TPV2,\n+\tITEM_L2TPV2_COMMON,\n+\tITEM_L2TPV2_COMMON_TYPE,\n+\tITEM_L2TPV2_COMMON_TYPE_DATA_L,\n+\tITEM_L2TPV2_COMMON_TYPE_CTRL,\n+\tITEM_L2TPV2_MSG_DATA_L_LENGTH,\n+\tITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,\n+\tITEM_L2TPV2_MSG_DATA_L_SESSION_ID,\n+\tITEM_L2TPV2_MSG_CTRL_LENGTH,\n+\tITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,\n+\tITEM_L2TPV2_MSG_CTRL_SESSION_ID,\n+\tITEM_L2TPV2_MSG_CTRL_NS,\n+\tITEM_L2TPV2_MSG_CTRL_NR,\n+\tITEM_PPP,\n+\tITEM_PPP_ADDR,\n+\tITEM_PPP_CTRL,\n+\tITEM_PPP_PROTO_ID,\n \n \t/* Validate/create actions. */\n \tACTIONS,\n@@ -1018,6 +1035,8 @@ static const enum index next_item[] = {\n \tITEM_CONNTRACK,\n \tITEM_PORT_REPRESENTOR,\n \tITEM_REPRESENTED_PORT,\n+\tITEM_L2TPV2,\n+\tITEM_PPP,\n \tEND_SET,\n \tZERO,\n };\n@@ -1398,6 +1417,31 @@ static const enum index item_represented_port[] = {\n \tZERO,\n };\n \n+static const enum index item_l2tpv2[] = {\n+\tITEM_L2TPV2_COMMON,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index item_l2tpv2_common[] = {\n+\tITEM_L2TPV2_COMMON_TYPE,\n+\tZERO,\n+};\n+\n+static const enum index item_l2tpv2_common_type[] = {\n+\tITEM_L2TPV2_COMMON_TYPE_DATA_L,\n+\tITEM_L2TPV2_COMMON_TYPE_CTRL,\n+\tZERO,\n+};\n+\n+static const enum index item_ppp[] = {\n+\tITEM_PPP_ADDR,\n+\tITEM_PPP_CTRL,\n+\tITEM_PPP_PROTO_ID,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n static const enum index next_action[] = {\n \tACTION_END,\n \tACTION_VOID,\n@@ -1781,6 +1825,9 @@ static int parse_vc_conf(struct context *, const struct token *,\n static int parse_vc_item_ecpri_type(struct context *, const struct token *,\n \t\t\t\t    const char *, unsigned int,\n \t\t\t\t    void *, unsigned int);\n+static int parse_vc_item_l2tpv2_type(struct context *, const struct token *,\n+\t\t\t\t    const char *, unsigned int,\n+\t\t\t\t    void *, unsigned int);\n static int parse_vc_action_meter_color_type(struct context *,\n \t\t\t\t\tconst struct token *,\n \t\t\t\t\tconst char *, unsigned int, void *,\n@@ -3682,6 +3729,153 @@ static const struct token token_list[] = {\n \t\t\t     item_param),\n \t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, port_id)),\n \t},\n+\t[ITEM_L2TPV2] = {\n+\t\t.name = \"l2tpv2\",\n+\t\t.help = \"match l2tpv2 header\",\n+\t\t.priv = PRIV_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)),\n+\t\t.next = NEXT(item_l2tpv2),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_L2TPV2_COMMON] = {\n+\t\t.name = \"common\",\n+\t\t.help = \"l2tpv2 common header\",\n+\t\t.next = NEXT(item_l2tpv2_common),\n+\t},\n+\t[ITEM_L2TPV2_COMMON_TYPE] = {\n+\t\t.name = \"type\",\n+\t\t.help = \"type of common header\",\n+\t\t.next = NEXT(item_l2tpv2_common_type),\n+\t\t.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),\n+\t},\n+\t[ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {\n+\t\t.name = \"data_l\",\n+\t\t.help = \"Type #6: data message with length option\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,\n+\t\t\t\t\tITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,\n+\t\t\t\t\tITEM_L2TPV2_MSG_DATA_L_SESSION_ID,\n+\t\t\t\t\tITEM_NEXT)),\n+\t\t.call = parse_vc_item_l2tpv2_type,\n+\t},\n+\t[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {\n+\t\t.name = \"length\",\n+\t\t.help = \"message length\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type6.length)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {\n+\t\t.name = \"tunnel_id\",\n+\t\t.help = \"tunnel identifier\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type6.tunnel_id)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {\n+\t\t.name = \"session_id\",\n+\t\t.help = \"session identifier\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type6.session_id)),\n+\t},\n+\t[ITEM_L2TPV2_COMMON_TYPE_CTRL] = {\n+\t\t.name = \"control\",\n+\t\t.help = \"Type #3: conrtol message contains length, ns, nr options\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,\n+\t\t\t\t\tITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,\n+\t\t\t\t\tITEM_L2TPV2_MSG_CTRL_SESSION_ID,\n+\t\t\t\t\tITEM_L2TPV2_MSG_CTRL_NS,\n+\t\t\t\t\tITEM_L2TPV2_MSG_CTRL_NR,\n+\t\t\t\t\tITEM_NEXT)),\n+\t\t.call = parse_vc_item_l2tpv2_type,\n+\t},\n+\t[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {\n+\t\t.name = \"length\",\n+\t\t.help = \"message length\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type3.length)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {\n+\t\t.name = \"tunnel_id\",\n+\t\t.help = \"tunnel identifier\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type3.tunnel_id)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {\n+\t\t.name = \"session_id\",\n+\t\t.help = \"session identifier\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type3.session_id)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_CTRL_NS] = {\n+\t\t.name = \"ns\",\n+\t\t.help = \"sequence number for message\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type3.ns)),\n+\t},\n+\t[ITEM_L2TPV2_MSG_CTRL_NR] = {\n+\t\t.name = \"nr\",\n+\t\t.help = \"sequence number for next receive message\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,\n+\t\t\t\t\tITEM_L2TPV2_COMMON, ITEM_NEXT),\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,\n+\t\t\t\t\t     hdr.type3.nr)),\n+\t},\n+\t[ITEM_PPP] = {\n+\t\t.name = \"ppp\",\n+\t\t.help = \"match ppp header\",\n+\t\t.priv = PRIV_ITEM(PPP, sizeof(struct rte_flow_item_ppp)),\n+\t\t.next = NEXT(item_ppp),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_PPP_ADDR] = {\n+\t\t.name = \"addr\",\n+\t\t.help = \"ppp address\",\n+\t\t.next = NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, hdr.addr)),\n+\t},\n+\t[ITEM_PPP_CTRL] = {\n+\t\t.name = \"ctrl\",\n+\t\t.help = \"ppp control\",\n+\t\t.next = NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, hdr.ctrl)),\n+\t},\n+\t[ITEM_PPP_PROTO_ID] = {\n+\t\t.name = \"proto_id\",\n+\t\t.help = \"ppp protocol id\",\n+\t\t.next = NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t     item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ppp,\n+\t\t\t\t\thdr.proto_id)),\n+\t},\n \t/* Validate/create actions. */\n \t[ACTIONS] = {\n \t\t.name = \"actions\",\n@@ -5569,6 +5763,57 @@ parse_vc_item_ecpri_type(struct context *ctx, const struct token *token,\n \treturn len;\n }\n \n+/** Parse L2TPV2 common header type field. */\n+static int\n+parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,\n+\t\t\t const char *str, unsigned int len,\n+\t\t\t void *buf, unsigned int size)\n+{\n+\tstruct rte_flow_item_l2tpv2 *l2tpv2;\n+\tstruct rte_flow_item_l2tpv2 *l2tpv2_mask;\n+\tstruct rte_flow_item *item;\n+\tuint32_t data_size;\n+\tuint8_t msg_type = 0;\n+\tstruct buffer *out = buf;\n+\tconst struct arg *arg;\n+\n+\t(void)size;\n+\t/* Token name must match. */\n+\tif (parse_default(ctx, token, str, len, NULL, 0) < 0)\n+\t\treturn -1;\n+\tswitch (ctx->curr) {\n+\tcase ITEM_L2TPV2_COMMON_TYPE_DATA_L:\n+\t\tmsg_type |= 0x4000;\n+\t\tbreak;\n+\tcase ITEM_L2TPV2_COMMON_TYPE_CTRL:\n+\t\tmsg_type |= 0xC800;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -1;\n+\t}\n+\tif (!ctx->object)\n+\t\treturn len;\n+\targ = pop_args(ctx);\n+\tif (!arg)\n+\t\treturn -1;\n+\tl2tpv2 = (struct rte_flow_item_l2tpv2 *)out->args.vc.data;\n+\tl2tpv2->hdr.common.flags_version |= msg_type;\n+\tdata_size = ctx->objdata / 3; /* spec, last, mask */\n+\tl2tpv2_mask = (struct rte_flow_item_l2tpv2 *)(out->args.vc.data +\n+\t\t\t\t\t\t    (data_size * 2));\n+\tl2tpv2_mask->hdr.common.flags_version = 0xFFFF;\n+\tif (arg->hton) {\n+\t\tl2tpv2->hdr.common.flags_version =\n+\t\t\trte_cpu_to_be_16(l2tpv2->hdr.common.flags_version);\n+\t\tl2tpv2_mask->hdr.common.flags_version =\n+\t\t    rte_cpu_to_be_16(l2tpv2_mask->hdr.common.flags_version);\n+\t}\n+\titem = &out->args.vc.pattern[out->args.vc.pattern_n - 1];\n+\titem->spec = l2tpv2;\n+\titem->mask = l2tpv2_mask;\n+\treturn len;\n+}\n+\n /** Parse meter color action type. */\n static int\n parse_vc_action_meter_color_type(struct context *ctx, const struct token *token,\n@@ -8461,6 +8706,12 @@ flow_item_default_mask(const struct rte_flow_item *item)\n \tcase RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT:\n \t\tmask = &rte_flow_item_ethdev_mask;\n \t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_L2TPV2:\n+\t\tmask = &rte_flow_item_l2tpv2_mask;\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_PPP:\n+\t\tmask = &rte_flow_item_ppp_mask;\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n",
    "prefixes": [
        "v6",
        "3/3"
    ]
}