get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 120978,
    "url": "http://patches.dpdk.org/api/patches/120978/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221216093706.2453812-3-mingxia.liu@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": "<20221216093706.2453812-3-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221216093706.2453812-3-mingxia.liu@intel.com",
    "date": "2022-12-16T09:37:01",
    "name": "[2/7] common/idpf: add RSS set/get ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c3d1b85831fd0f723fde90b07e2a26903c5b7212",
    "submitter": {
        "id": 2514,
        "url": "http://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221216093706.2453812-3-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26162,
            "url": "http://patches.dpdk.org/api/series/26162/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26162",
            "date": "2022-12-16T09:36:59",
            "name": "add idpf pmd enhancement features",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/26162/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/120978/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/120978/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C680AA0093;\n\tFri, 16 Dec 2022 11:32:53 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DFADE42D2A;\n\tFri, 16 Dec 2022 11:32:48 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 43DA742D24\n for <dev@dpdk.org>; Fri, 16 Dec 2022 11:32:46 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Dec 2022 02:32:24 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.112])\n by fmsmga008.fm.intel.com with ESMTP; 16 Dec 2022 02:32:22 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1671186766; x=1702722766;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ugljeUq3jsj32Vik392kZ7S7gmzGlXN71egj3n7Fc2g=;\n b=dkSHO3XK8SWtyBY7mtMloQ8+Fuhp2cEnj7+WlaMtX/Lw7DEmoMKj72Ia\n 6aGUa7pXksw51NveCA3pruYKXFzZj41/L7O2GMQUyl8W2OuBC2t0+Q24V\n 0COKrN3koYlALhOWpT8mSYZIMsPRDLhwtVf+s+5Khz2U0ZPI/qmTtxWh7\n GzUxWiqbUbdo8azxf9wJjUsPZSk7SX4E7aCg4wMwJsQjDde/C5Jy6j7xM\n eo5W6m9i1Kcuqc53UcinW/LZkjov/EC4PT/Y6+wPa1yOEZFIs7ARD77zl\n ajvg0wJlOWGPh9unQFSo+oSwbo1aGoXUwknaz8IjTSjQoZ0zpULP1Dcmg A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10562\"; a=\"306616605\"",
            "E=Sophos;i=\"5.96,249,1665471600\"; d=\"scan'208\";a=\"306616605\"",
            "E=McAfee;i=\"6500,9779,10562\"; a=\"713230851\"",
            "E=Sophos;i=\"5.96,249,1665471600\"; d=\"scan'208\";a=\"713230851\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com,\n Mingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH 2/7] common/idpf: add RSS set/get ops",
        "Date": "Fri, 16 Dec 2022 09:37:01 +0000",
        "Message-Id": "<20221216093706.2453812-3-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221216093706.2453812-1-mingxia.liu@intel.com>",
        "References": "<20221216093706.2453812-1-mingxia.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "Add support for these device ops:\n- rss_reta_update\n- rss_reta_query\n- rss_hash_update\n- rss_hash_conf_get\n\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n drivers/common/idpf/idpf_common_device.h   |   1 +\n drivers/common/idpf/idpf_common_virtchnl.c | 119 ++++++++\n drivers/common/idpf/idpf_common_virtchnl.h |  15 +-\n drivers/common/idpf/version.map            |   6 +\n drivers/net/idpf/idpf_ethdev.c             | 303 +++++++++++++++++++++\n drivers/net/idpf/idpf_ethdev.h             |   5 +-\n 6 files changed, 445 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h\nindex 5184dcee9f..d7d4cd5363 100644\n--- a/drivers/common/idpf/idpf_common_device.h\n+++ b/drivers/common/idpf/idpf_common_device.h\n@@ -95,6 +95,7 @@ struct idpf_vport {\n \tuint32_t *rss_lut;\n \tuint8_t *rss_key;\n \tuint64_t rss_hf;\n+\tuint64_t last_general_rss_hf;\n \n \t/* MSIX info*/\n \tstruct virtchnl2_queue_vector *qv_map; /* queue vector mapping */\ndiff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c\nindex 80351d15de..ae5a983836 100644\n--- a/drivers/common/idpf/idpf_common_virtchnl.c\n+++ b/drivers/common/idpf/idpf_common_virtchnl.c\n@@ -218,6 +218,9 @@ idpf_execute_vc_cmd(struct idpf_adapter *adapter, struct idpf_cmd_info *args)\n \tcase VIRTCHNL2_OP_ALLOC_VECTORS:\n \tcase VIRTCHNL2_OP_DEALLOC_VECTORS:\n \tcase VIRTCHNL2_OP_GET_STATS:\n+\tcase VIRTCHNL2_OP_GET_RSS_KEY:\n+\tcase VIRTCHNL2_OP_GET_RSS_HASH:\n+\tcase VIRTCHNL2_OP_GET_RSS_LUT:\n \t\t/* for init virtchnl ops, need to poll the response */\n \t\terr = idpf_read_one_msg(adapter, args->ops, args->out_size, args->out_buffer);\n \t\tclear_cmd(adapter);\n@@ -448,6 +451,48 @@ idpf_vc_set_rss_key(struct idpf_vport *vport)\n \treturn err;\n }\n \n+int idpf_vc_get_rss_key(struct idpf_vport *vport)\n+{\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tstruct virtchnl2_rss_key *rss_key_ret;\n+\tstruct virtchnl2_rss_key rss_key;\n+\tstruct idpf_cmd_info args;\n+\tint err;\n+\n+\tmemset(&rss_key, 0, sizeof(rss_key));\n+\trss_key.vport_id = vport->vport_id;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.ops = VIRTCHNL2_OP_GET_RSS_KEY;\n+\targs.in_args = (uint8_t *)&rss_key;\n+\targs.in_args_size = sizeof(rss_key);\n+\targs.out_buffer = adapter->mbx_resp;\n+\targs.out_size = IDPF_DFLT_MBX_BUF_SIZE;\n+\n+\terr = idpf_execute_vc_cmd(adapter, &args);\n+\n+\tif (!err) {\n+\t\trss_key_ret = (struct virtchnl2_rss_key *)args.out_buffer;\n+\t\tif (rss_key_ret->key_len != vport->rss_key_size) {\n+\t\t\trte_free(vport->rss_key);\n+\t\t\tvport->rss_key = NULL;\n+\t\t\tvport->rss_key_size = RTE_MIN(IDPF_RSS_KEY_LEN,\n+\t\t\t\t\t\t      rss_key_ret->key_len);\n+\t\t\tvport->rss_key = rte_zmalloc(\"rss_key\", vport->rss_key_size, 0);\n+\t\t\tif (!vport->rss_key) {\n+\t\t\t\tvport->rss_key_size = 0;\n+\t\t\t\tDRV_LOG(ERR, \"Failed to allocate RSS key\");\n+\t\t\t\treturn -ENOMEM;\n+\t\t\t}\n+\t\t}\n+\t\trte_memcpy(vport->rss_key, rss_key_ret->key, vport->rss_key_size);\n+\t} else {\n+\t\tDRV_LOG(ERR, \"Failed to execute command of VIRTCHNL2_OP_GET_RSS_KEY\");\n+\t}\n+\n+\treturn err;\n+}\n+\n int\n idpf_vc_set_rss_lut(struct idpf_vport *vport)\n {\n@@ -482,6 +527,48 @@ idpf_vc_set_rss_lut(struct idpf_vport *vport)\n \treturn err;\n }\n \n+int\n+idpf_vc_get_rss_lut(struct idpf_vport *vport)\n+{\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tstruct virtchnl2_rss_lut *rss_lut_ret;\n+\tstruct virtchnl2_rss_lut rss_lut;\n+\tstruct idpf_cmd_info args;\n+\tint err;\n+\n+\tmemset(&rss_lut, 0, sizeof(rss_lut));\n+\trss_lut.vport_id = vport->vport_id;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.ops = VIRTCHNL2_OP_GET_RSS_LUT;\n+\targs.in_args = (uint8_t *)&rss_lut;\n+\targs.in_args_size = sizeof(rss_lut);\n+\targs.out_buffer = adapter->mbx_resp;\n+\targs.out_size = IDPF_DFLT_MBX_BUF_SIZE;\n+\n+\terr = idpf_execute_vc_cmd(adapter, &args);\n+\n+\tif (!err) {\n+\t\trss_lut_ret = (struct virtchnl2_rss_lut *)args.out_buffer;\n+\t\tif (rss_lut_ret->lut_entries != vport->rss_lut_size) {\n+\t\t\trte_free(vport->rss_lut);\n+\t\t\tvport->rss_lut = NULL;\n+\t\t\tvport->rss_lut = rte_zmalloc(\"rss_lut\",\n+\t\t\t\t     sizeof(uint32_t) * rss_lut_ret->lut_entries, 0);\n+\t\t\tif (vport->rss_lut == NULL) {\n+\t\t\t\tDRV_LOG(ERR, \"Failed to allocate RSS lut\");\n+\t\t\t\treturn -ENOMEM;\n+\t\t\t}\n+\t\t}\n+\t\trte_memcpy(vport->rss_lut, rss_lut_ret->lut, rss_lut_ret->lut_entries);\n+\t\tvport->rss_lut_size = rss_lut_ret->lut_entries;\n+\t} else {\n+\t\tDRV_LOG(ERR, \"Failed to execute command of VIRTCHNL2_OP_GET_RSS_LUT\");\n+\t}\n+\n+\treturn err;\n+}\n+\n int\n idpf_vc_set_rss_hash(struct idpf_vport *vport)\n {\n@@ -508,6 +595,38 @@ idpf_vc_set_rss_hash(struct idpf_vport *vport)\n \treturn err;\n }\n \n+int\n+idpf_vc_get_rss_hash(struct idpf_vport *vport)\n+{\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tstruct virtchnl2_rss_hash *rss_hash_ret;\n+\tstruct virtchnl2_rss_hash rss_hash;\n+\tstruct idpf_cmd_info args;\n+\tint err;\n+\n+\tmemset(&rss_hash, 0, sizeof(rss_hash));\n+\trss_hash.ptype_groups = vport->rss_hf;\n+\trss_hash.vport_id = vport->vport_id;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.ops = VIRTCHNL2_OP_GET_RSS_HASH;\n+\targs.in_args = (uint8_t *)&rss_hash;\n+\targs.in_args_size = sizeof(rss_hash);\n+\targs.out_buffer = adapter->mbx_resp;\n+\targs.out_size = IDPF_DFLT_MBX_BUF_SIZE;\n+\n+\terr = idpf_execute_vc_cmd(adapter, &args);\n+\n+\tif (!err) {\n+\t\trss_hash_ret = (struct virtchnl2_rss_hash *)args.out_buffer;\n+\t\tvport->rss_hf = rss_hash_ret->ptype_groups;\n+\t} else {\n+\t\tDRV_LOG(ERR, \"Failed to execute command of OP_GET_RSS_HASH\");\n+\t}\n+\n+\treturn err;\n+}\n+\n int\n idpf_vc_config_irq_map_unmap(struct idpf_vport *vport, uint16_t nb_rxq, bool map)\n {\ndiff --git a/drivers/common/idpf/idpf_common_virtchnl.h b/drivers/common/idpf/idpf_common_virtchnl.h\nindex 60347fe571..b5d245a64f 100644\n--- a/drivers/common/idpf/idpf_common_virtchnl.h\n+++ b/drivers/common/idpf/idpf_common_virtchnl.h\n@@ -13,9 +13,6 @@ int idpf_vc_get_caps(struct idpf_adapter *adapter);\n int idpf_vc_create_vport(struct idpf_vport *vport,\n \t\t\t struct virtchnl2_create_vport *vport_info);\n int idpf_vc_destroy_vport(struct idpf_vport *vport);\n-int idpf_vc_set_rss_key(struct idpf_vport *vport);\n-int idpf_vc_set_rss_lut(struct idpf_vport *vport);\n-int idpf_vc_set_rss_hash(struct idpf_vport *vport);\n int idpf_vc_config_irq_map_unmap(struct idpf_vport *vport,\n \t\t\t\t uint16_t nb_rxq, bool map);\n int idpf_vc_query_ptype_info(struct idpf_adapter *adapter);\n@@ -41,4 +38,16 @@ int idpf_vc_config_txq(struct idpf_vport *vport, struct idpf_tx_queue *txq);\n __rte_internal\n int idpf_query_stats(struct idpf_vport *vport,\n \t\t     struct virtchnl2_vport_stats **pstats);\n+__rte_internal\n+int idpf_vc_set_rss_key(struct idpf_vport *vport);\n+__rte_internal\n+int idpf_vc_get_rss_key(struct idpf_vport *vport);\n+__rte_internal\n+int idpf_vc_set_rss_lut(struct idpf_vport *vport);\n+__rte_internal\n+int idpf_vc_get_rss_lut(struct idpf_vport *vport);\n+__rte_internal\n+int idpf_vc_set_rss_hash(struct idpf_vport *vport);\n+__rte_internal\n+int idpf_vc_get_rss_hash(struct idpf_vport *vport);\n #endif /* _IDPF_COMMON_VIRTCHNL_H_ */\ndiff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map\nindex 6a1dc13302..cba08c6b4a 100644\n--- a/drivers/common/idpf/version.map\n+++ b/drivers/common/idpf/version.map\n@@ -52,6 +52,12 @@ INTERNAL {\n \tidpf_splitq_xmit_pkts_avx512;\n \tidpf_update_stats;\n \tidpf_query_stats;\n+\tidpf_vc_set_rss_key;\n+\tidpf_vc_get_rss_key;\n+\tidpf_vc_set_rss_lut;\n+\tidpf_vc_get_rss_lut;\n+\tidpf_vc_set_rss_hash;\n+\tidpf_vc_get_rss_hash;\n \n \tlocal: *;\n };\ndiff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c\nindex 1b1b0f30fd..0d370ace4a 100644\n--- a/drivers/net/idpf/idpf_ethdev.c\n+++ b/drivers/net/idpf/idpf_ethdev.c\n@@ -29,6 +29,56 @@ static const char * const idpf_valid_args[] = {\n \tNULL\n };\n \n+static const uint64_t idpf_map_hena_rss[] = {\n+\t[IDPF_HASH_NONF_UNICAST_IPV4_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_UDP,\n+\t[IDPF_HASH_NONF_MULTICAST_IPV4_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_UDP,\n+\t[IDPF_HASH_NONF_IPV4_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_UDP,\n+\t[IDPF_HASH_NONF_IPV4_TCP_SYN_NO_ACK] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_TCP,\n+\t[IDPF_HASH_NONF_IPV4_TCP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_TCP,\n+\t[IDPF_HASH_NONF_IPV4_SCTP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_SCTP,\n+\t[IDPF_HASH_NONF_IPV4_OTHER] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV4_OTHER,\n+\t[IDPF_HASH_FRAG_IPV4] = RTE_ETH_RSS_FRAG_IPV4,\n+\n+\t/* IPv6 */\n+\t[IDPF_HASH_NONF_UNICAST_IPV6_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_UDP,\n+\t[IDPF_HASH_NONF_MULTICAST_IPV6_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_UDP,\n+\t[IDPF_HASH_NONF_IPV6_UDP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_UDP,\n+\t[IDPF_HASH_NONF_IPV6_TCP_SYN_NO_ACK] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_TCP,\n+\t[IDPF_HASH_NONF_IPV6_TCP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_TCP,\n+\t[IDPF_HASH_NONF_IPV6_SCTP] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_SCTP,\n+\t[IDPF_HASH_NONF_IPV6_OTHER] =\n+\t\t\tRTE_ETH_RSS_NONFRAG_IPV6_OTHER,\n+\t[IDPF_HASH_FRAG_IPV6] = RTE_ETH_RSS_FRAG_IPV6,\n+\n+\t/* L2 Payload */\n+\t[IDPF_HASH_L2_PAYLOAD] = RTE_ETH_RSS_L2_PAYLOAD\n+};\n+\n+static const uint64_t idpf_ipv4_rss = RTE_ETH_RSS_NONFRAG_IPV4_UDP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV4_TCP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV4_SCTP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV4_OTHER |\n+\t\t\t  RTE_ETH_RSS_FRAG_IPV4;\n+\n+static const uint64_t idpf_ipv6_rss = RTE_ETH_RSS_NONFRAG_IPV6_UDP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV6_TCP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV6_SCTP |\n+\t\t\t  RTE_ETH_RSS_NONFRAG_IPV6_OTHER |\n+\t\t\t  RTE_ETH_RSS_FRAG_IPV6;\n+\n static int\n idpf_dev_link_update(struct rte_eth_dev *dev,\n \t\t     __rte_unused int wait_to_complete)\n@@ -59,6 +109,9 @@ idpf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \tdev_info->max_mtu = dev_info->max_rx_pktlen - IDPF_ETH_OVERHEAD;\n \tdev_info->min_mtu = RTE_ETHER_MIN_MTU;\n \n+\tdev_info->hash_key_size = vport->rss_key_size;\n+\tdev_info->reta_size = vport->rss_lut_size;\n+\n \tdev_info->flow_type_rss_offloads = IDPF_RSS_OFFLOAD_ALL;\n \n \tdev_info->rx_offload_capa =\n@@ -211,6 +264,54 @@ idpf_dev_stats_reset(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static int idpf_config_rss_hf(struct idpf_vport *vport, uint64_t rss_hf)\n+{\n+\tuint64_t hena = 0, valid_rss_hf = 0;\n+\tint ret = 0;\n+\tuint16_t i;\n+\n+\t/**\n+\t * RTE_ETH_RSS_IPV4 and RTE_ETH_RSS_IPV6 can be considered as 2\n+\t * generalizations of all other IPv4 and IPv6 RSS types.\n+\t */\n+\tif (rss_hf & RTE_ETH_RSS_IPV4)\n+\t\trss_hf |= idpf_ipv4_rss;\n+\n+\tif (rss_hf & RTE_ETH_RSS_IPV6)\n+\t\trss_hf |= idpf_ipv6_rss;\n+\n+\tfor (i = 0; i < RTE_DIM(idpf_map_hena_rss); i++) {\n+\t\tuint64_t bit = BIT_ULL(i);\n+\n+\t\tif (idpf_map_hena_rss[i] & rss_hf) {\n+\t\t\tvalid_rss_hf |= idpf_map_hena_rss[i];\n+\t\t\thena |= bit;\n+\t\t}\n+\t}\n+\n+\tvport->rss_hf = hena;\n+\n+\tret = idpf_vc_set_rss_hash(vport);\n+\tif (ret != 0) {\n+\t\tPMD_DRV_LOG(WARNING,\n+\t\t\t    \"fail to set RSS offload types, ret: %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tif (valid_rss_hf & idpf_ipv4_rss)\n+\t\tvalid_rss_hf |= rss_hf & RTE_ETH_RSS_IPV4;\n+\n+\tif (valid_rss_hf & idpf_ipv6_rss)\n+\t\tvalid_rss_hf |= rss_hf & RTE_ETH_RSS_IPV6;\n+\n+\tif (rss_hf & ~valid_rss_hf)\n+\t\tPMD_DRV_LOG(WARNING, \"Unsupported rss_hf 0x%\" PRIx64,\n+\t\t\t    rss_hf & ~valid_rss_hf);\n+\tvport->last_general_rss_hf = valid_rss_hf;\n+\n+\treturn ret;\n+}\n+\n static int\n idpf_init_rss(struct idpf_vport *vport)\n {\n@@ -247,6 +348,204 @@ idpf_init_rss(struct idpf_vport *vport)\n \treturn ret;\n }\n \n+static int\n+idpf_rss_reta_update(struct rte_eth_dev *dev,\n+\t\t     struct rte_eth_rss_reta_entry64 *reta_conf,\n+\t\t     uint16_t reta_size)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tuint16_t idx, shift;\n+\tuint32_t *lut;\n+\tint ret = 0;\n+\tuint16_t i;\n+\n+\tif (adapter->caps.rss_caps == 0 || dev->data->nb_rx_queues == 0) {\n+\t\tPMD_DRV_LOG(DEBUG, \"RSS is not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (reta_size != vport->rss_lut_size) {\n+\t\tPMD_DRV_LOG(ERR, \"The size of hash lookup table configured \"\n+\t\t\t\t \"(%d) doesn't match the number of hardware can \"\n+\t\t\t\t \"support (%d)\",\n+\t\t\t    reta_size, vport->rss_lut_size);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* It MUST use the current LUT size to get the RSS lookup table,\n+\t * otherwise if will fail with -100 error code.\n+\t */\n+\tlut = rte_zmalloc(NULL, reta_size * sizeof(uint32_t), 0);\n+\tif (!lut) {\n+\t\tPMD_DRV_LOG(ERR, \"No memory can be allocated\");\n+\t\treturn -ENOMEM;\n+\t}\n+\t/* store the old lut table temporarily */\n+\trte_memcpy(lut, vport->rss_lut, reta_size);\n+\n+\tfor (i = 0; i < reta_size; i++) {\n+\t\tidx = i / RTE_ETH_RETA_GROUP_SIZE;\n+\t\tshift = i % RTE_ETH_RETA_GROUP_SIZE;\n+\t\tif (reta_conf[idx].mask & (1ULL << shift))\n+\t\t\tlut[i] = reta_conf[idx].reta[shift];\n+\t}\n+\n+\trte_memcpy(vport->rss_lut, lut, reta_size);\n+\t/* send virtchnl ops to configure RSS */\n+\tret = idpf_vc_set_rss_lut(vport);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to configure RSS lut\");\n+\t\tgoto out;\n+\t}\n+out:\n+\trte_free(lut);\n+\n+\treturn ret;\n+}\n+\n+static int\n+idpf_rss_reta_query(struct rte_eth_dev *dev,\n+\t\t    struct rte_eth_rss_reta_entry64 *reta_conf,\n+\t\t    uint16_t reta_size)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tuint16_t idx, shift;\n+\tint ret = 0;\n+\tuint16_t i;\n+\n+\tif (adapter->caps.rss_caps == 0 || dev->data->nb_rx_queues == 0) {\n+\t\tPMD_DRV_LOG(DEBUG, \"RSS is not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (reta_size != vport->rss_lut_size) {\n+\t\tPMD_DRV_LOG(ERR, \"The size of hash lookup table configured \"\n+\t\t\t\"(%d) doesn't match the number of hardware can \"\n+\t\t\t\"support (%d)\", reta_size, vport->rss_lut_size);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tret = idpf_vc_get_rss_lut(vport);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to get RSS LUT\");\n+\t\treturn ret;\n+\t}\n+\n+\tfor (i = 0; i < reta_size; i++) {\n+\t\tidx = i / RTE_ETH_RETA_GROUP_SIZE;\n+\t\tshift = i % RTE_ETH_RETA_GROUP_SIZE;\n+\t\tif (reta_conf[idx].mask & (1ULL << shift))\n+\t\t\treta_conf[idx].reta[shift] = vport->rss_lut[i];\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+idpf_rss_hash_update(struct rte_eth_dev *dev,\n+\t\t     struct rte_eth_rss_conf *rss_conf)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tint ret = 0;\n+\n+\tif (adapter->caps.rss_caps == 0 || dev->data->nb_rx_queues == 0) {\n+\t\tPMD_DRV_LOG(DEBUG, \"RSS is not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (!rss_conf->rss_key || rss_conf->rss_key_len == 0) {\n+\t\tPMD_DRV_LOG(DEBUG, \"No key to be configured\");\n+\t\tgoto skip_rss_key;\n+\t} else if (rss_conf->rss_key_len != vport->rss_key_size) {\n+\t\tPMD_DRV_LOG(ERR, \"The size of hash key configured \"\n+\t\t\t\t \"(%d) doesn't match the size of hardware can \"\n+\t\t\t\t \"support (%d)\",\n+\t\t\t    rss_conf->rss_key_len,\n+\t\t\t    vport->rss_key_size);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trte_memcpy(vport->rss_key, rss_conf->rss_key,\n+\t\t   vport->rss_key_size);\n+\tret = idpf_vc_set_rss_key(vport);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to configure RSS key\");\n+\t\treturn ret;\n+\t}\n+\n+skip_rss_key:\n+\tret = idpf_config_rss_hf(vport, rss_conf->rss_hf);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to configure RSS hash\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static uint64_t\n+idpf_map_general_rss_hf(uint64_t config_rss_hf, uint64_t last_general_rss_hf)\n+{\n+\tuint64_t valid_rss_hf = 0;\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < RTE_DIM(idpf_map_hena_rss); i++) {\n+\t\tuint64_t bit = BIT_ULL(i);\n+\n+\t\tif (bit & config_rss_hf)\n+\t\t\tvalid_rss_hf |= idpf_map_hena_rss[i];\n+\t}\n+\n+\tif (valid_rss_hf & idpf_ipv4_rss)\n+\t\tvalid_rss_hf |= last_general_rss_hf & RTE_ETH_RSS_IPV4;\n+\n+\tif (valid_rss_hf & idpf_ipv6_rss)\n+\t\tvalid_rss_hf |= last_general_rss_hf & RTE_ETH_RSS_IPV6;\n+\n+\treturn valid_rss_hf;\n+}\n+\n+static int\n+idpf_rss_hash_conf_get(struct rte_eth_dev *dev,\n+\t\t       struct rte_eth_rss_conf *rss_conf)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_adapter *adapter = vport->adapter;\n+\tint ret = 0;\n+\n+\tif (adapter->caps.rss_caps == 0 || dev->data->nb_rx_queues == 0) {\n+\t\tPMD_DRV_LOG(DEBUG, \"RSS is not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tret = idpf_vc_get_rss_hash(vport);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to get RSS hf\");\n+\t\treturn ret;\n+\t}\n+\n+\trss_conf->rss_hf = idpf_map_general_rss_hf(vport->rss_hf, vport->last_general_rss_hf);\n+\n+\tif (!rss_conf->rss_key)\n+\t\treturn 0;\n+\n+\tret = idpf_vc_get_rss_key(vport);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to get RSS key\");\n+\t\treturn ret;\n+\t}\n+\n+\tif (rss_conf->rss_key_len > vport->rss_key_size)\n+\t\trss_conf->rss_key_len = vport->rss_key_size;\n+\n+\trte_memcpy(rss_conf->rss_key, vport->rss_key, rss_conf->rss_key_len);\n+\n+\treturn 0;\n+}\n+\n static int\n idpf_dev_configure(struct rte_eth_dev *dev)\n {\n@@ -684,6 +983,10 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {\n \t.dev_supported_ptypes_get\t= idpf_dev_supported_ptypes_get,\n \t.stats_get\t\t\t= idpf_dev_stats_get,\n \t.stats_reset\t\t\t= idpf_dev_stats_reset,\n+\t.reta_update\t\t\t= idpf_rss_reta_update,\n+\t.reta_query\t\t\t= idpf_rss_reta_query,\n+\t.rss_hash_update\t\t= idpf_rss_hash_update,\n+\t.rss_hash_conf_get\t\t= idpf_rss_hash_conf_get,\n };\n \n static uint16_t\ndiff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h\nindex 133589cf98..f3e5d4cbd4 100644\n--- a/drivers/net/idpf/idpf_ethdev.h\n+++ b/drivers/net/idpf/idpf_ethdev.h\n@@ -47,7 +47,10 @@\n \t\tRTE_ETH_RSS_NONFRAG_IPV6_TCP    |\t\\\n \t\tRTE_ETH_RSS_NONFRAG_IPV6_UDP    |\t\\\n \t\tRTE_ETH_RSS_NONFRAG_IPV6_SCTP   |\t\\\n-\t\tRTE_ETH_RSS_NONFRAG_IPV6_OTHER)\n+\t\tRTE_ETH_RSS_NONFRAG_IPV6_OTHER  |\t\\\n+\t\tRTE_ETH_RSS_L2_PAYLOAD)\n+\n+#define IDPF_RSS_KEY_LEN 52\n \n #define IDPF_ADAPTER_NAME_LEN\t(PCI_PRI_STR_SIZE + 1)\n \n",
    "prefixes": [
        "2/7"
    ]
}