get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7451,
    "url": "https://patches.dpdk.org/api/patches/7451/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1444067692-29645-12-git-send-email-adrien.mazarguil@6wind.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": "<1444067692-29645-12-git-send-email-adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1444067692-29645-12-git-send-email-adrien.mazarguil@6wind.com",
    "date": "2015-10-05T17:54:46",
    "name": "[dpdk-dev,11/17] app/testpmd: add missing type to RSS hash commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "973f3198b25fe7d617d2d30c700944965f19453f",
    "submitter": {
        "id": 165,
        "url": "https://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1444067692-29645-12-git-send-email-adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7451/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7451/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 0E8EF9402;\n\tMon,  5 Oct 2015 19:55:39 +0200 (CEST)",
            "from mail-wi0-f175.google.com (mail-wi0-f175.google.com\n\t[209.85.212.175]) by dpdk.org (Postfix) with ESMTP id A7A1293F0\n\tfor <dev@dpdk.org>; Mon,  5 Oct 2015 19:55:37 +0200 (CEST)",
            "by wicgb1 with SMTP id gb1so130866293wic.1\n\tfor <dev@dpdk.org>; Mon, 05 Oct 2015 10:55:37 -0700 (PDT)",
            "from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by smtp.gmail.com with ESMTPSA id\n\tfr10sm15802496wib.14.2015.10.05.10.55.36\n\t(version=TLSv1.2 cipher=RC4-SHA bits=128/128);\n\tMon, 05 Oct 2015 10:55:37 -0700 (PDT)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=nc2DPhBV2ToRpDuGkb61PqdoQHbDVYLeZN9Zj5H7CSY=;\n\tb=hPRn6hfCEOPh49pahbA7FqdS1NHd5gT3Do1XfGYn649eFb2l6dKkd0FayXmlqlmvSS\n\tdoYJ0spS3viUXhI1q/2QdyTx5lgmYKyxDI9eBNERUcLIvbo5ZbhP9qGou2TEojuntnIJ\n\tyrK6jhMm7TX3GLAT8dHQ3sFJqsJDRWp5McH3PUjcwyRHP+LTFdvo8Yf616A4CvDEHBar\n\t8w+KRci26kBptS1hca+U3k8l/P4zOyYJopIE39D8r81U5Z9ugKLKOrFKA4i4wNmVg0Am\n\txhQW9GN2K7GRYp96AjxSWTa4Rxa5UsILopzhMH0BD7QUHB4m8B0mtrRJDBIM1bcDW8ZB\n\t4FBQ==",
        "X-Gm-Message-State": "ALoCoQm9ehrqjHGHv60clcblIKoI8I37cgmKdQOnfcseB169lRHiQ0BwdI6H+0rmHrH+xOH18rsV",
        "X-Received": "by 10.194.87.129 with SMTP id ay1mr30168615wjb.110.1444067737497;\n\tMon, 05 Oct 2015 10:55:37 -0700 (PDT)",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  5 Oct 2015 19:54:46 +0200",
        "Message-Id": "<1444067692-29645-12-git-send-email-adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com>",
        "References": "<1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 11/17] app/testpmd: add missing type to RSS hash\n\tcommands",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\n\nDPDK uses a structure to get or set a new hash key (see\neth_rte_rss_hash_conf).  rss_hf field from this structure is used in\nrss_hash_get_conf to retrieve the hash key and in rss_hash_update uses\nit to verify the key exists before trying to update it.\n\nSigned-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\n---\n app/test-pmd/cmdline.c                      | 45 +++++++++++++++++---\n app/test-pmd/config.c                       | 66 ++++++++++++++++++-----------\n app/test-pmd/testpmd.h                      |  6 ++-\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-\n 4 files changed, 85 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 0f8f48f..9e3b7f9 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -190,7 +190,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" by masks on port X. size is used to indicate the\"\n \t\t\t\" hardware supported reta size\\n\\n\"\n \n-\t\t\t\"show port rss-hash [key]\\n\"\n+\t\t\t\"show port rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|\"\n+\t\t\t\"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|\"\n+\t\t\t\"ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]\\n\"\n \t\t\t\"    Display the RSS hash functions and RSS hash key\"\n \t\t\t\" of port X\\n\\n\"\n \n@@ -1498,6 +1500,7 @@ struct cmd_config_rss_hash_key {\n \tcmdline_fixed_string_t config;\n \tuint8_t port_id;\n \tcmdline_fixed_string_t rss_hash_key;\n+\tcmdline_fixed_string_t rss_type;\n \tcmdline_fixed_string_t key;\n };\n \n@@ -1555,7 +1558,8 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,\n \t\t\treturn;\n \t\thash_key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);\n \t}\n-\tport_rss_hash_key_update(res->port_id, hash_key);\n+\tport_rss_hash_key_update(res->port_id, res->rss_type, hash_key,\n+\t\t\t\t RSS_HASH_KEY_LENGTH);\n }\n \n cmdline_parse_token_string_t cmd_config_rss_hash_key_port =\n@@ -1568,18 +1572,29 @@ cmdline_parse_token_num_t cmd_config_rss_hash_key_port_id =\n cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_hash_key =\n \tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key,\n \t\t\t\t rss_hash_key, \"rss-hash-key\");\n+cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, rss_type,\n+\t\t\t\t \"ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#\"\n+\t\t\t\t \"ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#\"\n+\t\t\t\t \"ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#\"\n+\t\t\t\t \"ipv6-tcp-ex#ipv6-udp-ex\");\n cmdline_parse_token_string_t cmd_config_rss_hash_key_value =\n \tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);\n \n cmdline_parse_inst_t cmd_config_rss_hash_key = {\n \t.f = cmd_config_rss_hash_key_parsed,\n \t.data = NULL,\n-\t.help_str = \"port config X rss-hash-key 80 hexa digits\",\n+\t.help_str =\n+\t\t\"port config X rss-hash-key ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|\"\n+\t\t\"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|\"\n+\t\t\"ipv6-sctp|ipv6-other|l2-payload|\"\n+\t\t\"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex 80 hexa digits\\n\",\n \t.tokens = {\n \t\t(void *)&cmd_config_rss_hash_key_port,\n \t\t(void *)&cmd_config_rss_hash_key_config,\n \t\t(void *)&cmd_config_rss_hash_key_port_id,\n \t\t(void *)&cmd_config_rss_hash_key_rss_hash_key,\n+\t\t(void *)&cmd_config_rss_hash_key_rss_type,\n \t\t(void *)&cmd_config_rss_hash_key_value,\n \t\tNULL,\n \t},\n@@ -1929,6 +1944,7 @@ struct cmd_showport_rss_hash {\n \tcmdline_fixed_string_t port;\n \tuint8_t port_id;\n \tcmdline_fixed_string_t rss_hash;\n+\tcmdline_fixed_string_t rss_type;\n \tcmdline_fixed_string_t key; /* optional argument */\n };\n \n@@ -1938,7 +1954,8 @@ static void cmd_showport_rss_hash_parsed(void *parsed_result,\n {\n \tstruct cmd_showport_rss_hash *res = parsed_result;\n \n-\tport_rss_hash_conf_show(res->port_id, show_rss_key != NULL);\n+\tport_rss_hash_conf_show(res->port_id, res->rss_type,\n+\t\t\t\tshow_rss_key != NULL);\n }\n \n cmdline_parse_token_string_t cmd_showport_rss_hash_show =\n@@ -1950,18 +1967,29 @@ cmdline_parse_token_num_t cmd_showport_rss_hash_port_id =\n cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, rss_hash,\n \t\t\t\t \"rss-hash\");\n+cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash_info =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, rss_type,\n+\t\t\t\t \"ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#\"\n+\t\t\t\t \"ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#\"\n+\t\t\t\t \"ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#\"\n+\t\t\t\t \"ipv6-tcp-ex#ipv6-udp-ex\");\n cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, \"key\");\n \n cmdline_parse_inst_t cmd_showport_rss_hash = {\n \t.f = cmd_showport_rss_hash_parsed,\n \t.data = NULL,\n-\t.help_str = \"show port X rss-hash (X = port number)\\n\",\n+\t.help_str =\n+\t\t\"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|\"\n+\t\t\"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|\"\n+\t\t\"ipv6-sctp|ipv6-other|l2-payload|\"\n+\t\t\"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex (X = port number)\\n\",\n \t.tokens = {\n \t\t(void *)&cmd_showport_rss_hash_show,\n \t\t(void *)&cmd_showport_rss_hash_port,\n \t\t(void *)&cmd_showport_rss_hash_port_id,\n \t\t(void *)&cmd_showport_rss_hash_rss_hash,\n+\t\t(void *)&cmd_showport_rss_hash_rss_hash_info,\n \t\tNULL,\n \t},\n };\n@@ -1969,12 +1997,17 @@ cmdline_parse_inst_t cmd_showport_rss_hash = {\n cmdline_parse_inst_t cmd_showport_rss_hash_key = {\n \t.f = cmd_showport_rss_hash_parsed,\n \t.data = (void *)1,\n-\t.help_str = \"show port X rss-hash key (X = port number)\\n\",\n+\t.help_str =\n+\t\t\"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|\"\n+\t\t\"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|\"\n+\t\t\"ipv6-sctp|ipv6-other|l2-payload|\"\n+\t\t\"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex key (X = port number)\\n\",\n \t.tokens = {\n \t\t(void *)&cmd_showport_rss_hash_show,\n \t\t(void *)&cmd_showport_rss_hash_port,\n \t\t(void *)&cmd_showport_rss_hash_port_id,\n \t\t(void *)&cmd_showport_rss_hash_rss_hash,\n+\t\t(void *)&cmd_showport_rss_hash_rss_hash_info,\n \t\t(void *)&cmd_showport_rss_hash_rss_key,\n \t\tNULL,\n \t},\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex cf2aa6e..f3b96a3 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -97,6 +97,30 @@\n \n static char *flowtype_to_str(uint16_t flow_type);\n \n+struct rss_type_info {\n+\tchar str[32];\n+\tuint64_t rss_type;\n+};\n+\n+static const struct rss_type_info rss_type_table[] = {\n+\t{ \"ipv4\", ETH_RSS_IPV4 },\n+\t{ \"ipv4-frag\", ETH_RSS_FRAG_IPV4 },\n+\t{ \"ipv4-tcp\", ETH_RSS_NONFRAG_IPV4_TCP },\n+\t{ \"ipv4-udp\", ETH_RSS_NONFRAG_IPV4_UDP },\n+\t{ \"ipv4-sctp\", ETH_RSS_NONFRAG_IPV4_SCTP },\n+\t{ \"ipv4-other\", ETH_RSS_NONFRAG_IPV4_OTHER },\n+\t{ \"ipv6\", ETH_RSS_IPV6 },\n+\t{ \"ipv6-frag\", ETH_RSS_FRAG_IPV6 },\n+\t{ \"ipv6-tcp\", ETH_RSS_NONFRAG_IPV6_TCP },\n+\t{ \"ipv6-udp\", ETH_RSS_NONFRAG_IPV6_UDP },\n+\t{ \"ipv6-sctp\", ETH_RSS_NONFRAG_IPV6_SCTP },\n+\t{ \"ipv6-other\", ETH_RSS_NONFRAG_IPV6_OTHER },\n+\t{ \"l2-payload\", ETH_RSS_L2_PAYLOAD },\n+\t{ \"ipv6-ex\", ETH_RSS_IPV6_EX },\n+\t{ \"ipv6-tcp-ex\", ETH_RSS_IPV6_TCP_EX },\n+\t{ \"ipv6-udp-ex\", ETH_RSS_IPV6_UDP_EX },\n+};\n+\n static void\n print_ethaddr(const char *name, struct ether_addr *eth_addr)\n {\n@@ -852,31 +876,8 @@ port_rss_reta_info(portid_t port_id,\n  * key of the port.\n  */\n void\n-port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n+port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)\n {\n-\tstruct rss_type_info {\n-\t\tchar str[32];\n-\t\tuint64_t rss_type;\n-\t};\n-\tstatic const struct rss_type_info rss_type_table[] = {\n-\t\t{\"ipv4\", ETH_RSS_IPV4},\n-\t\t{\"ipv4-frag\", ETH_RSS_FRAG_IPV4},\n-\t\t{\"ipv4-tcp\", ETH_RSS_NONFRAG_IPV4_TCP},\n-\t\t{\"ipv4-udp\", ETH_RSS_NONFRAG_IPV4_UDP},\n-\t\t{\"ipv4-sctp\", ETH_RSS_NONFRAG_IPV4_SCTP},\n-\t\t{\"ipv4-other\", ETH_RSS_NONFRAG_IPV4_OTHER},\n-\t\t{\"ipv6\", ETH_RSS_IPV6},\n-\t\t{\"ipv6-frag\", ETH_RSS_FRAG_IPV6},\n-\t\t{\"ipv6-tcp\", ETH_RSS_NONFRAG_IPV6_TCP},\n-\t\t{\"ipv6-udp\", ETH_RSS_NONFRAG_IPV6_UDP},\n-\t\t{\"ipv6-sctp\", ETH_RSS_NONFRAG_IPV6_SCTP},\n-\t\t{\"ipv6-other\", ETH_RSS_NONFRAG_IPV6_OTHER},\n-\t\t{\"l2-payload\", ETH_RSS_L2_PAYLOAD},\n-\t\t{\"ipv6-ex\", ETH_RSS_IPV6_EX},\n-\t\t{\"ipv6-tcp-ex\", ETH_RSS_IPV6_TCP_EX},\n-\t\t{\"ipv6-udp-ex\", ETH_RSS_IPV6_UDP_EX},\n-\t};\n-\n \tstruct rte_eth_rss_conf rss_conf;\n \tuint8_t rss_key[10 * 4];\n \tuint64_t rss_hf;\n@@ -885,6 +886,13 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n+\n+\trss_conf.rss_hf = 0;\n+\tfor (i = 0; i < RTE_DIM(rss_type_table); i++) {\n+\t\tif (!strcmp(rss_info, rss_type_table[i].str))\n+\t\t\trss_conf.rss_hf = rss_type_table[i].rss_type;\n+\t}\n+\n \t/* Get RSS hash key if asked to display it */\n \trss_conf.rss_key = (show_rss_key) ? rss_key : NULL;\n \tdiag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);\n@@ -922,12 +930,20 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n }\n \n void\n-port_rss_hash_key_update(portid_t port_id, uint8_t *hash_key)\n+port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,\n+\t\t\t uint hash_key_len)\n {\n \tstruct rte_eth_rss_conf rss_conf;\n \tint diag;\n+\tunsigned int i;\n \n \trss_conf.rss_key = NULL;\n+\trss_conf.rss_key_len = hash_key_len;\n+\trss_conf.rss_hf = 0;\n+\tfor (i = 0; i < RTE_DIM(rss_type_table); i++) {\n+\t\tif (!strcmp(rss_type_table[i].str, rss_type))\n+\t\t\trss_conf.rss_hf = rss_type_table[i].rss_type;\n+\t}\n \tdiag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);\n \tif (diag == 0) {\n \t\trss_conf.rss_key = hash_key;\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex d287274..31a7cb8 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -563,8 +563,10 @@ int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);\n int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,\n \t\t\t\tuint64_t q_msk);\n \n-void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);\n-void port_rss_hash_key_update(portid_t port_id, uint8_t *hash_key);\n+void port_rss_hash_conf_show(portid_t port_id, char rss_info[],\n+\t\t\t     int show_rss_key);\n+void port_rss_hash_key_update(portid_t port_id, char rss_type[],\n+\t\t\t      uint8_t *hash_key, uint hash_key_len);\n void get_syn_filter(uint8_t port_id);\n void get_ethertype_filter(uint8_t port_id, uint16_t index);\n void get_2tuple_filter(uint8_t port_id, uint16_t index);\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex aa77a91..a469b0b 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -179,7 +179,7 @@ show port rss-hash\n \n Display the RSS hash functions and RSS hash key of a port:\n \n-show port (port_id) rss-hash [key]\n+show port (port_id) rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]\n \n clear port\n ~~~~~~~~~~\n",
    "prefixes": [
        "dpdk-dev",
        "11/17"
    ]
}