Show a patch.

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

{
    "id": 74610,
    "url": "https://patches.dpdk.org/api/patches/74610/",
    "web_url": "https://patches.dpdk.org/patch/74610/",
    "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": "<20200722081543.52396-1-shougangx.wang@intel.com>",
    "date": "2020-07-22T08:15:43",
    "name": "[v3] net/i40e: fix incorrect hash look up table",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "abaf594775868dc93c5f277b9e475202d34c8104",
    "submitter": {
        "id": 1418,
        "url": "https://patches.dpdk.org/api/people/1418/",
        "name": "Wang, ShougangX",
        "email": "shougangx.wang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74610/mbox/",
    "series": [
        {
            "id": 11231,
            "url": "https://patches.dpdk.org/api/series/11231/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11231",
            "date": "2020-07-22T08:15:43",
            "name": "[v3] net/i40e: fix incorrect hash look up table",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11231/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74610/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74610/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9689\"; a=\"151617027\"",
            "E=Sophos;i=\"5.75,381,1589266800\"; d=\"scan'208\";a=\"151617027\"",
            "E=Sophos;i=\"5.75,381,1589266800\"; d=\"scan'208\";a=\"392612463\""
        ],
        "IronPort-SDR": [
            "\n ahUQk9XwAAimMGoy7YvO/G8xgMQf+8p08LVOPq8+DSmoADWSubKZhCYYrK6wDk93927iPafiAe\n fW+QhCkdOs2Q==",
            "\n t0bBl+MFx1wdzNWq/mGTboDLX8ScWL2WSgZpqn1iMYgseL0o4iushI9DG2veJUuiHHgBdS+C/0\n pd/8Ows5T3vQ=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200715063515.9262-1-shougangx.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3] net/i40e: fix incorrect hash look up table",
        "Sender": "\"dev\" <dev-bounces@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 1C447A0526;\n\tWed, 22 Jul 2020 10:33:31 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 96CB71BFD4;\n\tWed, 22 Jul 2020 10:33:29 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by dpdk.org (Postfix) with ESMTP id 24BAB1BFD1;\n Wed, 22 Jul 2020 10:33:26 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Jul 2020 01:33:25 -0700",
            "from intel.sh.intel.com ([10.239.255.20])\n by fmsmga001.fm.intel.com with ESMTP; 22 Jul 2020 01:33:23 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed, 22 Jul 2020 08:15:43 +0000",
        "To": "dev@dpdk.org",
        "From": "Shougang Wang <shougangx.wang@intel.com>",
        "In-Reply-To": "<20200715063515.9262-1-shougangx.wang@intel.com>",
        "Cc": "beilei.xing@intel.com, jia.guo@intel.com,\n Shougang Wang <shougangx.wang@intel.com>, stable@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200722081543.52396-1-shougangx.wang@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The hash look up table (LUT) is managed by global register but it is not\ninitialized when RSS is disabled. Once user wants to enable RSS during\nruntime, the LUT will not be initialized.\nThis patch fixes the issue by initializing the LUT whether RSS enabled\nor not.\n\nFixes: feaae285b342 (\"net/i40e: support hash configuration in RSS flow\")\nCc: stable@dpdk.org\n\nSigned-off-by: Shougang Wang <shougangx.wang@intel.com>\n---\nv3:\n-Updated the time of initializing the look up table\n---\n drivers/net/i40e/i40e_ethdev.c | 85 ++++++++++++++++++++--------------\n 1 file changed, 49 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 05d5f2861..e35590d96 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -8984,42 +8984,7 @@ i40e_pf_calc_configured_queues_num(struct i40e_pf *pf)\n static int\n i40e_pf_config_rss(struct i40e_pf *pf)\n {\n-\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n \tstruct rte_eth_rss_conf rss_conf;\n-\tuint32_t i, lut = 0;\n-\tuint16_t j, num;\n-\n-\t/*\n-\t * If both VMDQ and RSS enabled, not all of PF queues are configured.\n-\t * It's necessary to calculate the actual PF queues that are configured.\n-\t */\n-\tif (pf->dev_data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG)\n-\t\tnum = i40e_pf_calc_configured_queues_num(pf);\n-\telse\n-\t\tnum = pf->dev_data->nb_rx_queues;\n-\n-\tnum = RTE_MIN(num, I40E_MAX_Q_PER_TC);\n-\tPMD_INIT_LOG(INFO, \"Max of contiguous %u PF queues are configured\",\n-\t\t\tnum);\n-\n-\tif (num == 0) {\n-\t\tPMD_INIT_LOG(ERR,\n-\t\t\t\"No PF queues are configured to enable RSS for port %u\",\n-\t\t\tpf->dev_data->port_id);\n-\t\treturn -ENOTSUP;\n-\t}\n-\n-\tif (pf->adapter->rss_reta_updated == 0) {\n-\t\tfor (i = 0, j = 0; i < hw->func_caps.rss_table_size; i++, j++) {\n-\t\t\tif (j == num)\n-\t\t\t\tj = 0;\n-\t\t\tlut = (lut << 8) | (j & ((0x1 <<\n-\t\t\t\thw->func_caps.rss_table_entry_width) - 1));\n-\t\t\tif ((i & 3) == 3)\n-\t\t\t\tI40E_WRITE_REG(hw, I40E_PFQF_HLUT(i >> 2),\n-\t\t\t\t\t       rte_bswap32(lut));\n-\t\t}\n-\t}\n \n \trss_conf = pf->dev_data->dev_conf.rx_adv_conf.rss_conf;\n \tif ((rss_conf.rss_hf & pf->adapter->flow_types_mask) == 0) {\n@@ -9195,12 +9160,60 @@ i40e_tunnel_filter_handle(struct rte_eth_dev *dev,\n \treturn ret;\n }\n \n+/* Initialize the hash look up table */\n+static int\n+i40e_pf_init_rss_lut(struct i40e_pf *pf)\n+{\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n+\tuint32_t lut = 0;\n+\tuint16_t j, num;\n+\tuint32_t i;\n+\n+\t/* If both VMDQ and RSS enabled, not all of PF queues are configured.\n+\t * It's necessary to calculate the actual PF queues that are configured.\n+\t */\n+\tif (pf->dev_data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG)\n+\t\tnum = i40e_pf_calc_configured_queues_num(pf);\n+\telse\n+\t\tnum = pf->dev_data->nb_rx_queues;\n+\n+\tnum = RTE_MIN(num, I40E_MAX_Q_PER_TC);\n+\tPMD_INIT_LOG(INFO, \"Max of contiguous %u PF queues are configured\",\n+\t\t     num);\n+\n+\tif (num == 0) {\n+\t\tPMD_INIT_LOG(ERR,\n+\t\t\t\"No PF queues are configured to enable RSS for port %u\",\n+\t\t\tpf->dev_data->port_id);\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (pf->adapter->rss_reta_updated == 0) {\n+\t\tfor (i = 0, j = 0; i < hw->func_caps.rss_table_size; i++, j++) {\n+\t\t\tif (j == num)\n+\t\t\t\tj = 0;\n+\t\t\tlut = (lut << 8) | (j & ((0x1 <<\n+\t\t\t\thw->func_caps.rss_table_entry_width) - 1));\n+\t\t\tif ((i & 3) == 3)\n+\t\t\t\tI40E_WRITE_REG(hw, I40E_PFQF_HLUT(i >> 2),\n+\t\t\t\t\t       rte_bswap32(lut));\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n i40e_pf_config_mq_rx(struct i40e_pf *pf)\n {\n-\tint ret = 0;\n+\tint ret;\n \tenum rte_eth_rx_mq_mode mq_mode = pf->dev_data->dev_conf.rxmode.mq_mode;\n \n+\t/* Initialize hash look up table */\n+\tret = i40e_pf_init_rss_lut(pf);\n+\tif (ret)\n+\t\treturn ret;\n+\n \t/* RSS setup */\n \tif (mq_mode & ETH_MQ_RX_RSS_FLAG)\n \t\tret = i40e_pf_config_rss(pf);\n",
    "prefixes": [
        "v3"
    ]
}