get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1225076,
    "url": "http://patchwork.ozlabs.org/api/patches/1225076/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200117153919.50321-7-anthony.l.nguyen@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200117153919.50321-7-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-01-17T15:39:18",
    "name": "[S36,7/8] ice: Implement ethtool get/set rx-flow-hash",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5950722474da86597daf0b0d2651b3d6c4802c6e",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200117153919.50321-7-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 153932,
            "url": "http://patchwork.ozlabs.org/api/series/153932/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=153932",
            "date": "2020-01-17T15:39:19",
            "name": "[S36,1/8] ice: Enable writing hardware filtering tables",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/153932/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1225076/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1225076/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 47zyzd2R2Dz9s1x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 18 Jan 2020 11:12:13 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DFDE886A27;\n\tSat, 18 Jan 2020 00:12:11 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id UtvMSPU9_mBJ; Sat, 18 Jan 2020 00:12:08 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B4D228452E;\n\tSat, 18 Jan 2020 00:12:08 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id E83691BF846\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 18 Jan 2020 00:12:05 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id E561D221AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 18 Jan 2020 00:12:05 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 6waNPoByY61X for <intel-wired-lan@lists.osuosl.org>;\n\tSat, 18 Jan 2020 00:12:01 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 3379122610\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 18 Jan 2020 00:11:57 +0000 (UTC)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Jan 2020 16:11:56 -0800",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby orsmga005.jf.intel.com with ESMTP; 17 Jan 2020 16:11:55 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,332,1574150400\"; d=\"scan'208\";a=\"398818589\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 17 Jan 2020 07:39:18 -0800",
        "Message-Id": "<20200117153919.50321-7-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200117153919.50321-1-anthony.l.nguyen@intel.com>",
        "References": "<20200117153919.50321-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S36 7/8] ice: Implement ethtool get/set\n\trx-flow-hash",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>\n\nProvide support to change or retrieve RSS hash options for a flow type.\nThe supported flow-types are: tcp4, tcp6, udp4, udp6, sctp4, sctp6.\n\nSigned-off-by: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 243 +++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_flow.c    |  29 +++\n drivers/net/ethernet/intel/ice/ice_flow.h    |   1 +\n 3 files changed, 273 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex f395457b728f..90c6a3ca20c9 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -4,6 +4,7 @@\n /* ethtool support for ice */\n \n #include \"ice.h\"\n+#include \"ice_flow.h\"\n #include \"ice_lib.h\"\n #include \"ice_dcb_lib.h\"\n \n@@ -2533,6 +2534,243 @@ ice_set_link_ksettings(struct net_device *netdev,\n \treturn err;\n }\n \n+/**\n+ * ice_parse_hdrs - parses headers from RSS hash input\n+ * @nfc: ethtool rxnfc command\n+ *\n+ * This function parses the rxnfc command and returns intended\n+ * header types for RSS configuration\n+ */\n+static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc)\n+{\n+\tu32 hdrs = ICE_FLOW_SEG_HDR_NONE;\n+\n+\tswitch (nfc->flow_type) {\n+\tcase TCP_V4_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV4;\n+\t\tbreak;\n+\tcase UDP_V4_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_IPV4;\n+\t\tbreak;\n+\tcase SCTP_V4_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_IPV4;\n+\t\tbreak;\n+\tcase TCP_V6_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV6;\n+\t\tbreak;\n+\tcase UDP_V6_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_IPV6;\n+\t\tbreak;\n+\tcase SCTP_V6_FLOW:\n+\t\thdrs |= ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_IPV6;\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\treturn hdrs;\n+}\n+\n+#define ICE_FLOW_HASH_FLD_IPV4_SA\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)\n+#define ICE_FLOW_HASH_FLD_IPV6_SA\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)\n+#define ICE_FLOW_HASH_FLD_IPV4_DA\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)\n+#define ICE_FLOW_HASH_FLD_IPV6_DA\tBIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)\n+#define ICE_FLOW_HASH_FLD_TCP_SRC_PORT\tBIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT)\n+#define ICE_FLOW_HASH_FLD_TCP_DST_PORT\tBIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT)\n+#define ICE_FLOW_HASH_FLD_UDP_SRC_PORT\tBIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)\n+#define ICE_FLOW_HASH_FLD_UDP_DST_PORT\tBIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)\n+#define ICE_FLOW_HASH_FLD_SCTP_SRC_PORT\t\\\n+\tBIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)\n+#define ICE_FLOW_HASH_FLD_SCTP_DST_PORT\t\\\n+\tBIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)\n+\n+/**\n+ * ice_parse_hash_flds - parses hash fields from RSS hash input\n+ * @nfc: ethtool rxnfc command\n+ *\n+ * This function parses the rxnfc command and returns intended\n+ * hash fields for RSS configuration\n+ */\n+static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc)\n+{\n+\tu64 hfld = ICE_HASH_INVALID;\n+\n+\tif (nfc->data & RXH_IP_SRC || nfc->data & RXH_IP_DST) {\n+\t\tswitch (nfc->flow_type) {\n+\t\tcase TCP_V4_FLOW:\n+\t\tcase UDP_V4_FLOW:\n+\t\tcase SCTP_V4_FLOW:\n+\t\t\tif (nfc->data & RXH_IP_SRC)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_IPV4_SA;\n+\t\t\tif (nfc->data & RXH_IP_DST)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_IPV4_DA;\n+\t\t\tbreak;\n+\t\tcase TCP_V6_FLOW:\n+\t\tcase UDP_V6_FLOW:\n+\t\tcase SCTP_V6_FLOW:\n+\t\t\tif (nfc->data & RXH_IP_SRC)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_IPV6_SA;\n+\t\t\tif (nfc->data & RXH_IP_DST)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_IPV6_DA;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tif (nfc->data & RXH_L4_B_0_1 || nfc->data & RXH_L4_B_2_3) {\n+\t\tswitch (nfc->flow_type) {\n+\t\tcase TCP_V4_FLOW:\n+\t\tcase TCP_V6_FLOW:\n+\t\t\tif (nfc->data & RXH_L4_B_0_1)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_TCP_SRC_PORT;\n+\t\t\tif (nfc->data & RXH_L4_B_2_3)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_TCP_DST_PORT;\n+\t\t\tbreak;\n+\t\tcase UDP_V4_FLOW:\n+\t\tcase UDP_V6_FLOW:\n+\t\t\tif (nfc->data & RXH_L4_B_0_1)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_UDP_SRC_PORT;\n+\t\t\tif (nfc->data & RXH_L4_B_2_3)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_UDP_DST_PORT;\n+\t\t\tbreak;\n+\t\tcase SCTP_V4_FLOW:\n+\t\tcase SCTP_V6_FLOW:\n+\t\t\tif (nfc->data & RXH_L4_B_0_1)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_SCTP_SRC_PORT;\n+\t\t\tif (nfc->data & RXH_L4_B_2_3)\n+\t\t\t\thfld |= ICE_FLOW_HASH_FLD_SCTP_DST_PORT;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn hfld;\n+}\n+\n+/**\n+ * ice_set_rss_hash_opt - Enable/Disable flow types for RSS hash\n+ * @vsi: the VSI being configured\n+ * @nfc: ethtool rxnfc command\n+ *\n+ * Returns Success if the flow input set is supported.\n+ */\n+static int\n+ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\tenum ice_status status;\n+\tstruct device *dev;\n+\tu64 hashed_flds;\n+\tu32 hdrs;\n+\n+\tdev = ice_pf_to_dev(pf);\n+\tif (ice_is_safe_mode(pf)) {\n+\t\tdev_dbg(dev, \"Advanced RSS disabled. Package download failed, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\thashed_flds = ice_parse_hash_flds(nfc);\n+\tif (hashed_flds == ICE_HASH_INVALID) {\n+\t\tdev_dbg(dev, \"Invalid hash fields, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\thdrs = ice_parse_hdrs(nfc);\n+\tif (hdrs == ICE_FLOW_SEG_HDR_NONE) {\n+\t\tdev_dbg(dev, \"Header type is not valid, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tstatus = ice_add_rss_cfg(&pf->hw, vsi->idx, hashed_flds, hdrs);\n+\tif (status) {\n+\t\tdev_dbg(dev, \"ice_add_rss_cfg failed, vsi num = %d, error = %d\\n\",\n+\t\t\tvsi->vsi_num, status);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_get_rss_hash_opt - Retrieve hash fields for a given flow-type\n+ * @vsi: the VSI being configured\n+ * @nfc: ethtool rxnfc command\n+ */\n+static void\n+ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n+\tu64 hash_flds;\n+\tu32 hdrs;\n+\n+\tdev = ice_pf_to_dev(pf);\n+\n+\tnfc->data = 0;\n+\tif (ice_is_safe_mode(pf)) {\n+\t\tdev_dbg(dev, \"Advanced RSS disabled. Package download failed, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn;\n+\t}\n+\n+\thdrs = ice_parse_hdrs(nfc);\n+\tif (hdrs == ICE_FLOW_SEG_HDR_NONE) {\n+\t\tdev_dbg(dev, \"Header type is not valid, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn;\n+\t}\n+\n+\thash_flds = ice_get_rss_cfg(&pf->hw, vsi->idx, hdrs);\n+\tif (hash_flds == ICE_HASH_INVALID) {\n+\t\tdev_dbg(dev, \"No hash fields found for the given header type, vsi num = %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\treturn;\n+\t}\n+\n+\tif (hash_flds & ICE_FLOW_HASH_FLD_IPV4_SA ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_IPV6_SA)\n+\t\tnfc->data |= (u64)RXH_IP_SRC;\n+\n+\tif (hash_flds & ICE_FLOW_HASH_FLD_IPV4_DA ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_IPV6_DA)\n+\t\tnfc->data |= (u64)RXH_IP_DST;\n+\n+\tif (hash_flds & ICE_FLOW_HASH_FLD_TCP_SRC_PORT ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_UDP_SRC_PORT ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_SCTP_SRC_PORT)\n+\t\tnfc->data |= (u64)RXH_L4_B_0_1;\n+\n+\tif (hash_flds & ICE_FLOW_HASH_FLD_TCP_DST_PORT ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_UDP_DST_PORT ||\n+\t    hash_flds & ICE_FLOW_HASH_FLD_SCTP_DST_PORT)\n+\t\tnfc->data |= (u64)RXH_L4_B_2_3;\n+}\n+\n+/**\n+ * ice_set_rxnfc - command to set Rx flow rules.\n+ * @netdev: network interface device structure\n+ * @cmd: ethtool rxnfc command\n+ *\n+ * Returns 0 for success and negative values for errors\n+ */\n+static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)\n+{\n+\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n+\tstruct ice_vsi *vsi = np->vsi;\n+\n+\tswitch (cmd->cmd) {\n+\tcase ETHTOOL_SRXFH:\n+\t\treturn ice_set_rss_hash_opt(vsi, cmd);\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\treturn -EOPNOTSUPP;\n+}\n+\n /**\n  * ice_get_rxnfc - command to get Rx flow classification rules\n  * @netdev: network interface device structure\n@@ -2554,6 +2792,10 @@ ice_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,\n \t\tcmd->data = vsi->rss_size;\n \t\tret = 0;\n \t\tbreak;\n+\tcase ETHTOOL_GRXFH:\n+\t\tice_get_rss_hash_opt(vsi, cmd);\n+\t\tret = 0;\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n@@ -3857,6 +4099,7 @@ static const struct ethtool_ops ice_ethtool_ops = {\n \t.set_priv_flags\t\t= ice_set_priv_flags,\n \t.get_sset_count\t\t= ice_get_sset_count,\n \t.get_rxnfc\t\t= ice_get_rxnfc,\n+\t.set_rxnfc\t\t= ice_set_rxnfc,\n \t.get_ringparam\t\t= ice_get_ringparam,\n \t.set_ringparam\t\t= ice_set_ringparam,\n \t.nway_reset\t\t= ice_nway_reset,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c\nindex d160695c22e0..1a0bad4cd5f3 100644\n--- a/drivers/net/ethernet/intel/ice/ice_flow.c\n+++ b/drivers/net/ethernet/intel/ice/ice_flow.c\n@@ -1244,3 +1244,32 @@ enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle)\n \n \treturn status;\n }\n+\n+/**\n+ * ice_get_rss_cfg - returns hashed fields for the given header types\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: software VSI handle\n+ * @hdrs: protocol header type\n+ *\n+ * This function will return the match fields of the first instance of flow\n+ * profile having the given header types and containing input VSI\n+ */\n+u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs)\n+{\n+\tstruct ice_rss_cfg *r, *rss_cfg = NULL;\n+\n+\t/* verify if the protocol header is non zero and VSI is valid */\n+\tif (hdrs == ICE_FLOW_SEG_HDR_NONE || !ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_HASH_INVALID;\n+\n+\tmutex_lock(&hw->rss_locks);\n+\tlist_for_each_entry(r, &hw->rss_list_head, l_entry)\n+\t\tif (test_bit(vsi_handle, r->vsis) &&\n+\t\t    r->packet_hdr == hdrs) {\n+\t\t\trss_cfg = r;\n+\t\t\tbreak;\n+\t\t}\n+\tmutex_unlock(&hw->rss_locks);\n+\n+\treturn rss_cfg ? rss_cfg->hashed_flds : ICE_HASH_INVALID;\n+}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h\nindex 475a025d3a2d..5558627bd5eb 100644\n--- a/drivers/net/ethernet/intel/ice/ice_flow.h\n+++ b/drivers/net/ethernet/intel/ice/ice_flow.h\n@@ -203,4 +203,5 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle);\n enum ice_status\n ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t\tu32 addl_hdrs);\n+u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs);\n #endif /* _ICE_FLOW_H_ */\n",
    "prefixes": [
        "S36",
        "7/8"
    ]
}