From: Ahmed Zaki <ahmed.z...@intel.com>

Add VIRTCHNL_OP_CONFIG_RSS_HFUNC that allows the iavf to
select the VF's hash function.

Signed-off-by: Ahmed Zaki <ahmed.z...@intel.com>
Signed-off-by: Soumyadeep Hore <soumyadeep.h...@intel.com>
---
 drivers/common/iavf/virtchnl.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 92e323d741..c0d52ddd32 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -122,6 +122,7 @@ enum virtchnl_ops {
        VIRTCHNL_OP_GET_STATS = 15,
        VIRTCHNL_OP_RSVD = 16,
        VIRTCHNL_OP_EVENT = 17, /* must ALWAYS be 17 */
+       VIRTCHNL_OP_CONFIG_RSS_HFUNC = 18,
        /* opcode 19 is reserved */
        /* opcodes 20, 21, and 22 are reserved */
        VIRTCHNL_OP_CONFIG_RSS_KEY = 23,
@@ -1308,6 +1309,21 @@ enum virtchnl_rss_algorithm {
 /* This is used by PF driver to enforce max supported channels */
 #define VIRTCHNL_MAX_QGRPS 16
 
+/* VIRTCHNL_OP_CONFIG_RSS_HFUNC
+ * VF sends this message to configure the RSS hash function. Only supported
+ * if both PF and VF drivers set the VIRTCHNL_VF_OFFLOAD_RSS_PF bit during
+ * configuration negotiation.
+ * The hash function is initialized to VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC
+ * by the PF.
+ */
+struct virtchnl_rss_hfunc {
+       u16 vsi_id;
+       u16 rss_algorithm; /* enum virtchnl_rss_algorithm */
+       u32 reserved;
+};
+
+VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hfunc);
+
 /* VIRTCHNL_OP_ENABLE_CHANNELS
  * VIRTCHNL_OP_DISABLE_CHANNELS
  * VF sends these messages to enable or disable channels based on
@@ -2749,6 +2765,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info 
*ver, u32 v_opcode,
                        valid_len += vrl->lut_entries - 1;
                }
                break;
+       case VIRTCHNL_OP_CONFIG_RSS_HFUNC:
+               valid_len = sizeof(struct virtchnl_rss_hfunc);
+               break;
        case VIRTCHNL_OP_GET_RSS_HENA_CAPS:
                break;
        case VIRTCHNL_OP_SET_RSS_HENA:
-- 
2.34.1

Reply via email to