Show a patch.

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

{
    "id": 73456,
    "url": "https://patches.dpdk.org/api/patches/73456/",
    "web_url": "https://patches.dpdk.org/patch/73456/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1594136219-133336-3-git-send-email-bingz@mellanox.com>",
    "date": "2020-07-07T15:36:59",
    "name": "[v4,2/2] app/testpmd: add eCPRI in flow creation patterns",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0cc03889b14438d266d75cffe9a57e9b1a0053a3",
    "submitter": {
        "id": 1357,
        "url": "https://patches.dpdk.org/api/people/1357/",
        "name": "Bing Zhao",
        "email": "bingz@mellanox.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73456/mbox/",
    "series": [
        {
            "id": 10860,
            "url": "https://patches.dpdk.org/api/series/10860/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10860",
            "date": "2020-07-07T15:36:57",
            "name": "rte_flow: introduce eCPRI item for rte_flow",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/10860/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73456/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73456/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<1594136219-133336-1-git-send-email-bingz@mellanox.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.5.5",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id ADEE8A00BE;\n\tTue,  7 Jul 2020 17:37:27 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 73F2F1DEBC;\n\tTue,  7 Jul 2020 17:37:20 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 7727D1DEA0\n for <dev@dpdk.org>; Tue,  7 Jul 2020 17:37:18 +0200 (CEST)"
        ],
        "References": "<1593694422-299952-1-git-send-email-bingz@mellanox.com>\n <1594136219-133336-1-git-send-email-bingz@mellanox.com>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1594136219-133336-3-git-send-email-bingz@mellanox.com>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Precedence": "list",
        "From": "Bing Zhao <bingz@mellanox.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "orika@mellanox.com, john.mcnamara@intel.com, marko.kovacevic@intel.com,\n thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com,\n olivier.matz@6wind.com",
        "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>",
        "Date": "Tue,  7 Jul 2020 23:36:59 +0800",
        "Cc": "dev@dpdk.org, wenzhuo.lu@intel.com, beilei.xing@intel.com,\n bernard.iremonger@intel.com",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v4 2/2] app/testpmd: add eCPRI in flow creation\n\tpatterns"
    },
    "content": "In order to verify offloading of eCPRI protocol via flow rules, the\ncommand line of flow creation should support the parsing of the eCPRI\npattern.\n\nBased on the specification, one eCPRI message will have the common\nheader and payload. Payload format is various based on the type field\nof the common header. Fixed strings will be used instead of integer\nto make the CLI easy for auto-completion.\n\nThe testpmd command line examples of flow to match eCPRI item are\nlisted below:\n  1. flow create 0 ... pattern eth / ecpri / end actions ...\n    This is to match all eCPRI messages.\n  2. flow create 0 ... pattern eth / ecpri common type rtc_ctrl / end actions ...\n    This is to match all eCPRI messages with the type #2 - \"Real-Time\n    Control Data\".\n  3. flow create 0 ... pattern eth / ecpri common type iq_data pc_id is [U16Int] / end actions ...\n    This is to match eCPRI messages with the type #0 - \"IQ Data\", and\n    the physical channel ID 'pc_id' of the messages is a specific\n    value. Since the sequence ID is changeable, there is no need to\n    match that field in the flow.\nCurrently, only type #0, #2 and #5 will be supported.\n\nSince eCPRI could be over Ethernet layer (or after .1Q) and UDP\nlayer, it is the PMD driver's responsibility to check whether eCPRI\nis supported and which protocol stack is supported. Network byte\norder should be used for eCPRI header, the same as other headers.\n\nSigned-off-by: Bing Zhao <bingz@mellanox.com>\nAcked-by: Ori Kam <orika@mellanox.com>\n---\n app/test-pmd/cmdline_flow.c | 143 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 143 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 4e2006c..801581e 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -230,6 +230,15 @@ enum index {\n \tITEM_PFCP,\n \tITEM_PFCP_S_FIELD,\n \tITEM_PFCP_SEID,\n+\tITEM_ECPRI,\n+\tITEM_ECPRI_COMMON,\n+\tITEM_ECPRI_COMMON_TYPE,\n+\tITEM_ECPRI_COMMON_TYPE_IQ_DATA,\n+\tITEM_ECPRI_COMMON_TYPE_RTC_CTRL,\n+\tITEM_ECPRI_COMMON_TYPE_DLY_MSR,\n+\tITEM_ECPRI_MSG_IQ_DATA_PCID,\n+\tITEM_ECPRI_MSG_RTC_CTRL_RTCID,\n+\tITEM_ECPRI_MSG_DLY_MSR_MSRID,\n \n \t/* Validate/create actions. */\n \tACTIONS,\n@@ -791,6 +800,7 @@ struct parse_action_priv {\n \tITEM_ESP,\n \tITEM_AH,\n \tITEM_PFCP,\n+\tITEM_ECPRI,\n \tEND_SET,\n \tZERO,\n };\n@@ -1101,6 +1111,24 @@ struct parse_action_priv {\n \tZERO,\n };\n \n+static const enum index item_ecpri[] = {\n+\tITEM_ECPRI_COMMON,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index item_ecpri_common[] = {\n+\tITEM_ECPRI_COMMON_TYPE,\n+\tZERO,\n+};\n+\n+static const enum index item_ecpri_common_type[] = {\n+\tITEM_ECPRI_COMMON_TYPE_IQ_DATA,\n+\tITEM_ECPRI_COMMON_TYPE_RTC_CTRL,\n+\tITEM_ECPRI_COMMON_TYPE_DLY_MSR,\n+\tZERO,\n+};\n+\n static const enum index next_action[] = {\n \tACTION_END,\n \tACTION_VOID,\n@@ -1409,6 +1437,9 @@ static int parse_vc_spec(struct context *, const struct token *,\n \t\t\t const char *, unsigned int, void *, unsigned int);\n static int parse_vc_conf(struct context *, const struct token *,\n \t\t\t const char *, unsigned int, void *, unsigned int);\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_action_rss(struct context *, const struct token *,\n \t\t\t       const char *, unsigned int, void *,\n \t\t\t       unsigned int);\n@@ -2802,6 +2833,66 @@ static int comp_set_raw_index(struct context *, const struct token *,\n \t\t.next = NEXT(item_pfcp, NEXT_ENTRY(UNSIGNED), item_param),\n \t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_pfcp, seid)),\n \t},\n+\t[ITEM_ECPRI] = {\n+\t\t.name = \"ecpri\",\n+\t\t.help = \"match eCPRI header\",\n+\t\t.priv = PRIV_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)),\n+\t\t.next = NEXT(item_ecpri),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_ECPRI_COMMON] = {\n+\t\t.name = \"common\",\n+\t\t.help = \"eCPRI common header\",\n+\t\t.next = NEXT(item_ecpri_common),\n+\t},\n+\t[ITEM_ECPRI_COMMON_TYPE] = {\n+\t\t.name = \"type\",\n+\t\t.help = \"type of common header\",\n+\t\t.next = NEXT(item_ecpri_common_type),\n+\t\t.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_ecpri)),\n+\t},\n+\t[ITEM_ECPRI_COMMON_TYPE_IQ_DATA] = {\n+\t\t.name = \"iq_data\",\n+\t\t.help = \"Type #0: IQ Data\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_IQ_DATA_PCID,\n+\t\t\t\t\tITEM_NEXT)),\n+\t\t.call = parse_vc_item_ecpri_type,\n+\t},\n+\t[ITEM_ECPRI_MSG_IQ_DATA_PCID] = {\n+\t\t.name = \"pc_id\",\n+\t\t.help = \"Physical Channel ID\",\n+\t\t.next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri,\n+\t\t\t\thdr.type0.pc_id)),\n+\t},\n+\t[ITEM_ECPRI_COMMON_TYPE_RTC_CTRL] = {\n+\t\t.name = \"rtc_ctrl\",\n+\t\t.help = \"Type #2: Real-Time Control Data\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_RTC_CTRL_RTCID,\n+\t\t\t\t\tITEM_NEXT)),\n+\t\t.call = parse_vc_item_ecpri_type,\n+\t},\n+\t[ITEM_ECPRI_MSG_RTC_CTRL_RTCID] = {\n+\t\t.name = \"rtc_id\",\n+\t\t.help = \"Real-Time Control Data ID\",\n+\t\t.next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri,\n+\t\t\t\thdr.type2.rtc_id)),\n+\t},\n+\t[ITEM_ECPRI_COMMON_TYPE_DLY_MSR] = {\n+\t\t.name = \"delay_measure\",\n+\t\t.help = \"Type #5: One-Way Delay Measurement\",\n+\t\t.next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_DLY_MSR_MSRID,\n+\t\t\t\t\tITEM_NEXT)),\n+\t\t.call = parse_vc_item_ecpri_type,\n+\t},\n+\t[ITEM_ECPRI_MSG_DLY_MSR_MSRID] = {\n+\t\t.name = \"msr_id\",\n+\t\t.help = \"Measurement ID\",\n+\t\t.next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param),\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/* Validate/create actions. */\n \t[ACTIONS] = {\n \t\t.name = \"actions\",\n@@ -4124,6 +4215,58 @@ static int comp_set_raw_index(struct context *, const struct token *,\n \treturn len;\n }\n \n+/** Parse eCPRI common header type field. */\n+static int\n+parse_vc_item_ecpri_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_ecpri *ecpri;\n+\tstruct rte_flow_item_ecpri *ecpri_mask;\n+\tstruct rte_flow_item *item;\n+\tuint32_t data_size;\n+\tuint8_t msg_type;\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_ECPRI_COMMON_TYPE_IQ_DATA:\n+\t\tmsg_type = RTE_ECPRI_MSG_TYPE_IQ_DATA;\n+\t\tbreak;\n+\tcase ITEM_ECPRI_COMMON_TYPE_RTC_CTRL:\n+\t\tmsg_type = RTE_ECPRI_MSG_TYPE_RTC_CTRL;\n+\t\tbreak;\n+\tcase ITEM_ECPRI_COMMON_TYPE_DLY_MSR:\n+\t\tmsg_type = RTE_ECPRI_MSG_TYPE_DLY_MSR;\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+\tecpri = (struct rte_flow_item_ecpri *)out->args.vc.data;\n+\tecpri->hdr.common.type = msg_type;\n+\tdata_size = ctx->objdata / 3; /* spec, last, mask */\n+\tecpri_mask = (struct rte_flow_item_ecpri *)(out->args.vc.data +\n+\t\t\t\t\t\t    (data_size * 2));\n+\tecpri_mask->hdr.common.type = 0xFF;\n+\tif (arg->hton) {\n+\t\tecpri->hdr.dw0 = rte_cpu_to_be_32(ecpri->hdr.dw0);\n+\t\tecpri_mask->hdr.dw0 = rte_cpu_to_be_32(ecpri_mask->hdr.dw0);\n+\t}\n+\titem = &out->args.vc.pattern[out->args.vc.pattern_n - 1];\n+\titem->spec = ecpri;\n+\titem->mask = ecpri_mask;\n+\treturn len;\n+}\n+\n /** Parse RSS action. */\n static int\n parse_vc_action_rss(struct context *ctx, const struct token *token,\n",
    "prefixes": [
        "v4",
        "2/2"
    ]
}