get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115755,
    "url": "http://patches.dpdk.org/api/patches/115755/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220901223611.515384-1-yuanx.wang@intel.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": "<20220901223611.515384-1-yuanx.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220901223611.515384-1-yuanx.wang@intel.com",
    "date": "2022-09-01T22:36:11",
    "name": "[v2,3/4] app/testpmd: add rxhdrs commands and parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d92f8caa1aff149453b171689567440a73f1c3b5",
    "submitter": {
        "id": 2087,
        "url": "http://patches.dpdk.org/api/people/2087/?format=api",
        "name": "Wang, YuanX",
        "email": "yuanx.wang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220901223611.515384-1-yuanx.wang@intel.com/mbox/",
    "series": [
        {
            "id": 24508,
            "url": "http://patches.dpdk.org/api/series/24508/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24508",
            "date": "2022-09-01T22:36:11",
            "name": null,
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/24508/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/115755/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/115755/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 EE788A0032;\n\tThu,  1 Sep 2022 16:48:46 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E002340C35;\n\tThu,  1 Sep 2022 16:48:46 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id DEAD140695\n for <dev@dpdk.org>; Thu,  1 Sep 2022 16:48:44 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2022 07:48:43 -0700",
            "from unknown (HELO localhost.localdomain) ([10.239.252.55])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2022 07:48:38 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1662043725; x=1693579725;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=dj/I1PCWRta4TzdpZd8pbvuQTyt0stePbeWkxKFwl7s=;\n b=H4MEfgkhtLRROTxMoRCyuemtsTeA5sSc07sbSe0fAIbNNsHVE8+Nfg7s\n z5N+fUIDkfEfzXFihD+kIDjT9JosNigVahlm16tPWaqw7XhycPQjGRFSG\n FE94hiTWdYEDJ41AGv5zv/0jVv1XZd2kTQ5WLTbmRdUXN0AVRVWhmKoJ/\n nhoQd2D/Clqo6/RL8QsMeByKhuDLxaskUuCgoAfjBJ2MRPrQNQ7ynyTcv\n FiiAzBpO1olRo9vG+0evbW34edR27BnM8IPRl6scbWEhLzp7heJXrROXs\n 8x0GQZ/PNd9i5HZ51rcqUeNfwSWoaMPyoOrRzgDx3H4wQjnQdpI0CzzCb A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10457\"; a=\"294473408\"",
            "E=Sophos;i=\"5.93,281,1654585200\"; d=\"scan'208\";a=\"294473408\"",
            "E=Sophos;i=\"5.93,281,1654585200\"; d=\"scan'208\";a=\"608574556\""
        ],
        "From": "Yuan Wang <yuanx.wang@intel.com>",
        "To": "aman.deep.singh@intel.com,\n\tyuying.zhang@intel.com",
        "Cc": "thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru,\n ferruh.yigit@xilinx.com, mdr@ashroe.eu, xiaoyun.li@intel.com,\n qi.z.zhang@intel.com, qiming.yang@intel.com, jerinjacobk@gmail.com,\n viacheslavo@nvidia.com, stephen@networkplumber.org, xuan.ding@intel.com,\n dev@dpdk.org, hpothula@marvell.com, yaqi.tang@intel.com,\n Yuan Wang <yuanx.wang@intel.com>, Wenxuan Wu <wenxuanx.wu@intel.com>",
        "Subject": "[PATCH v2 3/4] app/testpmd: add rxhdrs commands and parameters",
        "Date": "Fri,  2 Sep 2022 06:36:11 +0800",
        "Message-Id": "<20220901223611.515384-1-yuanx.wang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220812181552.2908067-1-yuanx.wang@intel.com>",
        "References": "<20220812181552.2908067-1-yuanx.wang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Add command line parameter:\n--rxhdrs=mac,[ipv4,udp]\n\nSet the protocol_hdr of segments to scatter packets on receiving if\nsplit feature is engaged. And the queues with BUFFER_SPLIT flag.\n\nAdd interactive mode command:\ntestpmd>set rxhdrs mac,ipv4,tcp,udp,sctp\n(protocol sequence should be valid)\n\nThe protocol split feature is off by default. To enable protocol split,\nyou need:\n1. Start testpmd with multiple mempools. E.g. --mbuf-size=2048,2048\n2. Configure Rx queue with rx_offload buffer split on.\n3. Set the protocol type of buffer split. E.g. set rxhdrs mac,ipv4\n        (default protocols of testpmd : mac|icmp|ipv4|ipv6|tcp|udp|\n                              sctp|inner_mac|inner_ipv4|inner_ipv6|\n                              inner_tcp|inner_udp|inner_sctp)\nAbove protocols can be configured in testpmd. But the configuration can\nonly be applied when it is supported by specific pmd.\n\nSigned-off-by: Yuan Wang <yuanx.wang@intel.com>\nSigned-off-by: Xuan Ding <xuan.ding@intel.com>\nSigned-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>\n---\n app/test-pmd/cmdline.c    | 123 +++++++++++++++++++++++++++++++++++++-\n app/test-pmd/config.c     |  70 ++++++++++++++++++++++\n app/test-pmd/parameters.c |  16 ++++-\n app/test-pmd/testpmd.c    |   2 +\n app/test-pmd/testpmd.h    |   6 ++\n 5 files changed, 213 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex b4fe9dfb17..f00b7bc6a4 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -183,7 +183,7 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"show (rxq|txq) info (port_id) (queue_id)\\n\"\n \t\t\t\"    Display information for configured RX/TX queue.\\n\\n\"\n \n-\t\t\t\"show config (rxtx|cores|fwd|rxoffs|rxpkts|txpkts)\\n\"\n+\t\t\t\"show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts)\\n\"\n \t\t\t\"    Display the given configuration.\\n\\n\"\n \n \t\t\t\"read rxd (port_id) (queue_id) (rxd_id)\\n\"\n@@ -307,6 +307,14 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" Affects only the queues configured with split\"\n \t\t\t\" offloads.\\n\\n\"\n \n+\t\t\t\"set rxhdrs (mac[,ipv4])*\\n\"\n+\t\t\t\"\tSet the protocol hdr of each segment to scatter\"\n+\t\t\t\" packets on receiving if split feature is engaged.\"\n+\t\t\t\" Affects only the queues configured with split\"\n+\t\t\t\" offloads.\\n\\n\"\n+\t\t\t\"\tSupported proto header: mac|ipv4|ipv6|tcp|udp|sctp|\"\n+\t\t\t\"inner_mac|inner_ipv4|inner_ipv6|inner_tcp|inner_udp|inner_sctp\\n\"\n+\n \t\t\t\"set txpkts (x[,y]*)\\n\"\n \t\t\t\"    Set the length of each segment of TXONLY\"\n \t\t\t\" and optionally CSUM packets.\\n\\n\"\n@@ -3456,6 +3464,68 @@ static cmdline_parse_inst_t cmd_stop = {\n \t},\n };\n \n+static unsigned int\n+get_ptype(char *value)\n+{\n+\tuint32_t protocol;\n+\n+\tif (!strcmp(value, \"mac\"))\n+\t\tprotocol = RTE_PTYPE_L2_ETHER;\n+\telse if (!strcmp(value, \"ipv4\"))\n+\t\tprotocol = RTE_PTYPE_L3_IPV4;\n+\telse if (!strcmp(value, \"ipv6\"))\n+\t\tprotocol = RTE_PTYPE_L3_IPV6;\n+\telse if (!strcmp(value, \"tcp\"))\n+\t\tprotocol = RTE_PTYPE_L4_TCP;\n+\telse if (!strcmp(value, \"udp\"))\n+\t\tprotocol = RTE_PTYPE_L4_UDP;\n+\telse if (!strcmp(value, \"sctp\"))\n+\t\tprotocol = RTE_PTYPE_L4_SCTP;\n+\telse if (!strcmp(value, \"inner_mac\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L2_ETHER;\n+\telse if (!strcmp(value, \"inner_ipv4\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L3_IPV4;\n+\telse if (!strcmp(value, \"inner_ipv6\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L3_IPV6;\n+\telse if (!strcmp(value, \"inner_tcp\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L4_TCP;\n+\telse if (!strcmp(value, \"inner_udp\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L4_UDP;\n+\telse if (!strcmp(value, \"inner_sctp\"))\n+\t\tprotocol = RTE_PTYPE_INNER_L4_SCTP;\n+\telse {\n+\t\tfprintf(stderr, \"Unsupported protocol: %s\\n\", value);\n+\t\tprotocol = RTE_PTYPE_UNKNOWN;\n+\t}\n+\n+\treturn protocol;\n+}\n+/* *** SET RXHDRSLIST *** */\n+\n+unsigned int\n+parse_hdrs_list(const char *str, const char *item_name, unsigned int max_items,\n+\t\t\t\tunsigned int *parsed_items, int check_hdrs_sequence)\n+{\n+\tunsigned int nb_item;\n+\tchar *cur;\n+\tchar *tmp;\n+\n+\tnb_item = 0;\n+\tchar *str2 = strdup(str);\n+\tcur = strtok_r(str2, \",\", &tmp);\n+\twhile (cur != NULL) {\n+\t\tparsed_items[nb_item] = get_ptype(cur);\n+\t\tcur = strtok_r(NULL, \",\", &tmp);\n+\t\tnb_item++;\n+\t}\n+\tif (nb_item > max_items)\n+\t\tfprintf(stderr, \"Number of %s = %u > %u (maximum items)\\n\",\n+\t\t\titem_name, nb_item + 1, max_items);\n+\tfree(str2);\n+\tif (!check_hdrs_sequence)\n+\t\treturn nb_item;\n+\treturn nb_item;\n+}\n /* *** SET CORELIST and PORTLIST CONFIGURATION *** */\n \n unsigned int\n@@ -3825,6 +3895,50 @@ static cmdline_parse_inst_t cmd_set_rxpkts = {\n \t},\n };\n \n+/* *** SET SEGMENT HEADERS OF RX PACKETS SPLIT *** */\n+struct cmd_set_rxhdrs_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t rxhdrs;\n+\tcmdline_fixed_string_t values;\n+};\n+\n+static void\n+cmd_set_rxhdrs_parsed(void *parsed_result,\n+\t\t      __rte_unused struct cmdline *cl,\n+\t\t      __rte_unused void *data)\n+{\n+\tstruct cmd_set_rxhdrs_result *res;\n+\tunsigned int seg_hdrs[MAX_SEGS_BUFFER_SPLIT];\n+\tunsigned int nb_segs;\n+\n+\tres = parsed_result;\n+\tnb_segs = parse_hdrs_list(res->values, \"segment hdrs\",\n+\t\t\t\t  MAX_SEGS_BUFFER_SPLIT, seg_hdrs, 0);\n+\tif (nb_segs > 0)\n+\t\tset_rx_pkt_hdrs(seg_hdrs, nb_segs);\n+\tcmd_reconfig_device_queue(RTE_PORT_ALL, 0, 1);\n+}\n+static cmdline_parse_token_string_t cmd_set_rxhdrs_set =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxhdrs_result,\n+\t\t\t\tset, \"set\");\n+static cmdline_parse_token_string_t cmd_set_rxhdrs_rxhdrs =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxhdrs_result,\n+\t\t\t\trxhdrs, \"rxhdrs\");\n+static cmdline_parse_token_string_t cmd_set_rxhdrs_values =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxhdrs_result,\n+\t\t\t\tvalues, NULL);\n+\n+static cmdline_parse_inst_t cmd_set_rxhdrs = {\n+\t.f = cmd_set_rxhdrs_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set rxhdrs <mac[,ipv4]*>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_rxhdrs_set,\n+\t\t(void *)&cmd_set_rxhdrs_rxhdrs,\n+\t\t(void *)&cmd_set_rxhdrs_values,\n+\t\tNULL,\n+\t},\n+};\n /* *** SET SEGMENT LENGTHS OF TXONLY PACKETS *** */\n \n struct cmd_set_txpkts_result {\n@@ -6918,6 +7032,8 @@ static void cmd_showcfg_parsed(void *parsed_result,\n \t\tshow_rx_pkt_offsets();\n \telse if (!strcmp(res->what, \"rxpkts\"))\n \t\tshow_rx_pkt_segments();\n+\telse if (!strcmp(res->what, \"rxhdrs\"))\n+\t\tshow_rx_pkt_hdrs();\n \telse if (!strcmp(res->what, \"txpkts\"))\n \t\tshow_tx_pkt_segments();\n \telse if (!strcmp(res->what, \"txtimes\"))\n@@ -6930,12 +7046,12 @@ static cmdline_parse_token_string_t cmd_showcfg_port =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showcfg_result, cfg, \"config\");\n static cmdline_parse_token_string_t cmd_showcfg_what =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showcfg_result, what,\n-\t\t\t\t \"rxtx#cores#fwd#rxoffs#rxpkts#txpkts#txtimes\");\n+\t\t\t\t \"rxtx#cores#fwd#rxoffs#rxpkts#rxhdrs#txpkts#txtimes\");\n \n static cmdline_parse_inst_t cmd_showcfg = {\n \t.f = cmd_showcfg_parsed,\n \t.data = NULL,\n-\t.help_str = \"show config rxtx|cores|fwd|rxoffs|rxpkts|txpkts|txtimes\",\n+\t.help_str = \"show config rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes\",\n \t.tokens = {\n \t\t(void *)&cmd_showcfg_show,\n \t\t(void *)&cmd_showcfg_port,\n@@ -14166,6 +14282,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_set_log,\n \t(cmdline_parse_inst_t *)&cmd_set_rxoffs,\n \t(cmdline_parse_inst_t *)&cmd_set_rxpkts,\n+\t(cmdline_parse_inst_t *)&cmd_set_rxhdrs,\n \t(cmdline_parse_inst_t *)&cmd_set_txpkts,\n \t(cmdline_parse_inst_t *)&cmd_set_txsplit,\n \t(cmdline_parse_inst_t *)&cmd_set_txtimes,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex a2939867c4..4102ebb3f9 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -4940,6 +4940,76 @@ show_rx_pkt_segments(void)\n \t}\n }\n \n+static const char *get_ptype_str(uint32_t ptype)\n+{\n+\tswitch (ptype) {\n+\tcase RTE_PTYPE_L2_ETHER:\n+\t\treturn \"outer_mac\";\n+\tcase RTE_PTYPE_L3_IPV4:\n+\t\treturn \"ipv4\";\n+\tcase RTE_PTYPE_L3_IPV6:\n+\t\treturn \"ipv6\";\n+\tcase RTE_PTYPE_L4_TCP:\n+\t\treturn \"tcp\";\n+\tcase RTE_PTYPE_L4_UDP:\n+\t\treturn \"udp\";\n+\tcase RTE_PTYPE_L4_SCTP:\n+\t\treturn \"sctp\";\n+\tcase RTE_PTYPE_INNER_L2_ETHER:\n+\t\treturn \"inner_mac\";\n+\tcase RTE_PTYPE_INNER_L3_IPV4:\n+\t\treturn \"inner_ipv4\";\n+\tcase RTE_PTYPE_INNER_L3_IPV6:\n+\t\treturn \"inner_ipv6\";\n+\tcase RTE_PTYPE_INNER_L4_TCP:\n+\t\treturn \"inner_tcp\";\n+\tcase RTE_PTYPE_INNER_L4_UDP:\n+\t\treturn \"inner_udp\";\n+\tcase RTE_PTYPE_INNER_L4_SCTP:\n+\t\treturn \"inner_sctp\";\n+\tdefault:\n+\t\treturn \"unsupported\";\n+\t}\n+}\n+\n+void\n+show_rx_pkt_hdrs(void)\n+{\n+\tuint32_t i, n;\n+\n+\tn = rx_pkt_nb_segs;\n+\tprintf(\"Number of segments: %u\\n\", n);\n+\tif (n) {\n+\t\tprintf(\"Packet segs: \");\n+\t\tfor (i = 0; i < n - 1; i++)\n+\t\t\tprintf(\"%s, \", get_ptype_str(rx_pkt_hdr_protos[i]));\n+\t\tprintf(\"payload\\n\");\n+\t}\n+}\n+\n+void\n+set_rx_pkt_hdrs(unsigned int *seg_hdrs, unsigned int nb_segs)\n+{\n+\tunsigned int i;\n+\n+\tif (nb_segs + 1 > MAX_SEGS_BUFFER_SPLIT) {\n+\t\tprintf(\"nb segments per RX packets=%u > \"\n+\t\t       \"MAX_SEGS_BUFFER_SPLIT - ignored\\n\", nb_segs + 1);\n+\t\treturn;\n+\t}\n+\n+\tmemset(rx_pkt_hdr_protos, 0, sizeof(rx_pkt_hdr_protos));\n+\n+\tfor (i = 0; i < nb_segs; i++)\n+\t\trx_pkt_hdr_protos[i] = (uint32_t)seg_hdrs[i];\n+\trx_pkt_hdr_protos[nb_segs] = RTE_PTYPE_ALL_MASK;\n+\t/*\n+\t * We calculate the number of hdrs, but payload is not included,\n+\t * so rx_pkt_nb_segs would increase 1.\n+\t */\n+\trx_pkt_nb_segs = nb_segs + 1;\n+}\n+\n void\n set_rx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs)\n {\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex e3c9757f3f..206194c385 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -164,6 +164,7 @@ usage(char* progname)\n \t       \" Used mainly with PCAP drivers.\\n\");\n \tprintf(\"  --rxoffs=X[,Y]*: set RX segment offsets for split.\\n\");\n \tprintf(\"  --rxpkts=X[,Y]*: set RX segment sizes to split.\\n\");\n+\tprintf(\"  --rxhdrs=mac[,ipv4]*: set RX segment protocol to split.\\n\");\n \tprintf(\"  --txpkts=X[,Y]*: set TX segment sizes\"\n \t\t\" or total packet length.\\n\");\n \tprintf(\"  --txonly-multi-flow: generate multiple flows in txonly mode\\n\");\n@@ -676,6 +677,7 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"flow-isolate-all\",\t        0, 0, 0 },\n \t\t{ \"rxoffs\",\t\t\t1, 0, 0 },\n \t\t{ \"rxpkts\",\t\t\t1, 0, 0 },\n+\t\t{ \"rxhdrs\",\t\t\t1, 0, 0 },\n \t\t{ \"txpkts\",\t\t\t1, 0, 0 },\n \t\t{ \"txonly-multi-flow\",\t\t0, 0, 0 },\n \t\t{ \"rxq-share\",\t\t\t2, 0, 0 },\n@@ -1331,7 +1333,6 @@ launch_args_parse(int argc, char** argv)\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"rxpkts\")) {\n \t\t\t\tunsigned int seg_len[MAX_SEGS_BUFFER_SPLIT];\n \t\t\t\tunsigned int nb_segs;\n-\n \t\t\t\tnb_segs = parse_item_list\n \t\t\t\t\t\t(optarg, \"rxpkt segments\",\n \t\t\t\t\t\t MAX_SEGS_BUFFER_SPLIT,\n@@ -1341,6 +1342,19 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\telse\n \t\t\t\t\trte_exit(EXIT_FAILURE, \"bad rxpkts\\n\");\n \t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"rxhdrs\")) {\n+\t\t\t\tunsigned int seg_hdrs[MAX_SEGS_BUFFER_SPLIT];\n+\t\t\t\tunsigned int nb_segs;\n+\n+\t\t\t\tnb_segs = parse_hdrs_list\n+\t\t\t\t\t\t(optarg, \"rxpkt segments\",\n+\t\t\t\t\t\tMAX_SEGS_BUFFER_SPLIT,\n+\t\t\t\t\t\tseg_hdrs, 0);\n+\t\t\t\tif (nb_segs >= 1)\n+\t\t\t\t\tset_rx_pkt_hdrs(seg_hdrs, nb_segs);\n+\t\t\t\telse\n+\t\t\t\t\trte_exit(EXIT_FAILURE, \"bad rxpkts\\n\");\n+\t\t\t}\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"txpkts\")) {\n \t\t\t\tunsigned seg_lengths[RTE_MAX_SEGS_PER_PKT];\n \t\t\t\tunsigned int nb_segs;\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex addcbcac85..157db60cd4 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -247,6 +247,7 @@ uint16_t rx_pkt_seg_lengths[MAX_SEGS_BUFFER_SPLIT];\n uint8_t  rx_pkt_nb_segs; /**< Number of segments to split */\n uint16_t rx_pkt_seg_offsets[MAX_SEGS_BUFFER_SPLIT];\n uint8_t  rx_pkt_nb_offs; /**< Number of specified offsets */\n+uint32_t rx_pkt_hdr_protos[MAX_SEGS_BUFFER_SPLIT];\n \n /*\n  * Configuration of packet segments used by the \"txonly\" processing engine.\n@@ -2685,6 +2686,7 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \t\trx_seg->offset = i < rx_pkt_nb_offs ?\n \t\t\t\t   rx_pkt_seg_offsets[i] : 0;\n \t\trx_seg->mp = mpx ? mpx : mp;\n+\t\trx_seg->proto_hdr = rx_pkt_hdr_protos[i];\n \t}\n \trx_conf->rx_nseg = rx_pkt_nb_segs;\n \trx_conf->rx_seg = rx_useg;\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex fb2f5195d3..de992c9416 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -562,6 +562,7 @@ extern uint32_t max_rx_pkt_len;\n  * Configuration of packet segments used to scatter received packets\n  * if some of split features is configured.\n  */\n+extern uint32_t rx_pkt_hdr_protos[MAX_SEGS_BUFFER_SPLIT];\n extern uint16_t rx_pkt_seg_lengths[MAX_SEGS_BUFFER_SPLIT];\n extern uint8_t  rx_pkt_nb_segs; /**< Number of segments to split */\n extern uint16_t rx_pkt_seg_offsets[MAX_SEGS_BUFFER_SPLIT];\n@@ -892,6 +893,9 @@ inc_tx_burst_stats(struct fwd_stream *fs, uint16_t nb_tx)\n unsigned int parse_item_list(const char *str, const char *item_name,\n \t\t\tunsigned int max_items,\n \t\t\tunsigned int *parsed_items, int check_unique_values);\n+unsigned int parse_hdrs_list(const char *str, const char *item_name,\n+\t\t\tunsigned int max_item,\n+\t\t\tunsigned int *parsed_items, int check_unique_values);\n void launch_args_parse(int argc, char** argv);\n void cmdline_read_from_file(const char *filename);\n int init_cmdline(void);\n@@ -1049,6 +1053,8 @@ void set_record_core_cycles(uint8_t on_off);\n void set_record_burst_stats(uint8_t on_off);\n void set_verbose_level(uint16_t vb_level);\n void set_rx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs);\n+void set_rx_pkt_hdrs(unsigned int *seg_protos, unsigned int nb_segs);\n+void show_rx_pkt_hdrs(void);\n void show_rx_pkt_segments(void);\n void set_rx_pkt_offsets(unsigned int *seg_offsets, unsigned int nb_offs);\n void show_rx_pkt_offsets(void);\n",
    "prefixes": [
        "v2",
        "3/4"
    ]
}