get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81082,
    "url": "http://patchwork.dpdk.org/api/patches/81082/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1602843764-32331-6-git-send-email-viacheslavo@nvidia.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": "<1602843764-32331-6-git-send-email-viacheslavo@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1602843764-32331-6-git-send-email-viacheslavo@nvidia.com",
    "date": "2020-10-16T10:22:43",
    "name": "[v9,5/6] app/testpmd: add rxoffs commands and parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f5486e2763ab90f34b9caa31ced349bbfc2ef980",
    "submitter": {
        "id": 1926,
        "url": "http://patchwork.dpdk.org/api/people/1926/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@nvidia.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/1602843764-32331-6-git-send-email-viacheslavo@nvidia.com/mbox/",
    "series": [
        {
            "id": 13054,
            "url": "http://patchwork.dpdk.org/api/series/13054/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=13054",
            "date": "2020-10-16T10:22:38",
            "name": "ethdev: introduce Rx buffer split",
            "version": 9,
            "mbox": "http://patchwork.dpdk.org/series/13054/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/81082/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/81082/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 49A80A04DB;\n\tFri, 16 Oct 2020 12:24:29 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DFDCC1ECE2;\n\tFri, 16 Oct 2020 12:23:12 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id C26121ECC6\n for <dev@dpdk.org>; Fri, 16 Oct 2020 12:23:07 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n viacheslavo@nvidia.com) with SMTP; 16 Oct 2020 13:23:05 +0300",
            "from nvidia.com (pegasus12.mtr.labs.mlnx [10.210.17.40])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09GAMwRX031891;\n Fri, 16 Oct 2020 13:23:05 +0300"
        ],
        "From": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, stephen@networkplumber.org, ferruh.yigit@intel.com,\n olivier.matz@6wind.com, jerinjacobk@gmail.com,\n maxime.coquelin@redhat.com, david.marchand@redhat.com,\n arybchenko@solarflare.com",
        "Date": "Fri, 16 Oct 2020 10:22:43 +0000",
        "Message-Id": "<1602843764-32331-6-git-send-email-viacheslavo@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1602843764-32331-1-git-send-email-viacheslavo@nvidia.com>",
        "References": "\n <MWHPR12MB136076E652230CEBD6EE6562DF5F0@MWHPR12MB1360.namprd12.prod.outlook.com>\n <1602843764-32331-1-git-send-email-viacheslavo@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v9 5/6] app/testpmd: add rxoffs commands and\n\tparameters",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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 command line parameter:\n\n--rxoffs=X[,Y]\n\nSets the offsets of packet segments from the beginning of the\nreceiving buffer if split feature is engaged. Affects only the\nqueues configured with split offloads (currently BUFFER_SPLIT\nis supported only).\n\nAdd interactive mode command, providing the same:\n\ntestpmd> set rxoffs (x[,y]*)\n\nWhere x[,y]* represents a CSV list of values, without white space.\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n---\n app/test-pmd/cmdline.c                      | 61 +++++++++++++++++++++++++++--\n app/test-pmd/config.c                       | 44 +++++++++++++++++++++\n app/test-pmd/parameters.c                   | 15 +++++++\n app/test-pmd/testpmd.c                      |  2 +\n app/test-pmd/testpmd.h                      |  4 ++\n doc/guides/testpmd_app_ug/run_app.rst       |  6 +++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 17 +++++++-\n 7 files changed, 145 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex a195e37..e09df36 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|rxpkts|txpkts)\\n\"\n+\t\t\t\"show config (rxtx|cores|fwd|rxoffs|rxpkts|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@@ -294,6 +294,12 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"    Set the transmit delay time and number of retries,\"\n \t\t\t\" effective when retry is enabled.\\n\\n\"\n \n+\t\t\t\"set rxoffs (x[,y]*)\\n\"\n+\t\t\t\"    Set the offset of each packet segment on\"\n+\t\t\t\" 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+\n \t\t\t\"set rxpkts (x[,y]*)\\n\"\n \t\t\t\"    Set the length of each segment to scatter\"\n \t\t\t\" packets on receiving if split feature is engaged.\"\n@@ -3913,6 +3919,52 @@ struct cmd_set_log_result {\n \t},\n };\n \n+/* *** SET SEGMENT OFFSETS OF RX PACKETS SPLIT *** */\n+\n+struct cmd_set_rxoffs_result {\n+\tcmdline_fixed_string_t cmd_keyword;\n+\tcmdline_fixed_string_t rxoffs;\n+\tcmdline_fixed_string_t seg_offsets;\n+};\n+\n+static void\n+cmd_set_rxoffs_parsed(void *parsed_result,\n+\t\t      __rte_unused struct cmdline *cl,\n+\t\t      __rte_unused void *data)\n+{\n+\tstruct cmd_set_rxoffs_result *res;\n+\tunsigned int seg_offsets[MAX_SEGS_BUFFER_SPLIT];\n+\tunsigned int nb_segs;\n+\n+\tres = parsed_result;\n+\tnb_segs = parse_item_list(res->seg_offsets, \"segment offsets\",\n+\t\t\t\t  MAX_SEGS_BUFFER_SPLIT, seg_offsets, 0);\n+\tif (nb_segs > 0)\n+\t\tset_rx_pkt_offsets(seg_offsets, nb_segs);\n+}\n+\n+cmdline_parse_token_string_t cmd_set_rxoffs_keyword =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxoffs_result,\n+\t\t\t\t cmd_keyword, \"set\");\n+cmdline_parse_token_string_t cmd_set_rxoffs_name =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxoffs_result,\n+\t\t\t\t rxoffs, \"rxoffs\");\n+cmdline_parse_token_string_t cmd_set_rxoffs_offsets =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_rxoffs_result,\n+\t\t\t\t seg_offsets, NULL);\n+\n+cmdline_parse_inst_t cmd_set_rxoffs = {\n+\t.f = cmd_set_rxoffs_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set rxoffs <len0[,len1]*>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_rxoffs_keyword,\n+\t\t(void *)&cmd_set_rxoffs_name,\n+\t\t(void *)&cmd_set_rxoffs_offsets,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** SET SEGMENT LENGTHS OF RX PACKETS SPLIT *** */\n \n struct cmd_set_rxpkts_result {\n@@ -7587,6 +7639,8 @@ static void cmd_showcfg_parsed(void *parsed_result,\n \t\tfwd_lcores_config_display();\n \telse if (!strcmp(res->what, \"fwd\"))\n \t\tpkt_fwd_config_display(&cur_fwd_config);\n+\telse if (!strcmp(res->what, \"rxoffs\"))\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, \"txpkts\"))\n@@ -7601,12 +7655,12 @@ static void cmd_showcfg_parsed(void *parsed_result,\n \tTOKEN_STRING_INITIALIZER(struct cmd_showcfg_result, cfg, \"config\");\n 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#rxpkts#txpkts#txtimes\");\n+\t\t\t\t \"rxtx#cores#fwd#rxoffs#rxpkts#txpkts#txtimes\");\n \n 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|rxpkts|txpkts|txtimes\",\n+\t.help_str = \"show config rxtx|cores|fwd|rxoffs|rxpkts|txpkts|txtimes\",\n \t.tokens = {\n \t\t(void *)&cmd_showcfg_show,\n \t\t(void *)&cmd_showcfg_port,\n@@ -19879,6 +19933,7 @@ struct cmd_showport_macs_result {\n \t(cmdline_parse_inst_t *)&cmd_reset,\n \t(cmdline_parse_inst_t *)&cmd_set_numbers,\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_txpkts,\n \t(cmdline_parse_inst_t *)&cmd_set_txsplit,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 4ac2052..5d3f108 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -3528,6 +3528,50 @@ struct igb_ring_desc_16_bytes {\n }\n \n void\n+show_rx_pkt_offsets(void)\n+{\n+\tuint32_t i, n;\n+\n+\tn = rx_pkt_nb_offs;\n+\tprintf(\"Number of offsets: %u\\n\", n);\n+\tif (n) {\n+\t\tprintf(\"Segment offsets: \");\n+\t\tfor (i = 0; i != n - 1; i++)\n+\t\t\tprintf(\"%hu,\", rx_pkt_seg_offsets[i]);\n+\t\tprintf(\"%hu\\n\", rx_pkt_seg_lengths[i]);\n+\t}\n+}\n+\n+void\n+set_rx_pkt_offsets(unsigned int *seg_offsets, unsigned int nb_offs)\n+{\n+\tunsigned int i;\n+\n+\tif (nb_offs >= MAX_SEGS_BUFFER_SPLIT) {\n+\t\tprintf(\"nb segments per RX packets=%u >= \"\n+\t\t       \"MAX_SEGS_BUFFER_SPLIT - ignored\\n\", nb_offs);\n+\t\treturn;\n+\t}\n+\n+\t/*\n+\t * No extra check here, the segment length will be checked by PMD\n+\t * in the extended queue setup.\n+\t */\n+\tfor (i = 0; i < nb_offs; i++) {\n+\t\tif (seg_offsets[i] >= UINT16_MAX) {\n+\t\t\tprintf(\"offset[%u]=%u > UINT16_MAX - give up\\n\",\n+\t\t\t       i, seg_offsets[i]);\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < nb_offs; i++)\n+\t\trx_pkt_seg_offsets[i] = (uint16_t) seg_offsets[i];\n+\n+\trx_pkt_nb_offs = (uint8_t) nb_offs;\n+}\n+\n+void\n show_rx_pkt_segments(void)\n {\n \tuint32_t i, n;\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex e4e3635..2298ba5 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -184,6 +184,7 @@\n \t       \"(0 <= mapping <= %d).\\n\", RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);\n \tprintf(\"  --no-flush-rx: Don't flush RX streams before forwarding.\"\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(\"  --txpkts=X[,Y]*: set TX segment sizes\"\n \t\t\" or total packet length.\\n\");\n@@ -663,6 +664,7 @@\n \t\t{ \"rx-queue-stats-mapping\",\t1, 0, 0 },\n \t\t{ \"no-flush-rx\",\t0, 0, 0 },\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{ \"txpkts\",\t\t\t1, 0, 0 },\n \t\t{ \"txonly-multi-flow\",\t\t0, 0, 0 },\n@@ -1274,6 +1276,19 @@\n \t\t\t\t\t\t \"invalid RX queue statistics mapping config entered\\n\");\n \t\t\t\t}\n \t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"rxoffs\")) {\n+\t\t\t\tunsigned int seg_off[MAX_SEGS_BUFFER_SPLIT];\n+\t\t\t\tunsigned int nb_offs;\n+\n+\t\t\t\tnb_offs = parse_item_list\n+\t\t\t\t\t\t(optarg, \"rxpkt offsets\",\n+\t\t\t\t\t\t MAX_SEGS_BUFFER_SPLIT,\n+\t\t\t\t\t\t seg_off, 0);\n+\t\t\t\tif (nb_offs > 0)\n+\t\t\t\t\tset_rx_pkt_offsets(seg_off, nb_offs);\n+\t\t\t\telse\n+\t\t\t\t\trte_exit(EXIT_FAILURE, \"bad rxoffs\\n\");\n+\t\t\t}\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;\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex f88c1e2..580178d 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -215,6 +215,8 @@ struct fwd_engine * fwd_engines[] = {\n  */\n 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 \n /*\n  * Configuration of packet segments used by the \"txonly\" processing engine.\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex c5c942a..dc37148 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -435,6 +435,8 @@ struct queue_stats_mappings {\n  */\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+extern uint8_t  rx_pkt_nb_offs; /**< Number of specified offsets */\n \n /*\n  * Configuration of packet segments used by the \"txonly\" processing engine.\n@@ -845,6 +847,8 @@ void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,\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 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 void set_tx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs);\n void show_tx_pkt_segments(void);\n void set_tx_pkt_times(unsigned int *tx_times);\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex 463b76c..9b0a84a 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -361,6 +361,12 @@ The command line options are:\n \n     Don't flush the RX streams before starting forwarding. Used mainly with the PCAP PMD.\n \n+*   ``--rxoffs=X[,Y]``\n+\n+    Set the offsets of packet segments on receiving if split\n+    feature is engaged. Affects only the queues configured\n+    with split offloads (currently BUFFER_SPLIT is supported only).\n+\n *   ``--rxpkts=X[,Y]``\n \n     Set the length of segments to scatter packets on receiving if split\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex b9fad3a..e73530e 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -273,7 +273,7 @@ show config\n Displays the configuration of the application.\n The configuration comes from the command-line, the runtime or the application defaults::\n \n-   testpmd> show config (rxtx|cores|fwd|rxpkts|txpkts|txtimes)\n+   testpmd> show config (rxtx|cores|fwd|rxoffs|rxpkts|txpkts|txtimes)\n \n The available information categories are:\n \n@@ -283,6 +283,8 @@ The available information categories are:\n \n * ``fwd``: Packet forwarding configuration.\n \n+* ``rxoffs``: Packet offsets for RX split.\n+\n * ``rxpkts``: Packets to RX split configuration.\n \n * ``txpkts``: Packets to TX configuration.\n@@ -776,6 +778,19 @@ When retry is enabled, the transmit delay time and number of retries can also be\n \n    testpmd> set burst tx delay (microseconds) retry (num)\n \n+set rxoffs\n+~~~~~~~~~~\n+\n+Set the offsets of segments relating to the data buffer beginning on receiving\n+if split feature is engaged. Affects only the queues configured with split\n+offloads (currently BUFFER_SPLIT is supported only).\n+\n+   testpmd> set rxoffs (x[,y]*)\n+\n+Where x[,y]* represents a CSV list of values, without white space. If the list\n+of offsets is shorter than the list of segments the zero offsets will be used\n+for the remaining segments.\n+\n set rxpkts\n ~~~~~~~~~~\n \n",
    "prefixes": [
        "v9",
        "5/6"
    ]
}