Show a patch.

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

{
    "id": 92,
    "url": "https://patches.dpdk.org/api/patches/92/",
    "web_url": "https://patches.dpdk.org/patch/92/",
    "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": "<1406184149-11531-6-git-send-email-helin.zhang@intel.com>",
    "date": "2014-07-24T06:42:29",
    "name": "[dpdk-dev,5/5] app/testpmd: new commands for configuring hash functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e70baed6b44337f7d55e2f5327ffc43f75cd5e65",
    "submitter": {
        "id": 14,
        "url": "https://patches.dpdk.org/api/people/14/",
        "name": "Helin Zhang",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/92/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/92/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/92/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Date": "Thu, 24 Jul 2014 14:42:29 +0800",
        "In-Reply-To": "<1406184149-11531-1-git-send-email-helin.zhang@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<1406184149-11531-1-git-send-email-helin.zhang@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "To": "dev@dpdk.org",
        "Received": [
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 5AC0CB36A\n\tfor <dev@dpdk.org>; Thu, 24 Jul 2014 08:41:30 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 23 Jul 2014 23:36:18 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 23 Jul 2014 23:42:46 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id s6O6gjnq017108;\n\tThu, 24 Jul 2014 14:42:45 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s6O6gf7A011675; Thu, 24 Jul 2014 14:42:43 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s6O6gfS4011671; \n\tThu, 24 Jul 2014 14:42:41 +0800"
        ],
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "Precedence": "list",
        "X-ExtLoop1": "1",
        "Message-Id": "<1406184149-11531-6-git-send-email-helin.zhang@intel.com>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 5/5] app/testpmd: new commands for configuring\n\thash functions",
        "X-List-Received-Date": "Thu, 24 Jul 2014 06:41:31 -0000",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Return-Path": "<hzhan75@shecgisg004.sh.intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.01,722,1400050800\"; d=\"scan'208\";a=\"566441341\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "Six commands are added in testpmd to support configuring\nhash functions. They are,\n* i40e_get_sym_hash_ena_per_port\n* i40e_set_sym_hash_ena_per_port\n* i40e_get_sym_hash_ena_per_pctype\n* i40e_set_sym_hash_ena_per_pctype\n* i40e_get_filter_swap\n* i40e_set_filter_swap\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\n---\n app/test-pmd/cmdline.c | 455 +++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 455 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 345be11..0e075da 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -74,6 +74,10 @@\n #include <rte_ethdev.h>\n #include <rte_string_fns.h>\n #include <rte_devargs.h>\n+#include <rte_eth_features.h>\n+#ifdef RTE_LIBRTE_I40E_PMD\n+#include <rte_i40e.h>\n+#endif\n \n #include <cmdline_rdline.h>\n #include <cmdline_parse.h>\n@@ -655,6 +659,34 @@ static void cmd_help_long_parsed(void *parsed_result,\n \n \t\t\t\"get_flex_filter (port_id) index (idx)\\n\"\n \t\t\t\"    get info of a flex filter.\\n\\n\"\n+\n+#ifdef RTE_LIBRTE_I40E_PMD\n+\t\t\t\"i40e_get_sym_hash_ena_per_port (port_id)\\n\"\n+\t\t\t\"    get symmetric hash enable configuration per port,\"\n+\t\t\t\" on i40e only\\n\\n\"\n+\n+\t\t\t\"i40e_set_sym_hash_ena_per_port (port_id)\"\n+\t\t\t\" enable|disable\\n\"\n+\t\t\t\"    set symmetric hash enable configuration per port\"\n+\t\t\t\" to enable or disable, on i40e only\\n\\n\"\n+\n+\t\t\t\"i40e_get_sym_hash_ena_per_pctype (port_id) (pctype)\\n\"\n+\t\t\t\"    get symmetric hash enable configuration per port,\"\n+\t\t\t\" on i40e only\\n\\n\"\n+\n+\t\t\t\"i40e_set_sym_hash_ena_per_pctype (port_id) (pctype)\"\n+\t\t\t\" enable|disable\\n\"\n+\t\t\t\"    set symmetric hash enable configuration per\"\n+\t\t\t\" pctype to enable or disable, on i40e only\\n\\n\"\n+\n+\t\t\t\"i40e_get_filter_swap (port_id) (pctype)\\n\"\n+\t\t\t\"    get filter swap configurations on i40e,\"\n+\t\t\t\" on i40e only\\n\\n\"\n+\n+\t\t\t\"i40e_set_filter_swap (port_id) (pctype) (off0_src0)\"\n+\t\t\t\" (off0_src1) (len0) (off1_src0) (off1_src1) (len1)\\n\"\n+\t\t\t\"    set filter swap configurations, on i40e only\\n\\n\"\n+#endif /* RTE_LIBRTE_I40E_PMD */\n \t\t);\n \t}\n }\n@@ -7304,6 +7336,421 @@ cmdline_parse_inst_t cmd_get_flex_filter = {\n \t},\n };\n \n+/* *** Classification Filters Control *** */\n+#ifdef RTE_LIBRTE_I40E_PMD\n+/* *** Get symmetric hash enable per port *** */\n+struct cmd_i40e_get_sym_hash_ena_per_port_result {\n+\tcmdline_fixed_string_t i40e_get_sym_hash_ena_per_port;\n+\tuint8_t port_id;\n+};\n+\n+static void\n+cmd_i40e_get_sym_hash_per_port_parsed(void *parsed_result,\n+\t\t\t\t      __rte_unused struct cmdline *cl,\n+\t\t\t\t      __rte_unused void *data)\n+{\n+\tstruct cmd_i40e_get_sym_hash_ena_per_port_result *res = parsed_result;\n+\tuint8_t enable = 0;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\tRTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT \"\n+\t\t\t\"not supported on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\tRTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT, &enable);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot get symmetric hash enable per port \"\n+\t\t\t\t\"on i40e port %u\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"Symmetric hash is %s on i40e port %u\\n\",\n+\t\tenable ? \"enabled\" : \"disabled\", res->port_id);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_get_sym_hash_ena_per_port_all =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_get_sym_hash_ena_per_port_result,\n+\t\t\ti40e_get_sym_hash_ena_per_port,\n+\t\t\t\"i40e_get_sym_hash_ena_per_port\");\n+cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_port_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_get_sym_hash_ena_per_port_result,\n+\t\tport_id, UINT8);\n+\n+cmdline_parse_inst_t cmd_i40e_get_sym_hash_ena_per_port = {\n+\t.f = cmd_i40e_get_sym_hash_per_port_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_get_sym_hash_ena_per_port port_id\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_get_sym_hash_ena_per_port_all,\n+\t\t(void *)&cmd_i40e_get_sym_hash_ena_per_port_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Set symmetric hash enable per port *** */\n+struct cmd_i40e_set_sym_hash_ena_per_port_result {\n+\tcmdline_fixed_string_t i40e_set_sym_hash_ena_per_port;\n+\tcmdline_fixed_string_t enable;\n+\tuint8_t port_id;\n+};\n+\n+static void\n+cmd_i40e_set_sym_hash_per_port_parsed(void *parsed_result,\n+\t\t\t\t      __rte_unused struct cmdline *cl,\n+\t\t\t\t      __rte_unused void *data)\n+{\n+\tstruct cmd_i40e_set_sym_hash_ena_per_port_result *res = parsed_result;\n+\tuint8_t enable = 0;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\tRTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT \"\n+\t\t\t\"not supported on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tif (!strcmp(res->enable, \"enable\"))\n+\t\tenable = 1;\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\tRTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT, &enable);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot set symmetric hash enable per port \"\n+\t\t\t\t\"on i40e port %u\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"Symmetric hash has been set to %s on i40e port %u\\n\",\n+\t\t\t\t\tres->enable, res->port_id);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_port_all =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_port_result,\n+\t\t\t\ti40e_set_sym_hash_ena_per_port,\n+\t\t\t\t\"i40e_set_sym_hash_ena_per_port\");\n+cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_port_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_sym_hash_ena_per_port_result,\n+\t\tport_id, UINT8);\n+cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_port_enable =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_port_result,\n+\t\t\t\t\tenable, \"enable#disable\");\n+\n+cmdline_parse_inst_t cmd_i40e_set_sym_hash_ena_per_port = {\n+\t.f = cmd_i40e_set_sym_hash_per_port_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_set_sym_hash_ena_per_port port_id enable|disable\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_port_all,\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_port_port_id,\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_port_enable,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Get symmetric hash enable per pctype *** */\n+struct cmd_i40e_get_sym_hash_ena_per_pctype_result {\n+\tcmdline_fixed_string_t i40e_get_sym_hash_ena_per_pctype;\n+\tuint8_t port_id;\n+\tuint8_t pctype;\n+};\n+\n+static void\n+cmd_i40e_get_sym_hash_per_pctype_parsed(void *parsed_result,\n+\t\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_i40e_get_sym_hash_ena_per_pctype_result *res =\n+\t\t\t\t\t\tparsed_result;\n+\tstruct rte_i40e_sym_hash_enable_info info;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\tRTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE \"\n+\t\t\t\"not supported on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.pctype = res->pctype;\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\tRTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE, &info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot get symmetric hash enable per pctype on i40e \"\n+\t\t\t\"port %u, pctype %u\\n\", res->port_id, res->pctype);\n+\t\treturn;\n+\t}\n+\tprintf(\"Symmetric hash is %s on i40e port %u, pctype %u\\n\",\n+\t\t\t\tinfo.enable ? \"enabled\" : \"disabled\",\n+\t\t\t\t\tres->port_id, res->pctype);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_get_sym_hash_ena_per_pctype_all =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_get_sym_hash_ena_per_pctype_result,\n+\t\t\t\ti40e_get_sym_hash_ena_per_pctype,\n+\t\t\t\t\"i40e_get_sym_hash_ena_per_pctype\");\n+cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_pctype_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_i40e_get_sym_hash_ena_per_pctype_result,\n+\t\t\t\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_pctype_pctype =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_i40e_get_sym_hash_ena_per_pctype_result,\n+\t\t\t\t\t\tpctype, UINT8);\n+\n+cmdline_parse_inst_t cmd_i40e_get_sym_hash_ena_per_pctype = {\n+\t.f = cmd_i40e_get_sym_hash_per_pctype_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_get_sym_hash_ena_per_pctype port_id pctype\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_get_sym_hash_ena_per_pctype_all,\n+\t\t(void *)&cmd_i40e_get_sym_hash_ena_per_pctype_port_id,\n+\t\t(void *)&cmd_i40e_get_sym_hash_ena_per_pctype_pctype,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Set symmetric hash enable per pctype *** */\n+struct cmd_i40e_set_sym_hash_ena_per_pctype_result {\n+\tcmdline_fixed_string_t i40e_set_sym_hash_ena_per_pctype;\n+\tcmdline_fixed_string_t enable;\n+\tuint8_t port_id;\n+\tuint8_t pctype;\n+};\n+\n+static void\n+cmd_i40e_set_sym_hash_per_pctype_parsed(void *parsed_result,\n+\t\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_i40e_set_sym_hash_ena_per_pctype_result *res =\n+\t\t\t\t\t\tparsed_result;\n+\tstruct rte_i40e_sym_hash_enable_info info;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\tRTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE \"\n+\t\t\t\"not supported on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.pctype = res->pctype;\n+\tif (!strcmp(res->enable, \"enable\"))\n+\t\tinfo.enable = 1;\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\tRTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE, &info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot set symmetric hash enable per pctype to %s \"\n+\t\t\t\"on i40e port %u, pctype %u\\n\", res->enable ?\n+\t\t\t\"enabled\" : \"disabled\", res->port_id, res->pctype);\n+\t\treturn;\n+\t}\n+\tprintf(\"Symmetic hash has been set to %s on i40e port %u, pctype %u\\n\",\n+\t\t\t\tres->enable, res->port_id, res->pctype);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_pctype_all =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_pctype_result,\n+\t\t\t\ti40e_set_sym_hash_ena_per_pctype,\n+\t\t\t\t\"i40e_set_sym_hash_ena_per_pctype\");\n+cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_pctype_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_pctype_result,\n+\t\t\t\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_pctype_pctype =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_pctype_result,\n+\t\tpctype, UINT8);\n+cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_pctype_enable =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_i40e_set_sym_hash_ena_per_pctype_result,\n+\t\tenable, \"enable#disable\");\n+\n+cmdline_parse_inst_t cmd_i40e_set_sym_hash_ena_per_pctype = {\n+\t.f = cmd_i40e_set_sym_hash_per_pctype_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_set_sym_hash_ena_per_pctype pord_id \"\n+\t\t\t\t\t\"pctype enable|disable\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_pctype_all,\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_pctype_port_id,\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_pctype_pctype,\n+\t\t(void *)&cmd_i40e_set_sym_hash_ena_per_pctype_enable,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Get filter swap *** */\n+struct cmd_i40e_get_filter_swap_result {\n+\tcmdline_fixed_string_t i40e_get_filter_swap;\n+\tuint8_t port_id;\n+\tuint8_t pctype;\n+};\n+\n+static void\n+cmd_i40e_get_filter_swap_parsed(void *parsed_result,\n+\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_i40e_get_filter_swap_result *res = parsed_result;\n+\tstruct rte_i40e_filter_swap_info info;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\t\tRTE_CMD_GET_FILTER_SWAP) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_GET_FILTER_SWAP not supported \"\n+\t\t\t\t\t\"on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.pctype = res->pctype;\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\t\t\tRTE_CMD_GET_FILTER_SWAP, &info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot get filter swap on i40e port %u, pctype %u\\n\",\n+\t\t\t\t\t\tres->port_id, res->pctype);\n+\t\treturn;\n+\t}\n+\tprintf(\"Filter swap of i40e port %u, pctype %u is configured as:\\n\"\n+\t\t\t\"off0_src0: 0x%02x, off0_src1: 0x%02x, len0: 0x%02x\\n\"\n+\t\t\t\"off1_src0: 0x%02x, off1_src1: 0x%02x, len1: 0x%02x\\n\",\n+\t\tres->port_id, res->pctype, info.off0_src0, info.off0_src1,\n+\t\tinfo.len0, info.off1_src0, info.off1_src1, info.len1);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_get_filter_swap_all =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_i40e_get_filter_swap_result,\n+\t\ti40e_get_filter_swap, \"i40e_get_filter_swap\");\n+cmdline_parse_token_num_t cmd_i40e_get_filter_swap_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_get_filter_swap_result,\n+\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_get_filter_swap_pctype =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_get_filter_swap_result,\n+\t\tpctype, UINT8);\n+\n+cmdline_parse_inst_t cmd_i40e_get_filter_swap = {\n+\t.f = cmd_i40e_get_filter_swap_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_get_filter_swap port_id pctype\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_get_filter_swap_all,\n+\t\t(void *)&cmd_i40e_get_filter_swap_port_id,\n+\t\t(void *)&cmd_i40e_get_filter_swap_pctype,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Set filter swap *** */\n+struct cmd_i40e_set_filter_swap_result {\n+\tcmdline_fixed_string_t i40e_set_filter_swap;\n+\tuint8_t port_id;\n+\tuint8_t pctype;\n+\tuint8_t off0_src0;\n+\tuint8_t off0_src1;\n+\tuint8_t len0;\n+\tuint8_t off1_src0;\n+\tuint8_t off1_src1;\n+\tuint8_t len1;\n+};\n+\n+static void\n+cmd_i40e_set_filter_swap_parsed(void *parsed_result,\n+\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_i40e_set_filter_swap_result *res = parsed_result;\n+\tstruct rte_i40e_filter_swap_info info;\n+\tint ret;\n+\n+\tif (rte_eth_dev_check_command_supported(res->port_id,\n+\t\t\tRTE_CMD_SET_FILTER_SWAP) <= 0) {\n+\t\tprintf(\"Command of RTE_CMD_SET_FILTER_SWAP not supported \"\n+\t\t\t\t\t\"on port: %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.pctype = res->pctype;\n+\tinfo.off0_src0 = res->off0_src0;\n+\tinfo.off0_src1 = res->off0_src1;\n+\tinfo.len0 = res->len0;\n+\tinfo.off1_src0 = res->off1_src0;\n+\tinfo.off1_src1 = res->off1_src1;\n+\tinfo.len1 = res->len1;\n+\tret = rte_eth_dev_rx_classification_filter_ctl(res->port_id,\n+\t\t\t\tRTE_CMD_SET_FILTER_SWAP, &info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Cannot set filter swap on i40e port %u, pctype %u\\n\",\n+\t\t\t\t\t\tres->port_id, res->pctype);\n+\t\treturn;\n+\t}\n+\tprintf(\"Filter swap of i40e port %u, pctype %u has been set as:\\n\"\n+\t\t\t\"off0_src0: 0x%02x, off0_src1: 0x%02x, len0: 0x%02x\\n\"\n+\t\t\t\"off1_src0: 0x%02x, off1_src1: 0x%02x, len1: 0x%02x\\n\",\n+\t\tres->port_id, res->pctype, info.off0_src0, info.off0_src1,\n+\t\tinfo.len0, info.off1_src0, info.off1_src1, info.len1);\n+}\n+\n+cmdline_parse_token_string_t cmd_i40e_set_filter_swap_all =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\ti40e_set_filter_swap, \"i40e_set_filter_swap\");\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_pctype =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\tpctype, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off0_src0 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\toff0_src0, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off0_src1 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\toff0_src1, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_len0 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\tlen0, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off1_src0 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\toff1_src0, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off1_src1 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\toff1_src1, UINT8);\n+cmdline_parse_token_num_t cmd_i40e_set_filter_swap_len1 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result,\n+\t\tlen1, UINT8);\n+\n+cmdline_parse_inst_t cmd_i40e_set_filter_swap = {\n+\t.f = cmd_i40e_set_filter_swap_parsed,\n+\t.data = NULL,\n+\t.help_str = \"i40e_set_filter_swap port_id pctype off0_src0 off0_src1 \"\n+\t\t\t\t\t\"len0 off1_src0 off1_src1 len1\",\n+\t.tokens = {\n+\t\t(void *)&cmd_i40e_set_filter_swap_all,\n+\t\t(void *)&cmd_i40e_set_filter_swap_port_id,\n+\t\t(void *)&cmd_i40e_set_filter_swap_pctype,\n+\t\t(void *)&cmd_i40e_set_filter_swap_off0_src0,\n+\t\t(void *)&cmd_i40e_set_filter_swap_off0_src1,\n+\t\t(void *)&cmd_i40e_set_filter_swap_len0,\n+\t\t(void *)&cmd_i40e_set_filter_swap_off1_src0,\n+\t\t(void *)&cmd_i40e_set_filter_swap_off1_src1,\n+\t\t(void *)&cmd_i40e_set_filter_swap_len1,\n+\t\tNULL,\n+\t},\n+};\n+#endif /* RTE_LIBRTE_I40E_PMD */\n+\n /* ******************************************************************************** */\n \n /* list of instructions */\n@@ -7429,6 +7876,14 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_add_flex_filter,\n \t(cmdline_parse_inst_t *)&cmd_remove_flex_filter,\n \t(cmdline_parse_inst_t *)&cmd_get_flex_filter,\n+#ifdef RTE_LIBRTE_I40E_PMD\n+\t(cmdline_parse_inst_t *)&cmd_i40e_get_sym_hash_ena_per_port,\n+\t(cmdline_parse_inst_t *)&cmd_i40e_set_sym_hash_ena_per_port,\n+\t(cmdline_parse_inst_t *)&cmd_i40e_get_sym_hash_ena_per_pctype,\n+\t(cmdline_parse_inst_t *)&cmd_i40e_set_sym_hash_ena_per_pctype,\n+\t(cmdline_parse_inst_t *)&cmd_i40e_get_filter_swap,\n+\t(cmdline_parse_inst_t *)&cmd_i40e_set_filter_swap,\n+#endif /* RTE_LIBRTE_I40E_PMD */\n \tNULL,\n };\n \n",
    "prefixes": [
        "dpdk-dev",
        "5/5"
    ]
}