get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82749,
    "url": "http://patches.dpdk.org/api/patches/82749/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603973875-8431-4-git-send-email-oulijun@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1603973875-8431-4-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603973875-8431-4-git-send-email-oulijun@huawei.com",
    "date": "2020-10-29T12:17:50",
    "name": "[v2,3/8] net/hns3: fix RSS max queue id allowed in multi-TC case",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e96b8e900ce07725f05772a2596ca13d43dd82a3",
    "submitter": {
        "id": 1675,
        "url": "http://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1603973875-8431-4-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 13459,
            "url": "http://patches.dpdk.org/api/series/13459/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13459",
            "date": "2020-10-29T12:17:47",
            "name": "hns3 misc updates",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/13459/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/82749/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/82749/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 3EE15A04B5;\n\tThu, 29 Oct 2020 13:20:11 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 19C8DCB42;\n\tThu, 29 Oct 2020 13:17:50 +0100 (CET)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 8589ACACA\n for <dev@dpdk.org>; Thu, 29 Oct 2020 13:17:37 +0100 (CET)",
            "from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CMPb26g7wz70XY\n for <dev@dpdk.org>; Thu, 29 Oct 2020 20:17:34 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id\n 14.3.487.0; Thu, 29 Oct 2020 20:17:22 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@huawei.com>",
        "Date": "Thu, 29 Oct 2020 20:17:50 +0800",
        "Message-ID": "<1603973875-8431-4-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1603973875-8431-1-git-send-email-oulijun@huawei.com>",
        "References": "<1603970094-37384-1-git-send-email-oulijun@huawei.com>\n <1603973875-8431-1-git-send-email-oulijun@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v2 3/8] net/hns3: fix RSS max queue id allowed in\n\tmulti-TC case",
        "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": "From: Huisong Li <lihuisong@huawei.com>\n\nCurrently, driver uses the maximum number of queues configured by user\nas the maximum queue id that can be specified by the RSS rule or the\nreta_update api. It is unreasonable and may trigger an incorrect behavior\nin the multi-TC scenario. The driver must ensure that the queue id\nconfigured in the redirection table must be within the range of the number\nof queues allocated to a TC.\n\nFixes: c37ca66f2b27 (\"net/hns3: support RSS\")\nCc: stable@dpdk.org\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_flow.c | 45 ++++++++++++++++++--------------------------\n drivers/net/hns3/hns3_rss.c  | 13 ++++++-------\n 2 files changed, 24 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c\nindex 73f5e8e..0d5dd1a 100644\n--- a/drivers/net/hns3/hns3_flow.c\n+++ b/drivers/net/hns3/hns3_flow.c\n@@ -1367,13 +1367,18 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,\n \t\t\t\t\t  act, \"no valid queues\");\n \t}\n \n+\tif (rss->queue_num > RTE_DIM(rss_conf->queue))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,\n+\t\t\t\t\t  \"queue number configured exceeds \"\n+\t\t\t\t\t  \"queue buffer size driver supported\");\n+\n \tfor (n = 0; n < rss->queue_num; n++) {\n-\t\tif (rss->queue[n] < dev->data->nb_rx_queues)\n+\t\tif (rss->queue[n] < hw->alloc_rss_size)\n \t\t\tcontinue;\n \t\treturn rte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF,\n-\t\t\t\t\t  act,\n-\t\t\t\t\t  \"queue id > max number of queues\");\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,\n+\t\t\t\t\t  \"queue id must be less than queue number allocated to a TC\");\n \t}\n \n \tif (!(rss->types & HNS3_ETH_RSS_SUPPORT) && rss->types)\n@@ -1394,10 +1399,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,\n \t\t\t\t\t  \"RSS hash key must be exactly 40 bytes\");\n-\tif (rss->queue_num > RTE_DIM(rss_conf->queue))\n-\t\treturn rte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,\n-\t\t\t\t\t  \"too many queues for RSS context\");\n \n \t/*\n \t * For Kunpeng920 and Kunpeng930 NIC hardware, it is not supported to\n@@ -1450,9 +1451,8 @@ hns3_disable_rss(struct hns3_hw *hw)\n static void\n hns3_parse_rss_key(struct hns3_hw *hw, struct rte_flow_action_rss *rss_conf)\n {\n-\tif (rss_conf->key == NULL ||\n-\t    rss_conf->key_len < HNS3_RSS_KEY_SIZE) {\n-\t\thns3_info(hw, \"Default RSS hash key to be set\");\n+\tif (rss_conf->key == NULL || rss_conf->key_len < HNS3_RSS_KEY_SIZE) {\n+\t\thns3_warn(hw, \"Default RSS hash key to be set\");\n \t\trss_conf->key = hns3_hash_key;\n \t\trss_conf->key_len = HNS3_RSS_KEY_SIZE;\n \t}\n@@ -1493,10 +1493,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)\n \tstruct hns3_rss_tuple_cfg *tuple;\n \tint ret;\n \n-\t/* Parse hash key */\n \thns3_parse_rss_key(hw, rss_config);\n \n-\t/* Parse hash algorithm */\n \tret = hns3_parse_rss_algorithm(hw, &rss_config->func,\n \t\t\t\t       &hw->rss_info.hash_algo);\n \tif (ret)\n@@ -1525,20 +1523,18 @@ hns3_update_indir_table(struct rte_eth_dev *dev,\n \tstruct hns3_adapter *hns = dev->data->dev_private;\n \tstruct hns3_hw *hw = &hns->hw;\n \tuint16_t indir_tbl[HNS3_RSS_IND_TBL_SIZE];\n-\tuint16_t j, allow_rss_queues;\n+\tuint16_t j;\n \tuint32_t i;\n \n-\tallow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max);\n \t/* Fill in redirection table */\n \tmemcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,\n \t       sizeof(hw->rss_info.rss_indirection_tbl));\n \tfor (i = 0, j = 0; i < HNS3_RSS_IND_TBL_SIZE; i++, j++) {\n \t\tj %= num;\n-\t\tif (conf->queue[j] >= allow_rss_queues) {\n-\t\t\thns3_err(hw, \"Invalid queue id(%u) to be set in \"\n-\t\t\t\t     \"redirection table, max number of rss \"\n-\t\t\t\t     \"queues: %u\", conf->queue[j],\n-\t\t\t\t allow_rss_queues);\n+\t\tif (conf->queue[j] >= hw->alloc_rss_size) {\n+\t\t\thns3_err(hw, \"queue id(%u) set to redirection table \"\n+\t\t\t\t \"exceeds queue number(%u) allocated to a TC.\",\n+\t\t\t\t conf->queue[j], hw->alloc_rss_size);\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tindir_tbl[i] = conf->queue[j];\n@@ -1607,11 +1603,8 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,\n \t\treturn 0;\n \t}\n \n-\t/* Get rx queues num */\n-\tnum = dev->data->nb_rx_queues;\n-\n \t/* Set rx queues to use */\n-\tnum = RTE_MIN(num, rss_flow_conf.queue_num);\n+\tnum = RTE_MIN(dev->data->nb_rx_queues, rss_flow_conf.queue_num);\n \tif (rss_flow_conf.queue_num > num)\n \t\thns3_warn(hw, \"Config queue numbers %u are beyond the scope of truncated\",\n \t\t\t  rss_flow_conf.queue_num);\n@@ -1648,7 +1641,6 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,\n \treturn ret;\n }\n \n-/* Remove the rss filter */\n static int\n hns3_clear_rss_filter(struct rte_eth_dev *dev)\n {\n@@ -1684,7 +1676,6 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)\n \treturn ret;\n }\n \n-/* Restore the rss filter */\n int\n hns3_restore_rss_filter(struct rte_eth_dev *dev)\n {\n@@ -1706,7 +1697,6 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,\n \tstruct hns3_hw *hw = &hns->hw;\n \tbool ret;\n \n-\t/* Action rss same */\n \tret = hns3_action_rss_same(&hw->rss_info.conf, &conf->conf);\n \tif (ret) {\n \t\thns3_err(hw, \"Enter duplicate RSS configuration : %d\", ret);\n@@ -1864,6 +1854,7 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\t\tret = -ENOMEM;\n \t\t\tgoto err_fdir;\n \t\t}\n+\n \t\tmemcpy(&fdir_rule_ptr->fdir_conf, &fdir_rule,\n \t\t\tsizeof(struct hns3_fdir_rule));\n \t\tTAILQ_INSERT_TAIL(&process_list->fdir_list,\ndiff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c\nindex 2efd410..a4e552b 100644\n--- a/drivers/net/hns3/hns3_rss.c\n+++ b/drivers/net/hns3/hns3_rss.c\n@@ -510,7 +510,7 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,\n \tstruct hns3_rss_conf *rss_cfg = &hw->rss_info;\n \tuint16_t i, indir_size = HNS3_RSS_IND_TBL_SIZE; /* Table size is 512 */\n \tuint16_t indirection_tbl[HNS3_RSS_IND_TBL_SIZE];\n-\tuint16_t idx, shift, allow_rss_queues;\n+\tuint16_t idx, shift;\n \tint ret;\n \n \tif (reta_size != indir_size || reta_size > ETH_RSS_RETA_SIZE_512) {\n@@ -522,16 +522,15 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,\n \trte_spinlock_lock(&hw->lock);\n \tmemcpy(indirection_tbl, rss_cfg->rss_indirection_tbl,\n \t       sizeof(rss_cfg->rss_indirection_tbl));\n-\tallow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max);\n \tfor (i = 0; i < reta_size; i++) {\n \t\tidx = i / RTE_RETA_GROUP_SIZE;\n \t\tshift = i % RTE_RETA_GROUP_SIZE;\n-\t\tif (reta_conf[idx].reta[shift] >= allow_rss_queues) {\n+\t\tif (reta_conf[idx].reta[shift] >= hw->alloc_rss_size) {\n \t\t\trte_spinlock_unlock(&hw->lock);\n-\t\t\thns3_err(hw, \"Invalid queue id(%u) to be set in \"\n-\t\t\t\t \"redirection table, max number of rss \"\n-\t\t\t\t \"queues: %u\", reta_conf[idx].reta[shift],\n-\t\t\t\t allow_rss_queues);\n+\t\t\thns3_err(hw, \"queue id(%u) set to redirection table \"\n+\t\t\t\t \"exceeds queue number(%u) allocated to a TC\",\n+\t\t\t\t reta_conf[idx].reta[shift],\n+\t\t\t\t hw->alloc_rss_size);\n \t\t\treturn -EINVAL;\n \t\t}\n \n",
    "prefixes": [
        "v2",
        "3/8"
    ]
}