get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78322,
    "url": "http://patches.dpdk.org/api/patches/78322/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200922085401.12272-10-huwei013@chinasoftinc.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": "<20200922085401.12272-10-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200922085401.12272-10-huwei013@chinasoftinc.com",
    "date": "2020-09-22T08:53:53",
    "name": "[09/17] net/hns3: support flow action of queue region",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0f1a9f9d0560e2055bbe4f33bf64b8f17e6f0c72",
    "submitter": {
        "id": 1537,
        "url": "http://patches.dpdk.org/api/people/1537/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "huwei013@chinasoftinc.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/20200922085401.12272-10-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 12401,
            "url": "http://patches.dpdk.org/api/series/12401/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12401",
            "date": "2020-09-22T08:53:46",
            "name": "updates for hns3 PMD driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12401/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/78322/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/78322/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 68742A04E1;\n\tTue, 22 Sep 2020 11:04:22 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3007D1DC88;\n\tTue, 22 Sep 2020 10:55:26 +0200 (CEST)",
            "from incedge.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 35C581DB1E\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 FZKYHQod2AXF5vvL (version=TLSv1\n cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);\n Tue, 22 Sep 2020 16:54:56 +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:55 +0800"
        ],
        "X-ASG-Debug-ID": "1600764896-149d111baf19b050001-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:53 +0800",
        "X-ASG-Orig-Subj": "[PATCH 09/17] net/hns3: support flow action of queue region",
        "Message-ID": "<20200922085401.12272-10-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": "1600764896",
        "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": "14523",
        "Subject": "[dpdk-dev] [PATCH 09/17] net/hns3: support flow action of queue\n\tregion",
        "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: Chengwen Feng <fengchengwen@huawei.com>\n\nKunpeng 930 hardware support spread packets to region of queues which can\nbe configured by FDIR rule, it means user can create one FDIR rule which\naction is one region of queues, and then RSS use the region info to spread\npackets.\n\nAs we know, RTE_FLOW_ACTION_TYPE_RSS is used to spread packets among\nseveral queues, user could config such as func/level/types/key/queue\nparameter to control RSS function, so we provide this feature under the\nRTE_FLOW_ACTION_TYPE_RSS framework.\n\nConsider RSS input tuple don't have eth header, we use the following\nrule to distinguish them (whether it's queue region configuration or\nrss general configuration):\nCase 1: pattern have ETH and action's queue_num > 0, indicate it is\nqueue region configuration.\nCase other: rss general configuration.\n\nSo if user want to configure one flow which ipv4=192.168.1.192 spread to\nqueue region of queue 0/1/2/3, the patter should:\n  RTE_FLOW_ITEM_TYPE_ETH with spec=last=mask=NULL\n  RTE_FLOW_ITEM_TYPE_IPV4 with spec=192.168.1.192 last=mask=NULL\n  RTE_FLOW_ITEM_TYPE_END\nthe action should:\n  RTE_FLOW_ACTION_TYPE_RSS with queue_num=4 queue=0/1/2/3\n  RTE_FLOW_ACTION_TYPE_END\nafter calling rte_flow_create, one FDIR rule will be created.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_cmd.c    |   5 +-\n drivers/net/hns3/hns3_cmd.h    |   2 +-\n drivers/net/hns3/hns3_ethdev.h |   8 +--\n drivers/net/hns3/hns3_fdir.c   |  35 +++++++-----\n drivers/net/hns3/hns3_fdir.h   |  23 +++++++-\n drivers/net/hns3/hns3_flow.c   | 117 +++++++++++++++++++++++++++++++++++++----\n 6 files changed, 158 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c\nindex 0299072..f7cfa00 100644\n--- a/drivers/net/hns3/hns3_cmd.c\n+++ b/drivers/net/hns3/hns3_cmd.c\n@@ -433,8 +433,9 @@ static void hns3_parse_capability(struct hns3_hw *hw,\n \n \tif (hns3_get_bit(caps, HNS3_CAPS_UDP_GSO_B))\n \t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_UDP_GSO_B, 1);\n-\tif (hns3_get_bit(caps, HNS3_CAPS_ADQ_B))\n-\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_ADQ_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_FD_QUEUE_REGION_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_FD_QUEUE_REGION_B,\n+\t\t\t     1);\n \tif (hns3_get_bit(caps, HNS3_CAPS_PTP_B))\n \t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_PTP_B, 1);\n \tif (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B))\ndiff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex 629b114..510d68c 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -278,7 +278,7 @@ struct hns3_rx_priv_buff_cmd {\n enum HNS3_CAPS_BITS {\n \tHNS3_CAPS_UDP_GSO_B,\n \tHNS3_CAPS_ATR_B,\n-\tHNS3_CAPS_ADQ_B,\n+\tHNS3_CAPS_FD_QUEUE_REGION_B,\n \tHNS3_CAPS_PTP_B,\n \tHNS3_CAPS_INT_QL_B,\n \tHNS3_CAPS_SIMPLE_BD_B,\ndiff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h\nindex 3f3f973..e1ed4d6 100644\n--- a/drivers/net/hns3/hns3_ethdev.h\n+++ b/drivers/net/hns3/hns3_ethdev.h\n@@ -719,7 +719,7 @@ struct hns3_adapter {\n #define HNS3_DEV_SUPPORT_DCB_B\t\t\t0x0\n #define HNS3_DEV_SUPPORT_COPPER_B\t\t0x1\n #define HNS3_DEV_SUPPORT_UDP_GSO_B\t\t0x2\n-#define HNS3_DEV_SUPPORT_ADQ_B\t\t\t0x3\n+#define HNS3_DEV_SUPPORT_FD_QUEUE_REGION_B\t0x3\n #define HNS3_DEV_SUPPORT_PTP_B\t\t\t0x4\n #define HNS3_DEV_SUPPORT_TX_PUSH_B\t\t0x5\n #define HNS3_DEV_SUPPORT_INDEP_TXRX_B\t\t0x6\n@@ -736,9 +736,9 @@ struct hns3_adapter {\n #define hns3_dev_udp_gso_supported(hw) \\\n \thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_UDP_GSO_B)\n \n-/* Support Application Device Queue */\n-#define hns3_dev_adq_supported(hw) \\\n-\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_ADQ_B)\n+/* Support the queue region action rule of flow directory */\n+#define hns3_dev_fd_queue_region_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_FD_QUEUE_REGION_B)\n \n /* Support PTP timestamp offload */\n #define hns3_dev_ptp_supported(hw) \\\ndiff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c\nindex 5729923..bf698f3 100644\n--- a/drivers/net/hns3/hns3_fdir.c\n+++ b/drivers/net/hns3/hns3_fdir.c\n@@ -29,20 +29,23 @@\n \n #define HNS3_FD_AD_DATA_S\t\t32\n #define HNS3_FD_AD_DROP_B\t\t0\n-#define HNS3_FD_AD_DIRECT_QID_B\t1\n+#define HNS3_FD_AD_DIRECT_QID_B\t\t1\n #define HNS3_FD_AD_QID_S\t\t2\n-#define HNS3_FD_AD_QID_M\t\tGENMASK(12, 2)\n+#define HNS3_FD_AD_QID_M\t\tGENMASK(11, 2)\n #define HNS3_FD_AD_USE_COUNTER_B\t12\n #define HNS3_FD_AD_COUNTER_NUM_S\t13\n-#define HNS3_FD_AD_COUNTER_NUM_M\tGENMASK(20, 13)\n+#define HNS3_FD_AD_COUNTER_NUM_M\tGENMASK(19, 13)\n #define HNS3_FD_AD_NXT_STEP_B\t\t20\n #define HNS3_FD_AD_NXT_KEY_S\t\t21\n-#define HNS3_FD_AD_NXT_KEY_M\t\tGENMASK(26, 21)\n-#define HNS3_FD_AD_WR_RULE_ID_B\t0\n+#define HNS3_FD_AD_NXT_KEY_M\t\tGENMASK(25, 21)\n+#define HNS3_FD_AD_WR_RULE_ID_B\t\t0\n #define HNS3_FD_AD_RULE_ID_S\t\t1\n-#define HNS3_FD_AD_RULE_ID_M\t\tGENMASK(13, 1)\n-#define HNS3_FD_AD_COUNTER_HIGH_BIT     7\n-#define HNS3_FD_AD_COUNTER_HIGH_BIT_B   26\n+#define HNS3_FD_AD_RULE_ID_M\t\tGENMASK(12, 1)\n+#define HNS3_FD_AD_QUE_REGION_EN_B\t16\n+#define HNS3_FD_AD_QUE_REGION_SIZE_S\t17\n+#define HNS3_FD_AD_QUE_REGION_SIZE_M\tGENMASK(20, 17)\n+#define HNS3_FD_AD_COUNTER_HIGH_BIT\t7\n+#define HNS3_FD_AD_COUNTER_HIGH_BIT_B\t26\n \n enum HNS3_PORT_TYPE {\n \tHOST_PORT,\n@@ -426,13 +429,19 @@ static int hns3_fd_ad_config(struct hns3_hw *hw, int loc,\n \t\t     action->write_rule_id_to_bd);\n \thns3_set_field(ad_data, HNS3_FD_AD_RULE_ID_M, HNS3_FD_AD_RULE_ID_S,\n \t\t       action->rule_id);\n+\tif (action->nb_queues > 1) {\n+\t\thns3_set_bit(ad_data, HNS3_FD_AD_QUE_REGION_EN_B, 1);\n+\t\thns3_set_field(ad_data, HNS3_FD_AD_QUE_REGION_SIZE_M,\n+\t\t\t       HNS3_FD_AD_QUE_REGION_SIZE_S,\n+\t\t\t       rte_log2_u32(action->nb_queues));\n+\t}\n \t/* set extend bit if counter_id is in [128 ~ 255] */\n \tif (action->counter_id & BIT(HNS3_FD_AD_COUNTER_HIGH_BIT))\n \t\thns3_set_bit(ad_data, HNS3_FD_AD_COUNTER_HIGH_BIT_B, 1);\n \tad_data <<= HNS3_FD_AD_DATA_S;\n \thns3_set_bit(ad_data, HNS3_FD_AD_DROP_B, action->drop_packet);\n-\thns3_set_bit(ad_data, HNS3_FD_AD_DIRECT_QID_B,\n-\t\t     action->forward_to_direct_queue);\n+\tif (action->nb_queues == 1)\n+\t\thns3_set_bit(ad_data, HNS3_FD_AD_DIRECT_QID_B, 1);\n \thns3_set_field(ad_data, HNS3_FD_AD_QID_M, HNS3_FD_AD_QID_S,\n \t\t       action->queue_id);\n \thns3_set_bit(ad_data, HNS3_FD_AD_USE_COUNTER_B, action->use_counter);\n@@ -440,7 +449,7 @@ static int hns3_fd_ad_config(struct hns3_hw *hw, int loc,\n \t\t       HNS3_FD_AD_COUNTER_NUM_S, action->counter_id);\n \thns3_set_bit(ad_data, HNS3_FD_AD_NXT_STEP_B, action->use_next_stage);\n \thns3_set_field(ad_data, HNS3_FD_AD_NXT_KEY_M, HNS3_FD_AD_NXT_KEY_S,\n-\t\t       action->counter_id);\n+\t\t       action->next_input_key);\n \n \treq->ad_data = rte_cpu_to_le_64(ad_data);\n \tret = hns3_cmd_send(hw, &desc, 1);\n@@ -752,12 +761,12 @@ static int hns3_config_action(struct hns3_hw *hw, struct hns3_fdir_rule *rule)\n \n \tif (rule->action == HNS3_FD_ACTION_DROP_PACKET) {\n \t\tad_data.drop_packet = true;\n-\t\tad_data.forward_to_direct_queue = false;\n \t\tad_data.queue_id = 0;\n+\t\tad_data.nb_queues = 0;\n \t} else {\n \t\tad_data.drop_packet = false;\n-\t\tad_data.forward_to_direct_queue = true;\n \t\tad_data.queue_id = rule->queue_id;\n+\t\tad_data.nb_queues = rule->nb_queues;\n \t}\n \n \tif (unlikely(rule->flags & HNS3_RULE_FLAG_COUNTER)) {\ndiff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h\nindex f7b4216..a5760a3 100644\n--- a/drivers/net/hns3/hns3_fdir.h\n+++ b/drivers/net/hns3/hns3_fdir.h\n@@ -104,8 +104,18 @@ struct hns3_fd_rule_tuples {\n struct hns3_fd_ad_data {\n \tuint16_t ad_id;\n \tuint8_t drop_packet;\n-\tuint8_t forward_to_direct_queue;\n+\t/*\n+\t * equal 0 when action is drop.\n+\t * index of queue when action is queue.\n+\t * index of first queue of queue region when action is queue region.\n+\t */\n \tuint16_t queue_id;\n+\t/*\n+\t * equal 0 when action is drop.\n+\t * equal 1 when action is queue.\n+\t * numbers of queues of queue region when action is queue region.\n+\t */\n+\tuint16_t nb_queues;\n \tuint8_t use_counter;\n \tuint8_t counter_id;\n \tuint8_t use_next_stage;\n@@ -141,7 +151,18 @@ struct hns3_fdir_rule {\n \tuint8_t action;\n \t/* VF id, avaiblable when flags with HNS3_RULE_FLAG_VF_ID. */\n \tuint8_t vf_id;\n+\t/*\n+\t * equal 0 when action is drop.\n+\t * index of queue when action is queue.\n+\t * index of first queue of queue region when action is queue region.\n+\t */\n \tuint16_t queue_id;\n+\t/*\n+\t * equal 0 when action is drop.\n+\t * equal 1 when action is queue.\n+\t * numbers of queues of queue region when action is queue region.\n+\t */\n+\tuint16_t nb_queues;\n \tuint16_t location;\n \tstruct rte_flow_action_count act_cnt;\n };\ndiff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c\nindex 7ec46ae..1bc5911 100644\n--- a/drivers/net/hns3/hns3_flow.c\n+++ b/drivers/net/hns3/hns3_flow.c\n@@ -90,16 +90,56 @@ net_addr_to_host(uint32_t *dst, const rte_be32_t *src, size_t len)\n \t\tdst[i] = rte_be_to_cpu_32(src[i]);\n }\n \n-static inline const struct rte_flow_action *\n-find_rss_action(const struct rte_flow_action actions[])\n+/*\n+ * This function is used to find rss general action.\n+ * 1. As we know RSS is used to spread packets among several queues, the flow\n+ *    API provide the struct rte_flow_action_rss, user could config it's field\n+ *    sush as: func/level/types/key/queue to control RSS function.\n+ * 2. The flow API also support queue region configuration for hns3. It was\n+ *    implemented by FDIR + RSS in hns3 hardware, user can create one FDIR rule\n+ *    which action is RSS queues region.\n+ * 3. When action is RSS, we use the following rule to distinguish:\n+ *    Case 1: pattern have ETH and action's queue_num > 0, indicate it is queue\n+ *            region configuration.\n+ *    Case other: an rss general action.\n+ */\n+static const struct rte_flow_action *\n+hns3_find_rss_general_action(const struct rte_flow_item pattern[],\n+\t\t\t     const struct rte_flow_action actions[])\n {\n-\tconst struct rte_flow_action *next = &actions[0];\n+\tconst struct rte_flow_action *act = NULL;\n+\tconst struct hns3_rss_conf *rss;\n+\tbool have_eth = false;\n \n-\tfor (; next->type != RTE_FLOW_ACTION_TYPE_END; next++) {\n-\t\tif (next->type == RTE_FLOW_ACTION_TYPE_RSS)\n-\t\t\treturn next;\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tif (actions->type == RTE_FLOW_ACTION_TYPE_RSS) {\n+\t\t\tact = actions;\n+\t\t\tbreak;\n+\t\t}\n \t}\n-\treturn NULL;\n+\tif (!act)\n+\t\treturn NULL;\n+\n+\tfor (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) {\n+\t\tif (pattern->type == RTE_FLOW_ITEM_TYPE_ETH) {\n+\t\t\thave_eth = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\trss = act->conf;\n+\tif (have_eth && rss->conf.queue_num) {\n+\t\t/*\n+\t\t * Patter have ETH and action's queue_num > 0, indicate this is\n+\t\t * queue region configuration.\n+\t\t * Because queue region is implemented by FDIR + RSS in hns3\n+\t\t * hardware, it need enter FDIR process, so here return NULL to\n+\t\t * avoid enter RSS process.\n+\t\t */\n+\t\treturn NULL;\n+\t}\n+\n+\treturn act;\n }\n \n static inline struct hns3_flow_counter *\n@@ -233,11 +273,53 @@ hns3_handle_action_queue(struct rte_eth_dev *dev,\n \t\t\t  \"available queue (%d) in driver.\",\n \t\t\t  queue->index, hw->used_rx_queues);\n \t\treturn rte_flow_error_set(error, EINVAL,\n-\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, action,\n-\t\t\t\t\t  \"Invalid queue ID in PF\");\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF,\n+\t\t\t\t\t  action, \"Invalid queue ID in PF\");\n \t}\n \n \trule->queue_id = queue->index;\n+\trule->nb_queues = 1;\n+\trule->action = HNS3_FD_ACTION_ACCEPT_PACKET;\n+\treturn 0;\n+}\n+\n+static int\n+hns3_handle_action_queue_region(struct rte_eth_dev *dev,\n+\t\t\t\tconst struct rte_flow_action *action,\n+\t\t\t\tstruct hns3_fdir_rule *rule,\n+\t\t\t\tstruct rte_flow_error *error)\n+{\n+\tstruct hns3_adapter *hns = dev->data->dev_private;\n+\tconst struct rte_flow_action_rss *conf = action->conf;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\tuint16_t idx;\n+\n+\tif (!hns3_dev_fd_queue_region_supported(hw))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\"Not support config queue region!\");\n+\n+\tif ((!rte_is_power_of_2(conf->queue_num)) ||\n+\t\tconf->queue_num > hw->rss_size_max ||\n+\t\tconf->queue[0] >= hw->used_rx_queues ||\n+\t\tconf->queue[0] + conf->queue_num > hw->used_rx_queues) {\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ACTION_CONF, action,\n+\t\t\t\"Invalid start queue ID and queue num! the start queue \"\n+\t\t\t\"ID must valid, the queue num must be power of 2 and \"\n+\t\t\t\"<= rss_size_max.\");\n+\t}\n+\n+\tfor (idx = 1; idx < conf->queue_num; idx++) {\n+\t\tif (conf->queue[idx] != conf->queue[idx - 1] + 1)\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION_CONF, action,\n+\t\t\t\t\"Invalid queue ID sequence! the queue ID \"\n+\t\t\t\t\"must be continuous increment.\");\n+\t}\n+\n+\trule->queue_id = conf->queue[0];\n+\trule->nb_queues = conf->queue_num;\n \trule->action = HNS3_FD_ACTION_ACCEPT_PACKET;\n \treturn 0;\n }\n@@ -274,6 +356,19 @@ hns3_handle_actions(struct rte_eth_dev *dev,\n \t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n \t\t\trule->action = HNS3_FD_ACTION_DROP_PACKET;\n \t\t\tbreak;\n+\t\t/*\n+\t\t * Here RSS's real action is queue region.\n+\t\t * Queue region is implemented by FDIR + RSS in hns3 hardware,\n+\t\t * the FDIR's action is one queue region (start_queue_id and\n+\t\t * queue_num), then RSS spread packets to the queue region by\n+\t\t * RSS algorigthm.\n+\t\t */\n+\t\tcase RTE_FLOW_ACTION_TYPE_RSS:\n+\t\t\tret = hns3_handle_action_queue_region(dev, actions,\n+\t\t\t\t\t\t\t      rule, error);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\t\tmark =\n \t\t\t    (const struct rte_flow_action_mark *)actions->conf;\n@@ -1629,7 +1724,7 @@ hns3_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \tif (ret)\n \t\treturn ret;\n \n-\tif (find_rss_action(actions))\n+\tif (hns3_find_rss_general_action(pattern, actions))\n \t\treturn hns3_parse_rss_filter(dev, actions, error);\n \n \tmemset(&fdir_rule, 0, sizeof(struct hns3_fdir_rule));\n@@ -1684,7 +1779,7 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \tflow_node->flow = flow;\n \tTAILQ_INSERT_TAIL(&process_list->flow_list, flow_node, entries);\n \n-\tact = find_rss_action(actions);\n+\tact = hns3_find_rss_general_action(pattern, actions);\n \tif (act) {\n \t\trss_conf = act->conf;\n \n",
    "prefixes": [
        "09/17"
    ]
}