On 4/18/2024 9:11 PM, Rahul Rameshbabu wrote:

On Thu, 18 Apr, 2024 01:24:52 -0400 Mateusz Polchlopek 
<mateusz.polchlo...@intel.com> wrote:
From: Jacob Keller <jacob.e.kel...@intel.com>

Enable support for VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC, to enable the VF
driver the ability to determine what Rx descriptor formats are
available. This requires sending an additional message during
initialization and reset, the VIRTCHNL_OP_GET_SUPPORTED_RXDIDS. This
operation requests the supported Rx descriptor IDs available from the
PF.

This is treated the same way that VLAN V2 capabilities are handled. Add
a new set of extended capability flags, used to process send and receipt
of the VIRTCHNL_OP_GET_SUPPORTED_RXDIDS message.

This ensures we finish negotiating for the supported descriptor formats
prior to beginning configuration of receive queues.

This change stores the supported format bitmap into the iavf_adapter
structure. Additionally, if VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC is enabled
by the PF, we need to make sure that the Rx queue configuration
specifies the format.

Reviewed-by: Wojciech Drewek <wojciech.dre...@intel.com>
Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com>
Co-developed-by: Mateusz Polchlopek <mateusz.polchlo...@intel.com>
Signed-off-by: Mateusz Polchlopek <mateusz.polchlo...@intel.com>
---
<snip>
@@ -2586,6 +2623,67 @@ static void iavf_init_recv_offload_vlan_v2_caps(struct 
iavf_adapter *adapter)
        iavf_change_state(adapter, __IAVF_INIT_FAILED);
  }
+/**
+ * iavf_init_send_supported_rxdids - part of querying for supported RXDID
+ * formats
+ * @adapter: board private structure
+ *
+ * Function processes send of the request for supported RXDIDs to the PF.
+ * Must clear IAVF_EXTENDED_CAP_RECV_RXDID if the message is not sent, e.g.
+ * due to the PF not negotiating VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC.
+ */
+static void iavf_init_send_supported_rxdids(struct iavf_adapter *adapter)
+{
+       int ret;
+
+       WARN_ON(!(adapter->extended_caps & IAVF_EXTENDED_CAP_SEND_RXDID));
+
+       ret = iavf_send_vf_supported_rxdids_msg(adapter);
+       if (ret && ret == -EOPNOTSUPP) {

Isn't this redundant? The condition can just be "ret == -EOPNOTSUPP"?


Thanks for pointing.

+               /* PF does not support VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC. In this
+                * case, we did not send the capability exchange message and
+                * do not expect a response.
+                */
+               adapter->extended_caps &= ~IAVF_EXTENDED_CAP_RECV_RXDID;
+       }
+
+       /* We sent the message, so move on to the next step */
+       adapter->extended_caps &= ~IAVF_EXTENDED_CAP_SEND_RXDID;
+}
+
<snip>

--
Thanks,

Rahul Rameshbabu

Reply via email to