Subject: Re: [Intel-wired-lan] [PATCH iwl-next v5 04/12] iavf: add support for negotiating flexible RXDID format

From: Rahul Rameshbabu <[email-masked]>
Date: Thu, 18 Apr 2024 12:11:01 -0700

On Thu, 18 Apr, 2024 01:24:52 -0400 Mateusz Polchlopek <[email-masked]> wrote:
> From: Jacob Keller <[email-masked]>
>
> 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 <[email-masked]>
> Signed-off-by: Jacob Keller <[email-masked]>
> Co-developed-by: Mateusz Polchlopek <[email-masked]>
> Signed-off-by: Mateusz Polchlopek <[email-masked]>
> ---
<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"?

> +		/* 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