get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61588,
    "url": "http://patches.dpdk.org/api/patches/61588/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1571659612-46066-4-git-send-email-simei.su@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": "<1571659612-46066-4-git-send-email-simei.su@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1571659612-46066-4-git-send-email-simei.su@intel.com",
    "date": "2019-10-21T12:06:52",
    "name": "[v8,3/3] net/ice: enable advanced RSS",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "57874dfcc1355ef00fa4f60999ce4d0b4be49809",
    "submitter": {
        "id": 1298,
        "url": "http://patches.dpdk.org/api/people/1298/?format=api",
        "name": "Simei Su",
        "email": "simei.su@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1571659612-46066-4-git-send-email-simei.su@intel.com/mbox/",
    "series": [
        {
            "id": 6967,
            "url": "http://patches.dpdk.org/api/series/6967/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6967",
            "date": "2019-10-21T12:06:49",
            "name": "net/ice: enable advanced RSS",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/6967/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/61588/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/61588/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6F4001BF00;\n\tMon, 21 Oct 2019 14:07:32 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 93D841BE93\n\tfor <dev@dpdk.org>; Mon, 21 Oct 2019 14:07:22 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Oct 2019 05:07:13 -0700",
            "from npg-dpdk-cvl-simeisu-118d193.sh.intel.com ([10.67.110.183])\n\tby orsmga005.jf.intel.com with ESMTP; 21 Oct 2019 05:07:12 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,323,1566889200\"; d=\"scan'208\";a=\"372154314\"",
        "From": "Simei Su <simei.su@intel.com>",
        "To": "qi.z.zhang@intel.com,\n\txiaolong.ye@intel.com",
        "Cc": "dev@dpdk.org,\n\tsimei.su@intel.com",
        "Date": "Mon, 21 Oct 2019 20:06:52 +0800",
        "Message-Id": "<1571659612-46066-4-git-send-email-simei.su@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1571659612-46066-1-git-send-email-simei.su@intel.com>",
        "References": "<1571537689-351403-1-git-send-email-simei.su@intel.com>\n\t<1571659612-46066-1-git-send-email-simei.su@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 3/3] net/ice: enable advanced RSS",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch supports:\n  (1)symmetric hash by rte_flow RSS action.\n  (2)input set change by rte_flow RSS action.\n\nSigned-off-by: Simei Su <simei.su@intel.com>\nAcked-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n doc/guides/rel_notes/release_19_11.rst |   1 +\n drivers/net/ice/Makefile               |   1 +\n drivers/net/ice/ice_ethdev.c           |   7 +\n drivers/net/ice/ice_hash.c             | 562 +++++++++++++++++++++++++++++++++\n drivers/net/ice/meson.build            |   3 +-\n 5 files changed, 573 insertions(+), 1 deletion(-)\n create mode 100644 drivers/net/ice/ice_hash.c",
    "diff": "diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst\nindex 562ef1e..d905bac 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -104,6 +104,7 @@ New Features\n   * Generic filter enhancement\n     - Supported pipeline mode.\n     - Supported new packet type like PPPoE for switch filter.\n+  * Supported input set change and symmetric hash by rte_flow RSS action.\n \n * **Updated iavf PMD.**\n \ndiff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile\nindex 884fc40..7c3b6a7 100644\n--- a/drivers/net/ice/Makefile\n+++ b/drivers/net/ice/Makefile\n@@ -63,6 +63,7 @@ endif\n \n SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch_filter.c\n SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_fdir_filter.c\n+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_hash.c\n ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)\n \tCC_AVX2_SUPPORT=1\n else\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 49d00bd..d746758 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -2370,6 +2370,7 @@ static int ice_init_rss(struct ice_pf *pf)\n \tuint16_t i, nb_q;\n \tint ret = 0;\n \tbool is_safe_mode = pf->adapter->is_safe_mode;\n+\tuint32_t reg;\n \n \trss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;\n \tnb_q = dev->data->nb_rx_queues;\n@@ -2413,6 +2414,12 @@ static int ice_init_rss(struct ice_pf *pf)\n \tif (ret)\n \t\treturn -EINVAL;\n \n+\t/* Enable registers for symmetric_toeplitz function. */\n+\treg = ICE_READ_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id));\n+\treg = (reg & (~VSIQF_HASH_CTL_HASH_SCHEME_M)) |\n+\t\t(1 << VSIQF_HASH_CTL_HASH_SCHEME_S);\n+\tICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg);\n+\n \t/* configure RSS for IPv4 with input set IPv4 src/dst */\n \tret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4,\n \t\t\t      ICE_FLOW_SEG_HDR_IPV4, 0);\ndiff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nnew file mode 100644\nindex 0000000..8f9e83e\n--- /dev/null\n+++ b/drivers/net/ice/ice_hash.c\n@@ -0,0 +1,562 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2019 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 \"ice_logs.h\"\n+#include \"base/ice_type.h\"\n+#include \"base/ice_flow.h\"\n+#include \"ice_ethdev.h\"\n+#include \"ice_generic_flow.h\"\n+\n+#define ICE_ACTION_RSS_MAX_QUEUE_NUM 32\n+\n+struct rss_type_match_hdr {\n+\tuint32_t hdr_mask;\n+\tuint64_t eth_rss_hint;\n+};\n+\n+struct ice_hash_match_type {\n+\tuint64_t hash_type;\n+\tuint64_t hash_flds;\n+};\n+\n+struct rss_meta {\n+\tuint32_t pkt_hdr;\n+\tuint64_t hash_flds;\n+\tuint8_t hash_function;\n+};\n+\n+static int\n+ice_hash_init(struct ice_adapter *ad);\n+\n+static int\n+ice_hash_create(struct ice_adapter *ad,\n+\t\tstruct rte_flow *flow,\n+\t\tvoid *meta,\n+\t\tstruct rte_flow_error *error);\n+\n+static int\n+ice_hash_destroy(struct ice_adapter *ad,\n+\t\tstruct rte_flow *flow,\n+\t\tstruct rte_flow_error *error);\n+\n+static void\n+ice_hash_uninit(struct ice_adapter *ad);\n+\n+static void\n+ice_hash_free(struct rte_flow *flow);\n+\n+static int\n+ice_hash_parse_pattern_action(struct ice_adapter *ad,\n+\t\t\tstruct ice_pattern_match_item *array,\n+\t\t\tuint32_t array_len,\n+\t\t\tconst struct rte_flow_item pattern[],\n+\t\t\tconst struct rte_flow_action actions[],\n+\t\t\tvoid **meta,\n+\t\t\tstruct rte_flow_error *error);\n+\n+/* The first member is protocol header, the second member is ETH_RSS_*. */\n+struct rss_type_match_hdr hint_0 = {\n+\tICE_FLOW_SEG_HDR_NONE,\t0};\n+struct rss_type_match_hdr hint_1 = {\n+\tICE_FLOW_SEG_HDR_IPV4,\tETH_RSS_IPV4};\n+struct rss_type_match_hdr hint_2 = {\n+\tICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_UDP, ETH_RSS_NONFRAG_IPV4_UDP};\n+struct rss_type_match_hdr hint_3 = {\n+\tICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_TCP, ETH_RSS_NONFRAG_IPV4_TCP};\n+struct rss_type_match_hdr hint_4 = {\n+\tICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP};\n+struct rss_type_match_hdr hint_5 = {\n+\tICE_FLOW_SEG_HDR_IPV6,\tETH_RSS_IPV6};\n+struct rss_type_match_hdr hint_6 = {\n+\tICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_UDP, ETH_RSS_NONFRAG_IPV6_UDP};\n+struct rss_type_match_hdr hint_7 = {\n+\tICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_TCP, ETH_RSS_NONFRAG_IPV6_TCP};\n+struct rss_type_match_hdr hint_8 = {\n+\tICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP};\n+struct rss_type_match_hdr hint_9 = {\n+\tICE_FLOW_SEG_HDR_GTPU_IP,\tETH_RSS_IPV4};\n+struct rss_type_match_hdr hint_10 = {\n+\tICE_FLOW_SEG_HDR_PPPOE,\tETH_RSS_IPV4};\n+struct rss_type_match_hdr hint_11 = {\n+\tICE_FLOW_SEG_HDR_PPPOE,\tETH_RSS_NONFRAG_IPV4_UDP};\n+struct rss_type_match_hdr hint_12 = {\n+\tICE_FLOW_SEG_HDR_PPPOE,\tETH_RSS_NONFRAG_IPV4_TCP};\n+struct rss_type_match_hdr hint_13 = {\n+\tICE_FLOW_SEG_HDR_PPPOE,\tETH_RSS_NONFRAG_IPV4_SCTP};\n+\n+/* Supported pattern for os default package. */\n+static struct ice_pattern_match_item ice_hash_pattern_list_os[] = {\n+\t{pattern_eth_ipv4,\tICE_INSET_NONE,\t&hint_1},\n+\t{pattern_eth_ipv4_udp,\tICE_INSET_NONE,\t&hint_2},\n+\t{pattern_eth_ipv4_tcp,\tICE_INSET_NONE,\t&hint_3},\n+\t{pattern_eth_ipv4_sctp,\tICE_INSET_NONE,\t&hint_4},\n+\t{pattern_eth_ipv6,\tICE_INSET_NONE,\t&hint_5},\n+\t{pattern_eth_ipv6_udp,\tICE_INSET_NONE,\t&hint_6},\n+\t{pattern_eth_ipv6_tcp,\tICE_INSET_NONE,\t&hint_7},\n+\t{pattern_eth_ipv6_sctp,\tICE_INSET_NONE,\t&hint_8},\n+\t{pattern_empty,\t\tICE_INSET_NONE,\t&hint_0},\n+};\n+\n+/* Supported pattern for comms package. */\n+static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {\n+\t{pattern_eth_ipv4,\t\t ICE_INSET_NONE,  &hint_1},\n+\t{pattern_eth_ipv4_udp,\t\t ICE_INSET_NONE,  &hint_2},\n+\t{pattern_eth_ipv4_tcp,\t\t ICE_INSET_NONE,  &hint_3},\n+\t{pattern_eth_ipv4_sctp,\t\t ICE_INSET_NONE,  &hint_4},\n+\t{pattern_eth_ipv6,\t\t ICE_INSET_NONE,  &hint_5},\n+\t{pattern_eth_ipv6_udp,\t\t ICE_INSET_NONE,  &hint_6},\n+\t{pattern_eth_ipv6_tcp,\t\t ICE_INSET_NONE,  &hint_7},\n+\t{pattern_eth_ipv6_sctp,\t\t ICE_INSET_NONE,  &hint_8},\n+\t{pattern_empty,\t\t\t ICE_INSET_NONE,  &hint_0},\n+\t{pattern_eth_ipv4_gtpu_ipv4,\t ICE_INSET_NONE,  &hint_9},\n+\t{pattern_eth_ipv4_gtpu_ipv4_udp, ICE_INSET_NONE,  &hint_9},\n+\t{pattern_eth_ipv4_gtpu_ipv4_tcp, ICE_INSET_NONE,  &hint_9},\n+\t{pattern_eth_pppoes_ipv4,\t ICE_INSET_NONE,  &hint_10},\n+\t{pattern_eth_pppoes_ipv4_udp,\t ICE_INSET_NONE,  &hint_11},\n+\t{pattern_eth_pppoes_ipv4_tcp,\t ICE_INSET_NONE,  &hint_12},\n+\t{pattern_eth_pppoes_ipv4_sctp,\t ICE_INSET_NONE,  &hint_13},\n+};\n+\n+/**\n+ * The first member is input set combination,\n+ * the second member is hash fields.\n+ */\n+struct ice_hash_match_type ice_hash_type_list[] = {\n+\t{ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,\t\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},\n+\t{ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,\t\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)},\n+\t{ETH_RSS_IPV4,\t\t\t\t\t\t\t\tICE_FLOW_HASH_IPV4},\n+\t{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY,\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},\n+\t{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\tBIT_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IPV6_SCTP | ETH_RSS_L3_SRC_ONLY,\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA) | BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA) | BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY,\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY,\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY,\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)},\n+\t{ETH_RSS_NONFRAG_IPV6_SCTP,\t\t\t\t\t\tICE_HASH_SCTP_IPV6},\n+};\n+\n+static struct ice_flow_engine ice_hash_engine = {\n+\t.init = ice_hash_init,\n+\t.create = ice_hash_create,\n+\t.destroy = ice_hash_destroy,\n+\t.uninit = ice_hash_uninit,\n+\t.free = ice_hash_free,\n+\t.type = ICE_FLOW_ENGINE_HASH,\n+};\n+\n+/* Register parser for os package. */\n+static struct ice_flow_parser ice_hash_parser_os = {\n+\t.engine = &ice_hash_engine,\n+\t.array = ice_hash_pattern_list_os,\n+\t.array_len = RTE_DIM(ice_hash_pattern_list_os),\n+\t.parse_pattern_action = ice_hash_parse_pattern_action,\n+\t.stage = ICE_FLOW_STAGE_RSS,\n+};\n+\n+/* Register parser for comms package. */\n+static struct ice_flow_parser ice_hash_parser_comms = {\n+\t.engine = &ice_hash_engine,\n+\t.array = ice_hash_pattern_list_comms,\n+\t.array_len = RTE_DIM(ice_hash_pattern_list_comms),\n+\t.parse_pattern_action = ice_hash_parse_pattern_action,\n+\t.stage = ICE_FLOW_STAGE_RSS,\n+};\n+\n+RTE_INIT(ice_hash_engine_init)\n+{\n+\tstruct ice_flow_engine *engine = &ice_hash_engine;\n+\tice_register_flow_engine(engine);\n+}\n+\n+static int\n+ice_hash_init(struct ice_adapter *ad)\n+{\n+\tstruct ice_flow_parser *parser = NULL;\n+\n+\tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n+\t\tparser = &ice_hash_parser_os;\n+\telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n+\t\tparser = &ice_hash_parser_comms;\n+\n+\treturn ice_register_parser(parser, ad);\n+}\n+\n+static int\n+ice_hash_check_inset(const struct rte_flow_item pattern[],\n+\t\tstruct 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\tRTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t\"Not support range\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\n+\t\t/* Ignore spec and mask. */\n+\t\tif (item->spec || item->mask) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t\"Invalid spec/mask.\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,\n+\t\tconst struct rte_flow_action actions[],\n+\t\tvoid **meta,\n+\t\tstruct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_action *action;\n+\tenum rte_flow_action_type action_type;\n+\tconst struct rte_flow_action_rss *rss;\n+\tstruct rss_type_match_hdr *m = (struct rss_type_match_hdr *)\n+\t\t\t\t(pattern_match_item->meta);\n+\tuint32_t type_list_len = RTE_DIM(ice_hash_type_list);\n+\tstruct ice_hash_match_type *type_match_item;\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\tuint16_t i;\n+\t\t\tuint64_t rss_hf = 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_hf = rte_eth_rss_hf_refine(rss_hf);\n+\n+\t\t\t/* Check if pattern is empty. */\n+\t\t\tif (pattern_match_item->pattern_list !=\n+\t\t\t\tpattern_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\t/* Check if rss types match pattern. */\n+\t\t\tif (rss->func != RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) {\n+\t\t\t\tif (((rss_hf & ETH_RSS_IPV4) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV4_SCTP) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_IPV6) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) != m->eth_rss_hint) ||\n+\t\t\t\t((rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) != m->eth_rss_hint))\n+\t\t\t\t\treturn rte_flow_error_set(error,\n+\t\t\t\t\tENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\taction, \"Not supported RSS types\");\n+\t\t\t}\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 == 0)\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\"RSS hash key_len mustn't be 0\");\n+\n+\t\t\tif (rss->queue_num > ICE_ACTION_RSS_MAX_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\"too many queues for RSS context\");\n+\n+\t\t\t/* Check hash function and save it to rss_meta. */\n+\t\t\tif (rss->func ==\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR)\n+\t\t\t\t((struct rss_meta *)*meta)->hash_function =\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR;\n+\n+\t\t\tif (rss->func ==\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)\n+\t\t\t\t((struct rss_meta *)*meta)->hash_function =\n+\t\t\t\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;\n+\n+\t\t\ttype_match_item = rte_zmalloc(\"ice_type_match_item\",\n+\t\t\t\t\tsizeof(struct ice_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\tRTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\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 hash fields according to hash type. */\n+\t\t\tfor (i = 0; i < type_list_len; i++) {\n+\t\t\t\tif (rss_hf ==\n+\t\t\t\t\tice_hash_type_list[i].hash_type) {\n+\t\t\t\t\ttype_match_item->hash_type =\n+\t\t\t\t\t\tice_hash_type_list[i].hash_type;\n+\t\t\t\t\ttype_match_item->hash_flds =\n+\t\t\t\t\t\tice_hash_type_list[i].hash_flds;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\t/* Save hash fileds to rss_meta. */\n+\t\t\t((struct rss_meta *)*meta)->hash_flds =\n+\t\t\t\t\ttype_match_item->hash_flds;\n+\n+\t\t\trte_free(type_match_item);\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\tRTE_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+ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,\n+\t\t\tstruct ice_pattern_match_item *array,\n+\t\t\tuint32_t array_len,\n+\t\t\tconst struct rte_flow_item pattern[],\n+\t\t\tconst struct rte_flow_action actions[],\n+\t\t\tvoid **meta,\n+\t\t\tstruct rte_flow_error *error)\n+{\n+\tint ret = 0;\n+\tstruct ice_pattern_match_item *pattern_match_item;\n+\tstruct rss_meta *rss_meta_ptr;\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\tRTE_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 = ice_search_pattern_match_item(pattern,\n+\t\t\t\t\tarray, array_len, error);\n+\tif (!pattern_match_item)\n+\t\treturn -rte_errno;\n+\n+\tret = ice_hash_check_inset(pattern, error);\n+\tif (ret)\n+\t\treturn -rte_errno;\n+\n+\t/* Save protocol header to rss_meta. */\n+\t*meta = rss_meta_ptr;\n+\t((struct rss_meta *)*meta)->pkt_hdr = ((struct rss_type_match_hdr *)\n+\t\t(pattern_match_item->meta))->hdr_mask;\n+\n+\t/* Check rss action. */\n+\tret = ice_hash_parse_action(pattern_match_item, actions, meta, error);\n+\tif (ret)\n+\t\treturn -rte_errno;\n+\n+\trte_free(pattern_match_item);\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_hash_create(struct ice_adapter *ad,\n+\t\tstruct rte_flow *flow,\n+\t\tvoid *meta,\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct ice_pf *pf = &ad->pf;\n+\tstruct ice_hw *hw = ICE_PF_TO_HW(pf);\n+\tstruct ice_vsi *vsi = pf->main_vsi;\n+\tint ret;\n+\tuint32_t reg;\n+\tstruct ice_rss_cfg *filter_ptr;\n+\n+\tuint32_t headermask = ((struct rss_meta *)meta)->pkt_hdr;\n+\tuint64_t hash_field = ((struct rss_meta *)meta)->hash_flds;\n+\tuint8_t hash_function = ((struct rss_meta *)meta)->hash_function;\n+\n+\tfilter_ptr = rte_zmalloc(\"ice_rss_filter\",\n+\t\t\t\tsizeof(struct ice_rss_cfg), 0);\n+\tif (!filter_ptr) {\n+\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t\"No memory for filter_ptr\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tif (hash_function == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) {\n+\t\t/* Enable registers for simple_xor hash function. */\n+\t\treg = ICE_READ_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id));\n+\t\treg = (reg & (~VSIQF_HASH_CTL_HASH_SCHEME_M)) |\n+\t\t\t(2 << VSIQF_HASH_CTL_HASH_SCHEME_S);\n+\t\tICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg);\n+\n+\t\tfilter_ptr->symm = 0;\n+\n+\t\tgoto out;\n+\t} else if (hash_function == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {\n+\t\tret = ice_add_rss_cfg(hw, vsi->idx, hash_field, headermask, 1);\n+\t\tif (ret) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t\t\"rss flow create fail\");\n+\t\t\tgoto error;\n+\t\t}\n+\t} else {\n+\t\tret = ice_add_rss_cfg(hw, vsi->idx, hash_field, headermask, 0);\n+\t\tif (ret) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t\t\"rss flow create fail\");\n+\t\t\tgoto error;\n+\t\t}\n+\t}\n+\n+\tfilter_ptr->packet_hdr = headermask;\n+\tfilter_ptr->hashed_flds = hash_field;\n+\n+out:\n+\tflow->rule = filter_ptr;\n+\trte_free(meta);\n+\treturn 0;\n+\n+error:\n+\trte_free(filter_ptr);\n+\trte_free(meta);\n+\treturn -rte_errno;\n+}\n+\n+static int\n+ice_hash_destroy(struct ice_adapter *ad,\n+\t\tstruct rte_flow *flow,\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(ad);\n+\tstruct ice_hw *hw = ICE_PF_TO_HW(pf);\n+\tstruct ice_vsi *vsi = pf->main_vsi;\n+\tint ret;\n+\tuint32_t reg;\n+\tstruct ice_rss_cfg *filter_ptr;\n+\n+\tfilter_ptr = (struct ice_rss_cfg *)flow->rule;\n+\n+\tif (filter_ptr->symm == 0) {\n+\t\t/* Return to symmetric_toeplitz state. */\n+\t\treg = ICE_READ_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id));\n+\t\treg = (reg & (~VSIQF_HASH_CTL_HASH_SCHEME_M)) |\n+\t\t\t(1 << VSIQF_HASH_CTL_HASH_SCHEME_S);\n+\t\tICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg);\n+\t} else {\n+\t\tret = ice_rem_vsi_rss_cfg(hw, vsi->idx);\n+\t\tif (ret) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n+\t\t\t\t\t\"rss flow destroy fail\");\n+\t\t\tgoto error;\n+\t\t}\n+\t}\n+\n+\trte_free(filter_ptr);\n+\treturn 0;\n+\n+error:\n+\trte_free(filter_ptr);\n+\treturn -rte_errno;\n+}\n+\n+static void\n+ice_hash_uninit(struct ice_adapter *ad)\n+{\n+\tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n+\t\tice_unregister_parser(&ice_hash_parser_os, ad);\n+\telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n+\t\tice_unregister_parser(&ice_hash_parser_comms, ad);\n+}\n+\n+static void\n+ice_hash_free(struct rte_flow *flow)\n+{\n+\trte_free(flow->rule);\n+}\ndiff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build\nindex 908a2ca..f9e897b 100644\n--- a/drivers/net/ice/meson.build\n+++ b/drivers/net/ice/meson.build\n@@ -11,7 +11,8 @@ sources = files(\n \t'ice_rxtx.c',\n \t'ice_switch_filter.c',\n \t'ice_generic_flow.c',\n-\t'ice_fdir_filter.c'\n+\t'ice_fdir_filter.c',\n+\t'ice_hash.c'\n \t)\n \n deps += ['hash']\n",
    "prefixes": [
        "v8",
        "3/3"
    ]
}