get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 38904,
    "url": "https://patches.dpdk.org/api/patches/38904/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180425133816.198161-1-qi.z.zhang@intel.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": "<20180425133816.198161-1-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180425133816.198161-1-qi.z.zhang@intel.com",
    "date": "2018-04-25T13:38:16",
    "name": "[dpdk-dev,v3] app/testpmd: fix testpmd failure due to RSS offload check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "72d710a444a03be814ddf18f4ed3f771200a3520",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180425133816.198161-1-qi.z.zhang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/38904/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/38904/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D559B6CCF;\n\tWed, 25 Apr 2018 15:38:06 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 45B5A6CCE\n\tfor <dev@dpdk.org>; Wed, 25 Apr 2018 15:38:04 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Apr 2018 06:38:03 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.184])\n\tby orsmga003.jf.intel.com with ESMTP; 25 Apr 2018 06:38:02 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,326,1520924400\"; d=\"scan'208\";a=\"45952562\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "ferruh.yigit@intel.com,\n\tadrien.mazarguil@6wind.com",
        "Cc": "thomas@monjalon.net,\n\tdev@dpdk.org,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Date": "Wed, 25 Apr 2018 21:38:16 +0800",
        "Message-Id": "<20180425133816.198161-1-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180425014929.72014-1-qi.z.zhang@intel.com>",
        "References": "<20180425014929.72014-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3] app/testpmd: fix testpmd failure due to RSS\n\toffload check",
        "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://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": "<https://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": "After add RSS hash offload check, default rss_hf  will fail on\ndevices that not support all bits, the patch take rss_hf as\na suggest value and only set bits that device supported base on\nrte_eth_dev_get_info, also rss_hf will only be updated when new\nrss offload is successfully updated on all ports by\n\"port config all rss [!default]\" command.\n\nFixes: 586ac442be96 (\"ethdev: add supported hash function check\")\nFixes: 8c1f4aff92a6 (\"app/testpmd: new parameter for port config all RSS command\")\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n app/test-pmd/cmdline.c | 15 +++++++++++----\n app/test-pmd/testpmd.c |  5 ++++-\n 2 files changed, 15 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex bdc2122a0..2d05fc91e 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -2007,6 +2007,8 @@ cmd_config_rss_parsed(void *parsed_result,\n \tstruct cmd_config_rss *res = parsed_result;\n \tstruct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };\n \tstruct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };\n+\tint use_default = 0;\n+\tint all_updated = 1;\n \tint diag;\n \tuint16_t i;\n \n@@ -2032,8 +2034,10 @@ cmd_config_rss_parsed(void *parsed_result,\n \t\trss_conf.rss_hf = ETH_RSS_GENEVE;\n \telse if (!strcmp(res->value, \"nvgre\"))\n \t\trss_conf.rss_hf = ETH_RSS_NVGRE;\n-\telse if (!strcmp(res->value, \"none\") || !strcmp(res->value, \"default\"))\n+\telse if (!strcmp(res->value, \"none\"))\n \t\trss_conf.rss_hf = 0;\n+\telse if (!strcmp(res->value, \"default\"))\n+\t\tuse_default = 1;\n \telse if (isdigit(res->value[0]) && atoi(res->value) > 0 &&\n \t\t\t\t\t\tatoi(res->value) < 64)\n \t\trss_conf.rss_hf = 1ULL << atoi(res->value);\n@@ -2043,18 +2047,21 @@ cmd_config_rss_parsed(void *parsed_result,\n \t}\n \trss_conf.rss_key = NULL;\n \t/* Update global configuration for RSS types. */\n-\trss_hf = rss_conf.rss_hf;\n \tRTE_ETH_FOREACH_DEV(i) {\n-\t\tif (!strcmp(res->value, \"default\")) {\n+\t\tif (use_default) {\n \t\t\trte_eth_dev_info_get(i, &dev_info);\n \t\t\trss_conf.rss_hf = dev_info.flow_type_rss_offloads;\n \t\t}\n \t\tdiag = rte_eth_dev_rss_hash_update(i, &rss_conf);\n-\t\tif (diag < 0)\n+\t\tif (diag < 0) {\n+\t\t\tall_updated = 0;\n \t\t\tprintf(\"Configuration of RSS hash at ethernet port %d \"\n \t\t\t\t\"failed with error (%d): %s.\\n\",\n \t\t\t\ti, -diag, strerror(-diag));\n+\t\t}\n \t}\n+\tif (all_updated && !use_default)\n+\t\trss_hf = rss_conf.rss_hf;\n }\n \n cmdline_parse_token_string_t cmd_config_rss_port =\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex e757d8122..db23f23e5 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -2290,13 +2290,16 @@ init_port_config(void)\n {\n \tportid_t pid;\n \tstruct rte_port *port;\n+\tstruct rte_eth_dev_info dev_info;\n \n \tRTE_ETH_FOREACH_DEV(pid) {\n \t\tport = &ports[pid];\n \t\tport->dev_conf.fdir_conf = fdir_conf;\n \t\tif (nb_rxq > 1) {\n+\t\t\trte_eth_dev_info_get(pid, &dev_info);\n \t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;\n-\t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_hf = rss_hf;\n+\t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_hf =\n+\t\t\t\trss_hf & dev_info.flow_type_rss_offloads;\n \t\t} else {\n \t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;\n \t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;\n",
    "prefixes": [
        "dpdk-dev",
        "v3"
    ]
}