get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78324,
    "url": "http://patchwork.dpdk.org/api/patches/78324/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200922085401.12272-16-huwei013@chinasoftinc.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200922085401.12272-16-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200922085401.12272-16-huwei013@chinasoftinc.com",
    "date": "2020-09-22T08:53:59",
    "name": "[15/17] net/hns3: fix flushing RSS rule",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e6f3fea4b328e41412b310019043782a760108b8",
    "submitter": {
        "id": 1537,
        "url": "http://patchwork.dpdk.org/api/people/1537/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "huwei013@chinasoftinc.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200922085401.12272-16-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 12401,
            "url": "http://patchwork.dpdk.org/api/series/12401/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12401",
            "date": "2020-09-22T08:53:46",
            "name": "updates for hns3 PMD driver",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/12401/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/78324/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/78324/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 F32E0A04E1;\n\tTue, 22 Sep 2020 11:04:49 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AF14C1DCA5;\n\tTue, 22 Sep 2020 10:55:29 +0200 (CEST)",
            "from incedge.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id F1DFF1DAF8\n for <dev@dpdk.org>; Tue, 22 Sep 2020 10:54:59 +0200 (CEST)",
            "from mail.chinasoftinc.com ([10.168.0.51]) by\n incedge.chinasoftinc.com with ESMTP id AAqqCdgA1LHgM1MX (version=TLSv1\n cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);\n Tue, 22 Sep 2020 16:54:59 +0800 (CST)",
            "from localhost.localdomain (120.133.139.157) by INCCAS001.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020\n 16:54:58 +0800"
        ],
        "X-ASG-Debug-ID": "1600764899-149d111baf19b090001-TfluYd",
        "X-Barracuda-Envelope-From": "huwei013@chinasoftinc.com",
        "X-Barracuda-RBL-Trusted-Forwarder": [
            "10.168.0.51",
            "10.168.0.60"
        ],
        "X-ASG-Whitelist": "Client",
        "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Tue, 22 Sep 2020 16:53:59 +0800",
        "X-ASG-Orig-Subj": "[PATCH 15/17] net/hns3: fix flushing RSS rule",
        "Message-ID": "<20200922085401.12272-16-huwei013@chinasoftinc.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20200922085401.12272-1-huwei013@chinasoftinc.com>",
        "References": "<20200922085401.12272-1-huwei013@chinasoftinc.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[120.133.139.157]",
        "X-Barracuda-Connect": "UNKNOWN[10.168.0.51]",
        "X-Barracuda-Start-Time": "1600764899",
        "X-Barracuda-Encrypted": "ECDHE-RSA-AES256-SHA",
        "X-Barracuda-URL": "https://incspam.chinasofti.com:443/cgi-mod/mark.cgi",
        "X-Virus-Scanned": "by bsmtpd at chinasoftinc.com",
        "X-Barracuda-Scan-Msg-Size": "5958",
        "Subject": "[dpdk-dev] [PATCH 15/17] net/hns3: fix flushing RSS rule",
        "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: Lijun Ou <oulijun@huawei.com>\n\nWhen user create a flow without RSS by calling rte_flow_create API and then\ndestroy it by calling rte_flow_flush API, driver should not clear RSS rule.\n\nA reasonable handling method is that when user creates an RSS rule, the\ndriver should clear the created RSS rule when flushing destroy all flow\nrules. Also, hw->rss_info should save the RSS config of the last success\nRSS rule. When create n RSS rules, the RSS should not be disabled before\nthe last RSS rule detroyed.\n\nFixes: c37ca66f2b27 (\"net/hns3: support RSS\")\nCc: stable@dpdk.org\n\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_flow.c | 79 ++++++++++++++++++++++++++++++++------------\n drivers/net/hns3/hns3_rss.h  |  1 +\n 2 files changed, 58 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c\nindex 5b5124c..4f078e8 100644\n--- a/drivers/net/hns3/hns3_flow.c\n+++ b/drivers/net/hns3/hns3_flow.c\n@@ -1560,7 +1560,9 @@ static int\n hns3_config_rss_filter(struct rte_eth_dev *dev,\n \t\t       const struct hns3_rss_conf *conf, bool add)\n {\n+\tstruct hns3_process_private *process_list = dev->process_private;\n \tstruct hns3_adapter *hns = dev->data->dev_private;\n+\tstruct hns3_rss_conf_ele *rss_filter_ptr;\n \tstruct hns3_hw *hw = &hns->hw;\n \tstruct hns3_rss_conf *rss_info;\n \tuint64_t flow_types;\n@@ -1591,28 +1593,27 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,\n \n \trss_info = &hw->rss_info;\n \tif (!add) {\n-\t\tif (hns3_action_rss_same(&rss_info->conf, &rss_flow_conf)) {\n-\t\t\tret = hns3_disable_rss(hw);\n-\t\t\tif (ret) {\n-\t\t\t\thns3_err(hw, \"RSS disable failed(%d)\", ret);\n-\t\t\t\treturn ret;\n-\t\t\t}\n+\t\tif (!conf->valid)\n+\t\t\treturn 0;\n \n-\t\t\tif (rss_flow_conf.queue_num) {\n-\t\t\t\t/*\n-\t\t\t\t * Due the content of queue pointer have been\n-\t\t\t\t * reset to 0, the rss_info->conf.queue should\n-\t\t\t\t * be set NULL.\n-\t\t\t\t */\n-\t\t\t\trss_info->conf.queue = NULL;\n-\t\t\t\trss_info->conf.queue_num = 0;\n-\t\t\t}\n+\t\tret = hns3_disable_rss(hw);\n+\t\tif (ret) {\n+\t\t\thns3_err(hw, \"RSS disable failed(%d)\", ret);\n+\t\t\treturn ret;\n+\t\t}\n \n-\t\t\t/* set RSS func invalid after flushed */\n-\t\t\trss_info->conf.func = RTE_ETH_HASH_FUNCTION_MAX;\n-\t\t\treturn 0;\n+\t\tif (rss_flow_conf.queue_num) {\n+\t\t\t/*\n+\t\t\t * Due the content of queue pointer have been reset to\n+\t\t\t * 0, the rss_info->conf.queue should be set NULL\n+\t\t\t */\n+\t\t\trss_info->conf.queue = NULL;\n+\t\t\trss_info->conf.queue_num = 0;\n \t\t}\n-\t\treturn -EINVAL;\n+\n+\t\t/* set RSS func invalid after flushed */\n+\t\trss_info->conf.func = RTE_ETH_HASH_FUNCTION_MAX;\n+\t\treturn 0;\n \t}\n \n \t/* Get rx queues num */\n@@ -1643,6 +1644,13 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,\n \t\tgoto rss_config_err;\n \t}\n \n+\t/*\n+\t * When create a new RSS rule, the old rule will be overlayed and set\n+\t * invalid.\n+\t */\n+\tTAILQ_FOREACH(rss_filter_ptr, &process_list->filter_rss_list, entries)\n+\t\trss_filter_ptr->filter_info.valid = false;\n+\n rss_config_err:\n \trte_spinlock_unlock(&hw->lock);\n \n@@ -1653,10 +1661,36 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,\n static int\n hns3_clear_rss_filter(struct rte_eth_dev *dev)\n {\n+\tstruct hns3_process_private *process_list = dev->process_private;\n \tstruct hns3_adapter *hns = dev->data->dev_private;\n+\tstruct hns3_rss_conf_ele *rss_filter_ptr;\n \tstruct hns3_hw *hw = &hns->hw;\n+\tint rss_rule_succ_cnt = 0; /* count for success of clearing RSS rules */\n+\tint rss_rule_fail_cnt = 0; /* count for failure of clearing RSS rules */\n+\tint ret = 0;\n+\n+\trss_filter_ptr = TAILQ_FIRST(&process_list->filter_rss_list);\n+\twhile (rss_filter_ptr) {\n+\t\tTAILQ_REMOVE(&process_list->filter_rss_list, rss_filter_ptr,\n+\t\t\t     entries);\n+\t\tret = hns3_config_rss_filter(dev, &rss_filter_ptr->filter_info,\n+\t\t\t\t\t     false);\n+\t\tif (ret)\n+\t\t\trss_rule_fail_cnt++;\n+\t\telse\n+\t\t\trss_rule_succ_cnt++;\n+\t\trte_free(rss_filter_ptr);\n+\t\trss_filter_ptr = TAILQ_FIRST(&process_list->filter_rss_list);\n+\t}\n \n-\treturn hns3_config_rss_filter(dev, &hw->rss_info, false);\n+\tif (rss_rule_fail_cnt) {\n+\t\thns3_err(hw, \"fail to delete all RSS filters, success num = %d \"\n+\t\t\t     \"fail num = %d\", rss_rule_succ_cnt,\n+\t\t\t     rss_rule_fail_cnt);\n+\t\tret = -EIO;\n+\t}\n+\n+\treturn ret;\n }\n \n /* Restore the rss filter */\n@@ -1807,6 +1841,7 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\t}\n \t\tmemcpy(&rss_filter_ptr->filter_info, rss_conf,\n \t\t\tsizeof(struct hns3_rss_conf));\n+\t\trss_filter_ptr->filter_info.valid = true;\n \t\tTAILQ_INSERT_TAIL(&process_list->filter_rss_list,\n \t\t\t\t  rss_filter_ptr, entries);\n \n@@ -1872,7 +1907,6 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,\n \tstruct hns3_fdir_rule_ele *fdir_rule_ptr;\n \tstruct hns3_rss_conf_ele *rss_filter_ptr;\n \tstruct hns3_flow_mem *flow_node;\n-\tstruct hns3_hw *hw = &hns->hw;\n \tenum rte_filter_type filter_type;\n \tstruct hns3_fdir_rule fdir_rule;\n \tint ret;\n@@ -1902,7 +1936,8 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,\n \t\tbreak;\n \tcase RTE_ETH_FILTER_HASH:\n \t\trss_filter_ptr = (struct hns3_rss_conf_ele *)flow->rule;\n-\t\tret = hns3_config_rss_filter(dev, &hw->rss_info, false);\n+\t\tret = hns3_config_rss_filter(dev, &rss_filter_ptr->filter_info,\n+\t\t\t\t\t     false);\n \t\tif (ret)\n \t\t\treturn rte_flow_error_set(error, EIO,\n \t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_HANDLE,\ndiff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h\nindex 47d3586..8fa1b30 100644\n--- a/drivers/net/hns3/hns3_rss.h\n+++ b/drivers/net/hns3/hns3_rss.h\n@@ -47,6 +47,7 @@ struct hns3_rss_conf {\n \tstruct hns3_rss_tuple_cfg rss_tuple_sets;\n \tuint8_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE]; /* Shadow table */\n \tuint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */\n+\tbool valid; /* check if RSS rule is valid */\n };\n \n #ifndef ilog2\n",
    "prefixes": [
        "15/17"
    ]
}