get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69031,
    "url": "http://patches.dpdk.org/api/patches/69031/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200422010255.76137-3-jia.guo@intel.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": "<20200422010255.76137-3-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200422010255.76137-3-jia.guo@intel.com",
    "date": "2020-04-22T01:02:54",
    "name": "[v8,2/3] net/iavf: add RSS configuration for VFs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a0e0544915aa8e2619b11ec0f5c2d6e1460ae48e",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.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/20200422010255.76137-3-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 9544,
            "url": "http://patches.dpdk.org/api/series/9544/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9544",
            "date": "2020-04-22T01:02:52",
            "name": "add RSS configuration for iavf",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/9544/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/69031/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/69031/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 0A0CAA0597;\n\tTue, 21 Apr 2020 15:05:12 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ADB721D5FD;\n\tTue, 21 Apr 2020 15:03:46 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id 0EE321D5FD\n for <dev@dpdk.org>; Tue, 21 Apr 2020 15:03:41 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2020 06:03:41 -0700",
            "from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128])\n by fmsmga004.fm.intel.com with ESMTP; 21 Apr 2020 06:03:38 -0700"
        ],
        "IronPort-SDR": [
            "\n dVQv08HvjadN0x1w0biA20cCDwvNspkXQJFrwfgS5Kwde02t+VXWgYpLbZEdAvtrod6DSCk2OK\n 9jHB3nHAht7A==",
            "\n nrmDFGds42OBii++RZLJIgGEV7RKz3bZNHlhIFxZku+K+Pmf1MRaGn1dKMiDU6RJOrGQEFQJ8v\n bcvLlym1ZGUg=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.72,410,1580803200\"; d=\"scan'208\";a=\"279630580\"",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "bernard.iremonger@intel.com, orika@mellanox.com, wenzhuo.lu@intel.com,\n stephen@networkplumber.org, qi.z.zhang@intel.com, jingjing.wu@intel.com",
        "Cc": "beilei.xing@intel.com, xiaolong.ye@intel.com, dev@dpdk.org,\n yahui.cao@intel.com, simei.su@intel.com, jia.guo@intel.com",
        "Date": "Tue, 21 Apr 2020 21:02:54 -0400",
        "Message-Id": "<20200422010255.76137-3-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200422010255.76137-1-jia.guo@intel.com>",
        "References": "<20200318170401.7938-5-jia.guo@intel.com>\n <20200422010255.76137-1-jia.guo@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [dpdk-dev v8 2/3] net/iavf: add RSS configuration for VFs",
        "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": "The VF must be capable of configuring RSS. Add a virtchnl handler to parse\na specific RSS configuration, and process the configuration for VFs, such\nas add or delete a RSS rule.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\nReviewed-by: Qi Zhang <qi.z.zhang@intel.com>\n---\nv8->v7:\nno change.\n---\n doc/guides/rel_notes/release_20_05.rst |    1 +\n drivers/net/iavf/Makefile              |    1 +\n drivers/net/iavf/iavf.h                |    2 +\n drivers/net/iavf/iavf_hash.c           | 1053 ++++++++++++++++++++++++\n drivers/net/iavf/iavf_vchnl.c          |   33 +-\n drivers/net/iavf/meson.build           |    1 +\n 6 files changed, 1086 insertions(+), 5 deletions(-)\n create mode 100644 drivers/net/iavf/iavf_hash.c",
    "diff": "diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst\nindex ea0d092d1..f8ce62f86 100644\n--- a/doc/guides/rel_notes/release_20_05.rst\n+++ b/doc/guides/rel_notes/release_20_05.rst\n@@ -103,6 +103,7 @@ New Features\n \n   * Added generic filter support.\n   * Added advanced iavf with FDIR capability.\n+  * Added advanced RSS configuration for VFs.\n \n * **Added a new driver for Intel Foxville I225 devices.**\n \ndiff --git a/drivers/net/iavf/Makefile b/drivers/net/iavf/Makefile\nindex fabe510e1..792cbb7f7 100644\n--- a/drivers/net/iavf/Makefile\n+++ b/drivers/net/iavf/Makefile\n@@ -25,6 +25,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_vchnl.c\n SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx.c\n SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_generic_flow.c\n SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_fdir.c\n+SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_hash.c\n ifeq ($(CONFIG_RTE_ARCH_X86), y)\n SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_sse.c\n endif\ndiff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 5fb7881c9..9be8a2381 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -270,4 +270,6 @@ int iavf_fdir_add(struct iavf_adapter *adapter, struct iavf_fdir_conf *filter);\n int iavf_fdir_del(struct iavf_adapter *adapter, struct iavf_fdir_conf *filter);\n int iavf_fdir_check(struct iavf_adapter *adapter,\n \t\tstruct iavf_fdir_conf *filter);\n+int iavf_add_del_rss_cfg(struct iavf_adapter *adapter,\n+\t\t\t struct virtchnl_rss_cfg *rss_cfg, bool add);\n #endif /* _IAVF_ETHDEV_H_ */\ndiff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c\nnew file mode 100644\nindex 000000000..a1d0b8364\n--- /dev/null\n+++ b/drivers/net/iavf/iavf_hash.c\n@@ -0,0 +1,1053 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#include <sys/queue.h>\n+#include <stdio.h>\n+#include <errno.h>\n+#include <stdint.h>\n+#include <string.h>\n+#include <unistd.h>\n+#include <stdarg.h>\n+\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev_driver.h>\n+#include <rte_log.h>\n+#include <rte_malloc.h>\n+#include <rte_eth_ctrl.h>\n+#include <rte_tailq.h>\n+#include <rte_flow_driver.h>\n+\n+#include \"iavf_log.h\"\n+#include \"iavf.h\"\n+#include \"iavf_generic_flow.h\"\n+\n+enum iavf_pattern_hint_type {\n+\tIAVF_PATTERN_HINT_NONE,\n+\tIAVF_PATTERN_HINT_IPV4,\n+\tIAVF_PATTERN_HINT_IPV4_UDP,\n+\tIAVF_PATTERN_HINT_IPV4_TCP,\n+\tIAVF_PATTERN_HINT_IPV4_SCTP,\n+\tIAVF_PATTERN_HINT_IPV6,\n+\tIAVF_PATTERN_HINT_IPV6_UDP,\n+\tIAVF_PATTERN_HINT_IPV6_TCP,\n+\tIAVF_PATTERN_HINT_IPV6_SCTP,\n+};\n+\n+struct iavf_pattern_match_type {\n+\tenum iavf_pattern_hint_type phint_type;\n+};\n+\n+struct iavf_hash_match_type {\n+\tenum iavf_pattern_hint_type phint_type;\n+\tuint64_t hash_type;\n+\tstruct virtchnl_proto_hdrs *proto_hdrs;\n+};\n+\n+struct iavf_rss_meta {\n+\tstruct virtchnl_proto_hdrs *proto_hdrs;\n+\tuint32_t hash_function;\n+};\n+\n+struct iavf_hash_flow_cfg {\n+\tstruct virtchnl_rss_cfg *rss_cfg;\n+\tbool simple_xor;\n+};\n+\n+static int\n+iavf_hash_init(struct iavf_adapter *ad);\n+static int\n+iavf_hash_create(struct iavf_adapter *ad, struct rte_flow *flow, void *meta,\n+\t\t struct rte_flow_error *error);\n+static int\n+iavf_hash_destroy(struct iavf_adapter *ad, struct rte_flow *flow,\n+\t\t  struct rte_flow_error *error);\n+static void\n+iavf_hash_uninit(struct iavf_adapter *ad);\n+static void\n+iavf_hash_free(struct rte_flow *flow);\n+static int\n+iavf_hash_parse_pattern_action(struct iavf_adapter *ad,\n+\t\t\t       struct iavf_pattern_match_item *array,\n+\t\t\t       uint32_t array_len,\n+\t\t\t       const struct rte_flow_item pattern[],\n+\t\t\t       const struct rte_flow_action actions[],\n+\t\t\t       void **meta,\n+\t\t\t       struct rte_flow_error *error);\n+\n+struct iavf_pattern_match_type phint_empty = {\n+\tIAVF_PATTERN_HINT_NONE};\n+struct iavf_pattern_match_type phint_eth_ipv4 = {\n+\tIAVF_PATTERN_HINT_IPV4};\n+struct iavf_pattern_match_type phint_eth_ipv4_udp = {\n+\tIAVF_PATTERN_HINT_IPV4_UDP};\n+struct iavf_pattern_match_type phint_eth_ipv4_tcp = {\n+\tIAVF_PATTERN_HINT_IPV4_TCP};\n+struct iavf_pattern_match_type phint_eth_ipv4_sctp = {\n+\tIAVF_PATTERN_HINT_IPV4_SCTP};\n+struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh = {\n+\tIAVF_PATTERN_HINT_IPV4_UDP};\n+struct iavf_pattern_match_type phint_eth_ipv4_esp = {\n+\tIAVF_PATTERN_HINT_IPV4};\n+struct iavf_pattern_match_type phint_eth_ipv4_ah = {\n+\tIAVF_PATTERN_HINT_IPV4};\n+struct iavf_pattern_match_type phint_eth_ipv4_l2tpv3 = {\n+\tIAVF_PATTERN_HINT_IPV4};\n+struct iavf_pattern_match_type phint_eth_ipv4_pfcp = {\n+\tIAVF_PATTERN_HINT_IPV4_UDP};\n+struct iavf_pattern_match_type phint_eth_ipv6 = {\n+\tIAVF_PATTERN_HINT_IPV6};\n+struct iavf_pattern_match_type phint_eth_ipv6_udp = {\n+\tIAVF_PATTERN_HINT_IPV6_UDP};\n+struct iavf_pattern_match_type phint_eth_ipv6_tcp = {\n+\tIAVF_PATTERN_HINT_IPV6_TCP};\n+struct iavf_pattern_match_type phint_eth_ipv6_sctp = {\n+\tIAVF_PATTERN_HINT_IPV6_SCTP};\n+struct iavf_pattern_match_type phint_eth_ipv6_esp = {\n+\tIAVF_PATTERN_HINT_IPV6};\n+struct iavf_pattern_match_type phint_eth_ipv6_ah = {\n+\tIAVF_PATTERN_HINT_IPV6};\n+struct iavf_pattern_match_type phint_eth_ipv6_l2tpv3 = {\n+\tIAVF_PATTERN_HINT_IPV6};\n+struct iavf_pattern_match_type phint_eth_ipv6_pfcp = {\n+\tIAVF_PATTERN_HINT_IPV6_UDP};\n+\n+/**\n+ * Supported pattern for hash.\n+ * The first member is pattern item type,\n+ * the second member is input set mask,\n+ * the third member is pattern hint for hash.\n+ */\n+static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {\n+\t{iavf_pattern_eth_ipv4, IAVF_INSET_NONE, &phint_eth_ipv4},\n+\t{iavf_pattern_eth_ipv4_udp, IAVF_INSET_NONE, &phint_eth_ipv4_udp},\n+\t{iavf_pattern_eth_ipv4_tcp, IAVF_INSET_NONE, &phint_eth_ipv4_tcp},\n+\t{iavf_pattern_eth_ipv4_sctp, IAVF_INSET_NONE, &phint_eth_ipv4_sctp},\n+\t{iavf_pattern_eth_ipv6, IAVF_INSET_NONE, &phint_eth_ipv6},\n+\t{iavf_pattern_eth_ipv4_gtpu_eh_ipv4, IAVF_INSET_NONE,\n+\t\t\t\t\t\t&phint_eth_ipv4_gtpu_eh},\n+\t{iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp, IAVF_INSET_NONE,\n+\t\t\t\t\t\t&phint_eth_ipv4_gtpu_eh},\n+\t{iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp, IAVF_INSET_NONE,\n+\t\t\t\t\t\t&phint_eth_ipv4_gtpu_eh},\n+\t{iavf_pattern_eth_ipv4_esp, IAVF_INSET_NONE, &phint_eth_ipv4_esp},\n+\t{iavf_pattern_eth_ipv4_ah, IAVF_INSET_NONE, &phint_eth_ipv4_ah},\n+\t{iavf_pattern_eth_ipv4_l2tpv3, IAVF_INSET_NONE,\n+\t\t\t\t\t\t&phint_eth_ipv4_l2tpv3},\n+\t{iavf_pattern_eth_ipv4_pfcp, IAVF_INSET_NONE, &phint_eth_ipv4_pfcp},\n+\t{iavf_pattern_eth_ipv6_udp, IAVF_INSET_NONE, &phint_eth_ipv6_udp},\n+\t{iavf_pattern_eth_ipv6_tcp, IAVF_INSET_NONE, &phint_eth_ipv6_tcp},\n+\t{iavf_pattern_eth_ipv6_sctp, IAVF_INSET_NONE, &phint_eth_ipv6_sctp},\n+\t{iavf_pattern_eth_ipv6_esp, IAVF_INSET_NONE, &phint_eth_ipv6_esp},\n+\t{iavf_pattern_eth_ipv6_ah, IAVF_INSET_NONE, &phint_eth_ipv6_ah},\n+\t{iavf_pattern_eth_ipv6_l2tpv3, IAVF_INSET_NONE,\n+\t\t\t\t\t\t&phint_eth_ipv6_l2tpv3},\n+\t{iavf_pattern_eth_ipv6_pfcp, IAVF_INSET_NONE, &phint_eth_ipv6_pfcp},\n+\t{iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},\n+};\n+\n+#define\tGTP_EH_PDU_LINK_UP\t\t1\n+#define\tGTP_EH_PDU_LINK_DWN\t\t0\n+\n+#define TUNNEL_LEVEL_OUTER\t\t0\n+#define TUNNEL_LEVEL_FIRST_INNER\t1\n+\n+#define PROTO_COUNT_ONE\t\t\t1\n+#define PROTO_COUNT_TWO\t\t\t2\n+#define PROTO_COUNT_THREE\t\t3\n+\n+#define BUFF_NOUSED\t\t\t0\n+#define FIELD_FOR_PROTO_ONLY\t\t0\n+\n+#define proto_hint_eth_src { \\\n+\tVIRTCHNL_PROTO_HDR_ETH, VIRTCHNL_PROTO_HDR_ETH_SRC, {BUFF_NOUSED } }\n+\n+#define proto_hint_eth_dst { \\\n+\tVIRTCHNL_PROTO_HDR_ETH, VIRTCHNL_PROTO_HDR_ETH_DST, {BUFF_NOUSED } }\n+\n+#define proto_hint_eth_only { \\\n+\tVIRTCHNL_PROTO_HDR_ETH, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_eth { \\\n+\tVIRTCHNL_PROTO_HDR_ETH, \\\n+\tVIRTCHNL_PROTO_HDR_ETH_SRC | VIRTCHNL_PROTO_HDR_ETH_DST, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_svlan { \\\n+\tVIRTCHNL_PROTO_HDR_S_VLAN, VIRTCHNL_PROTO_HDR_S_VLAN_ID, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_cvlan { \\\n+\tVIRTCHNL_PROTO_HDR_C_VLAN, VIRTCHNL_PROTO_HDR_C_VLAN_ID, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_ipv4_src { \\\n+\tVIRTCHNL_PROTO_HDR_IPV4, VIRTCHNL_PROTO_HDR_IPV4_SRC, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv4_dst { \\\n+\tVIRTCHNL_PROTO_HDR_IPV4, VIRTCHNL_PROTO_HDR_IPV4_DST, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv4_only { \\\n+\tVIRTCHNL_PROTO_HDR_IPV4, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv4 { \\\n+\tVIRTCHNL_PROTO_HDR_IPV4, \\\n+\tVIRTCHNL_PROTO_HDR_IPV4_SRC | VIRTCHNL_PROTO_HDR_IPV4_DST, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_udp_src_port { \\\n+\tVIRTCHNL_PROTO_HDR_UDP, VIRTCHNL_PROTO_HDR_UDP_SRC_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_udp_dst_port { \\\n+\tVIRTCHNL_PROTO_HDR_UDP, VIRTCHNL_PROTO_HDR_UDP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_udp_only { \\\n+\tVIRTCHNL_PROTO_HDR_UDP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_udp { \\\n+\tVIRTCHNL_PROTO_HDR_UDP, \\\n+\tVIRTCHNL_PROTO_HDR_UDP_SRC_PORT | VIRTCHNL_PROTO_HDR_UDP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_tcp_src_port { \\\n+\tVIRTCHNL_PROTO_HDR_TCP, VIRTCHNL_PROTO_HDR_TCP_SRC_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_tcp_dst_port { \\\n+\tVIRTCHNL_PROTO_HDR_TCP, VIRTCHNL_PROTO_HDR_TCP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_tcp_only { \\\n+\tVIRTCHNL_PROTO_HDR_TCP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_tcp { \\\n+\tVIRTCHNL_PROTO_HDR_TCP, \\\n+\tVIRTCHNL_PROTO_HDR_TCP_SRC_PORT | VIRTCHNL_PROTO_HDR_TCP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_sctp_src_port { \\\n+\tVIRTCHNL_PROTO_HDR_SCTP, VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_sctp_dst_port { \\\n+\tVIRTCHNL_PROTO_HDR_SCTP, VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_sctp_only { \\\n+\tVIRTCHNL_PROTO_HDR_SCTP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_sctp { \\\n+\tVIRTCHNL_PROTO_HDR_SCTP, \\\n+\tVIRTCHNL_PROTO_HDR_SCTP_SRC_PORT | VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_ipv6_src { \\\n+\tVIRTCHNL_PROTO_HDR_IPV6, VIRTCHNL_PROTO_HDR_IPV6_SRC, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv6_dst { \\\n+\tVIRTCHNL_PROTO_HDR_IPV6, VIRTCHNL_PROTO_HDR_IPV6_DST, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv6_only { \\\n+\tVIRTCHNL_PROTO_HDR_IPV6, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_ipv6 { \\\n+\tVIRTCHNL_PROTO_HDR_IPV6, \\\n+\tVIRTCHNL_PROTO_HDR_IPV6_SRC | VIRTCHNL_PROTO_HDR_IPV6_DST, \\\n+\t{BUFF_NOUSED } }\n+\n+#define proto_hint_gtpu_up_only { \\\n+\tVIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, \\\n+\tFIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_gtpu_dwn_only { \\\n+\tVIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN, \\\n+\tFIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }\n+\n+#define proto_hint_esp { \\\n+\tVIRTCHNL_PROTO_HDR_ESP, \\\n+\tVIRTCHNL_PROTO_HDR_ESP_SPI, {BUFF_NOUSED } }\n+\n+#define proto_hint_ah { \\\n+\tVIRTCHNL_PROTO_HDR_AH, \\\n+\tVIRTCHNL_PROTO_HDR_AH_SPI, {BUFF_NOUSED } }\n+\n+#define proto_hint_l2tpv3 { \\\n+\tVIRTCHNL_PROTO_HDR_L2TPV3, \\\n+\tVIRTCHNL_PROTO_HDR_L2TPV3_SESS_ID, {BUFF_NOUSED } }\n+\n+#define proto_hint_pfcp { \\\n+\tVIRTCHNL_PROTO_HDR_PFCP, VIRTCHNL_PROTO_HDR_PFCP_SEID, {BUFF_NOUSED } }\n+\n+struct virtchnl_proto_hdrs hdrs_hint_eth_src = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_eth_src }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_eth_dst = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_eth_dst }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_eth = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_eth }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_svlan = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_svlan }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_cvlan = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_cvlan }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_src }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_dst }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_up = {\n+\tTUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,\n+\tproto_hint_ipv4_src }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_dwn = {\n+\tTUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,\n+\tproto_hint_ipv4_dst }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_esp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_esp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_ah = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_ah }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_l2tpv3 = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_l2tpv3 }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_pfcp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_pfcp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4 = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4 }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,\n+\tproto_hint_udp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,\n+\tproto_hint_tcp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,\n+\tproto_hint_sctp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_src }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_dst }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_esp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,\n+\tproto_hint_esp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_ah = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,\n+\tproto_hint_ah }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_l2tpv3 = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,\n+\tproto_hint_l2tpv3 }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_pfcp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,\n+\tproto_hint_pfcp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6 = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6 }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_udp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_udp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,\n+\tproto_hint_udp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_tcp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_tcp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,\n+\tproto_hint_tcp }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp_src_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_sctp_src_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp_dst_port = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_udp_only,\n+\tproto_hint_sctp_dst_port }\n+};\n+\n+struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp = {\n+\tTUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,\n+\tproto_hint_sctp }\n+};\n+\n+/**\n+ * The first member is pattern hint type,\n+ * the second member is hash type,\n+ * the third member is virtchnl protocol hdrs.\n+ */\n+struct iavf_hash_match_type iavf_hash_type_list[] = {\n+\t/* IPV4 */\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH, &hdrs_hint_eth},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_S_VLAN, &hdrs_hint_svlan},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ESP, &hdrs_hint_ipv4_esp},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_AH, &hdrs_hint_ipv4_ah},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2TPV3, &hdrs_hint_ipv4_l2tpv3},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4, &hdrs_hint_ipv4},\n+\t/* IPV4 UDP */\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_gtpu_up},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_gtpu_dwn},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_PFCP,\n+\t\t\t\t\t&hdrs_hint_ipv4_pfcp},\n+\t{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP,\n+\t\t\t\t\t&hdrs_hint_ipv4_udp},\n+\t/* IPV4 TCP */\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP,\n+\t\t\t\t\t&hdrs_hint_ipv4_tcp},\n+\t/* IPV4 SCTP */\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_src},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_dst},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv4_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP,\n+\t\t\t\t\t&hdrs_hint_ipv4_sctp},\n+\t/* IPV6 */\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ETH, &hdrs_hint_eth},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_S_VLAN, &hdrs_hint_svlan},\n+\t{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ESP, &hdrs_hint_ipv6_esp},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_AH, &hdrs_hint_ipv6_ah},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2TPV3, &hdrs_hint_ipv6_l2tpv3},\n+\t{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6, &hdrs_hint_ipv6},\n+\t/* IPV6 UDP */\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_udp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_udp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_PFCP,\n+\t\t\t\t\t&hdrs_hint_ipv6_pfcp},\n+\t{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP,\n+\t\t\t\t\t&hdrs_hint_ipv6_udp},\n+\t/* IPV6 TCP */\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_tcp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_tcp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP,\n+\t\t\t\t\t&hdrs_hint_ipv6_tcp},\n+\t/* IPV6 SCTP */\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_src},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_dst},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_SRC_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_sctp_src_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_DST_ONLY,\n+\t\t\t\t\t&hdrs_hint_ipv6_sctp_dst_port},\n+\t{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP,\n+\t\t\t\t\t&hdrs_hint_ipv6_sctp},\n+};\n+\n+static struct iavf_flow_engine iavf_hash_engine = {\n+\t.init = iavf_hash_init,\n+\t.create = iavf_hash_create,\n+\t.destroy = iavf_hash_destroy,\n+\t.uninit = iavf_hash_uninit,\n+\t.free = iavf_hash_free,\n+\t.type = IAVF_FLOW_ENGINE_HASH,\n+};\n+\n+/* Register parser for comms package. */\n+static struct iavf_flow_parser iavf_hash_parser = {\n+\t.engine = &iavf_hash_engine,\n+\t.array = iavf_hash_pattern_list,\n+\t.array_len = RTE_DIM(iavf_hash_pattern_list),\n+\t.parse_pattern_action = iavf_hash_parse_pattern_action,\n+\t.stage = IAVF_FLOW_STAGE_RSS,\n+};\n+\n+RTE_INIT(iavf_hash_engine_init)\n+{\n+\tstruct iavf_flow_engine *engine = &iavf_hash_engine;\n+\n+\tiavf_register_flow_engine(engine);\n+}\n+\n+static int\n+iavf_hash_init(struct iavf_adapter *ad)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);\n+\tstruct iavf_flow_parser *parser;\n+\n+\tif (!vf->vf_res)\n+\t\treturn -EINVAL;\n+\n+\tif (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF))\n+\t\treturn -ENOTSUP;\n+\n+\tparser = &iavf_hash_parser;\n+\n+\treturn iavf_register_parser(parser, ad);\n+}\n+\n+static int\n+iavf_hash_check_inset(const struct rte_flow_item pattern[],\n+\t\t      struct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_item *item = pattern;\n+\n+\tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n+\t\tif (item->last) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t   \"Not support range\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static uint64_t\n+iavf_hash_refine_type(uint64_t rss_type, const struct rte_flow_item pattern[])\n+{\n+\tconst struct rte_flow_item *item;\n+\n+\tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n+\t\tif (item->type == RTE_FLOW_ITEM_TYPE_GTP_PSC) {\n+\t\t\tconst struct rte_flow_item_gtp_psc *psc = item->spec;\n+\n+\t\t\tif (psc && (psc->pdu_type == GTP_EH_PDU_LINK_UP ||\n+\t\t\t\t    psc->pdu_type == GTP_EH_PDU_LINK_DWN)) {\n+\t\t\t\trss_type |= ETH_RSS_GTPU;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn rss_type;\n+}\n+\n+static int\n+iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,\n+\t\t       const struct rte_flow_item pattern[],\n+\t\t       const struct rte_flow_action actions[],\n+\t\t       void **meta, struct rte_flow_error *error)\n+{\n+\tstruct iavf_rss_meta *rss_meta = (struct iavf_rss_meta *)*meta;\n+\tuint32_t type_list_len = RTE_DIM(iavf_hash_type_list);\n+\tstruct iavf_hash_match_type *type_match_item;\n+\tenum rte_flow_action_type action_type;\n+\tconst struct rte_flow_action_rss *rss;\n+\tconst struct rte_flow_action *action;\n+\tbool item_found = false;\n+\tuint64_t rss_type;\n+\tuint16_t i;\n+\n+\tstruct iavf_pattern_match_type *tt = (struct iavf_pattern_match_type *)\n+\t\t(pattern_match_item->meta);\n+\n+\t/* Supported action is RSS. */\n+\tfor (action = actions; action->type !=\n+\t\tRTE_FLOW_ACTION_TYPE_END; action++) {\n+\t\taction_type = action->type;\n+\t\tswitch (action_type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_RSS:\n+\t\t\trss = action->conf;\n+\t\t\trss_type = rss->types;\n+\n+\t\t\t/**\n+\t\t\t * Check simultaneous use of SRC_ONLY and DST_ONLY\n+\t\t\t * of the same level.\n+\t\t\t */\n+\t\t\trss_type = rte_eth_rss_hf_refine(rss_type);\n+\n+\t\t\t/**\n+\t\t\t * Refine the hash type base on some specific item of\n+\t\t\t * the pattern, such as identify the gtpu hash.\n+\t\t\t */\n+\t\t\trss_type = iavf_hash_refine_type(rss_type, pattern);\n+\n+\t\t\t/* Check if pattern is empty. */\n+\t\t\tif (pattern_match_item->pattern_list !=\n+\t\t\t\tiavf_pattern_empty && rss->func ==\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR)\n+\t\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t\"Not supported flow\");\n+\n+\t\t\tif (rss->level)\n+\t\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t\"a nonzero RSS encapsulation level is not supported\");\n+\n+\t\t\tif (rss->key_len)\n+\t\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t\"a nonzero RSS key_len is not supported\");\n+\n+\t\t\tif (rss->queue_num)\n+\t\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t\"a non-NULL RSS queue is not supported\");\n+\n+\t\t\t/* Check hash function and save it to rss_meta. */\n+\t\t\tif (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)\n+\t\t\t\trss_meta->hash_function =\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR;\n+\n+\t\t\tif (rss->func ==\n+\t\t\t    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)\n+\t\t\t\trss_meta->hash_function =\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;\n+\n+\t\t\ttype_match_item =\n+\t\t\trte_zmalloc(\"iavf_type_match_item\",\n+\t\t\t\t    sizeof(struct iavf_hash_match_type), 0);\n+\t\t\tif (!type_match_item) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_HANDLE,\n+\t\t\t\t\t\t   NULL,\n+\t\t\t\t\t\t   \"No memory for type_match_item\");\n+\t\t\t\treturn -ENOMEM;\n+\t\t\t}\n+\n+\t\t\t/* Find matched proto hdrs according to hash type. */\n+\t\t\tfor (i = 0; i < type_list_len; i++) {\n+\t\t\t\tstruct iavf_hash_match_type *ht_map =\n+\t\t\t\t\t&iavf_hash_type_list[i];\n+\t\t\t\tif (rss_type == ht_map->hash_type &&\n+\t\t\t\t    tt->phint_type == ht_map->phint_type) {\n+\t\t\t\t\ttype_match_item->hash_type =\n+\t\t\t\t\t\tht_map->hash_type;\n+\t\t\t\t\ttype_match_item->proto_hdrs =\n+\t\t\t\t\t\tht_map->proto_hdrs;\n+\t\t\t\t\trss_meta->proto_hdrs =\n+\t\t\t\t\t\ttype_match_item->proto_hdrs;\n+\t\t\t\t\titem_found = true;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\trte_free(type_match_item);\n+\n+\t\t\tif (!item_found)\n+\t\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t\"Not supported flow\");\n+\t\t\tbreak;\n+\n+\t\tcase RTE_FLOW_ACTION_TYPE_END:\n+\t\t\tbreak;\n+\n+\t\tdefault:\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t   \"Invalid action.\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+iavf_hash_parse_pattern_action(__rte_unused struct iavf_adapter *ad,\n+\t\t\t       struct iavf_pattern_match_item *array,\n+\t\t\t       uint32_t array_len,\n+\t\t\t       const struct rte_flow_item pattern[],\n+\t\t\t       const struct rte_flow_action actions[],\n+\t\t\t       void **meta,\n+\t\t\t       struct rte_flow_error *error)\n+{\n+\tstruct iavf_pattern_match_item *pattern_match_item;\n+\tstruct iavf_rss_meta *rss_meta_ptr;\n+\tint ret = 0;\n+\n+\trss_meta_ptr = rte_zmalloc(NULL, sizeof(*rss_meta_ptr), 0);\n+\tif (!rss_meta_ptr) {\n+\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t   \"No memory for rss_meta_ptr\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Check rss supported pattern and find matched pattern. */\n+\tpattern_match_item =\n+\t\tiavf_search_pattern_match_item(pattern, array, array_len,\n+\t\t\t\t\t       error);\n+\tif (!pattern_match_item) {\n+\t\tret = -rte_errno;\n+\t\tgoto error;\n+\t}\n+\n+\tret = iavf_hash_check_inset(pattern, error);\n+\tif (ret)\n+\t\tgoto error;\n+\n+\t/* Check rss action. */\n+\tret = iavf_hash_parse_action(pattern_match_item, pattern, actions,\n+\t\t\t\t     (void **)&rss_meta_ptr, error);\n+\n+error:\n+\tif (!ret && meta)\n+\t\t*meta = rss_meta_ptr;\n+\telse\n+\t\trte_free(rss_meta_ptr);\n+\n+\trte_free(pattern_match_item);\n+\n+\treturn ret;\n+}\n+\n+static int\n+iavf_hash_create(__rte_unused struct iavf_adapter *ad,\n+\t\t __rte_unused struct rte_flow *flow, void *meta,\n+\t\t __rte_unused struct rte_flow_error *error)\n+{\n+\tstruct iavf_rss_meta *rss_meta = (struct iavf_rss_meta *)meta;\n+\tstruct virtchnl_rss_cfg *rss_cfg;\n+\tint ret = 0;\n+\n+\trss_cfg = rte_zmalloc(\"iavf rss rule\",\n+\t\t\t      sizeof(struct virtchnl_rss_cfg), 0);\n+\tif (!rss_cfg) {\n+\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t   \"No memory for rss rule\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\trss_cfg->proto_hdrs = *rss_meta->proto_hdrs;\n+\trss_cfg->rss_algorithm = rss_meta->hash_function;\n+\n+\tret = iavf_add_del_rss_cfg(ad, rss_cfg, true);\n+\tif (!ret) {\n+\t\tflow->rule = rss_cfg;\n+\t} else {\n+\t\tPMD_DRV_LOG(ERR, \"fail to add RSS configure\");\n+\t\trte_free(rss_cfg);\n+\t}\n+\n+\trte_free(meta);\n+\n+\treturn ret;\n+}\n+\n+static int\n+iavf_hash_destroy(__rte_unused struct iavf_adapter *ad,\n+\t\t  struct rte_flow *flow,\n+\t\t  __rte_unused struct rte_flow_error *error)\n+{\n+\tstruct virtchnl_rss_cfg *rss_cfg;\n+\tint ret = 0;\n+\n+\trss_cfg = (struct virtchnl_rss_cfg *)flow->rule;\n+\n+\tret = iavf_add_del_rss_cfg(ad, rss_cfg, false);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR, \"fail to del RSS configure\");\n+\n+\treturn ret;\n+}\n+\n+static void\n+iavf_hash_uninit(struct iavf_adapter *ad)\n+{\n+\tiavf_unregister_parser(&iavf_hash_parser, ad);\n+}\n+\n+static void\n+iavf_hash_free(struct rte_flow *flow)\n+{\n+\trte_free(flow->rule);\n+}\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex 805d30897..2a0cdd927 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -335,13 +335,10 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)\n \targs.out_buffer = vf->aq_resp;\n \targs.out_size = IAVF_AQ_BUF_SZ;\n \n-\t/* TODO: basic offload capabilities, need to\n-\t * add advanced/optional offload capabilities\n-\t */\n-\n \tcaps = IAVF_BASIC_OFFLOAD_CAPS | VIRTCHNL_VF_CAP_ADV_LINK_SPEED |\n \t\tVIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC |\n-\t\tVIRTCHNL_VF_OFFLOAD_FDIR_PF;\n+\t\tVIRTCHNL_VF_OFFLOAD_FDIR_PF |\n+\t\tVIRTCHNL_VF_OFFLOAD_ADV_RSS_PF;\n \n \targs.in_args = (uint8_t *)&caps;\n \targs.in_args_size = sizeof(caps);\n@@ -1007,3 +1004,29 @@ iavf_fdir_check(struct iavf_adapter *adapter,\n \n \treturn 0;\n }\n+\n+int\n+iavf_add_del_rss_cfg(struct iavf_adapter *adapter,\n+\t\t     struct virtchnl_rss_cfg *rss_cfg, bool add)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct iavf_cmd_info args;\n+\tint err;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.ops = add ? VIRTCHNL_OP_ADD_RSS_CFG :\n+\t\tVIRTCHNL_OP_DEL_RSS_CFG;\n+\targs.in_args = (u8 *)rss_cfg;\n+\targs.in_args_size = sizeof(*rss_cfg);\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\n+\terr = iavf_execute_vf_cmd(adapter, &args);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to execute command of %s\",\n+\t\t\t    add ? \"OP_ADD_RSS_CFG\" :\n+\t\t\t    \"OP_DEL_RSS_INPUT_CFG\");\n+\n+\treturn err;\n+}\ndiff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build\nindex 2cc772a16..a3fad363d 100644\n--- a/drivers/net/iavf/meson.build\n+++ b/drivers/net/iavf/meson.build\n@@ -12,6 +12,7 @@ sources = files(\n \t'iavf_vchnl.c',\n \t'iavf_generic_flow.c',\n \t'iavf_fdir.c',\n+\t'iavf_hash.c',\n )\n \n if arch_subdir == 'x86'\n",
    "prefixes": [
        "v8",
        "2/3"
    ]
}