Subject: Re: [PATCH net-next 3/9] bnxt_en: Support QOS and TPID settings for the SRIOV VLAN

From: Simon Horman <[email-masked]>
Date: Mon, 15 Jul 2024 10:17:36 +0100

On Sat, Jul 13, 2024 at 04:43:33PM -0700, Michael Chan wrote:
> From: Sreekanth Reddy <[email-masked]>
> 
> With recent changes in the .ndo_set_vf_*() guidelines, resubmitting
> this patch that was reverted eariler in 2023:
> 
> c27153682eac ("Revert "bnxt_en: Support QOS and TPID settings for the SRIOV VLAN")

I acknowledge there was a policy change and thus
this feature can now be accepted.

- [net-next,v2] docs: net: document guidance of implementing the SR-IOV NDOs
  https://git.kernel.org/netdev/net-next/c/4558645d139c

> 
> Add these missing settings in the .ndo_set_vf_vlan() method.
> Older firmware does not support the TPID setting so check for
> proper support.
> 
> Remove the unused BNXT_VF_QOS flag.
> 
> Signed-off-by: Sreekanth Reddy <[email-masked]>
> Signed-off-by: Michael Chan <[email-masked]>

Reviewed-by: Simon Horman <[email-masked]>

...

> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

...

> @@ -256,21 +254,21 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
>  	if (bp->hwrm_spec_code < 0x10201)
>  		return -ENOTSUPP;
>  
> -	if (vlan_proto != htons(ETH_P_8021Q))
> +	if (vlan_proto != htons(ETH_P_8021Q) &&
> +	    (vlan_proto != htons(ETH_P_8021AD) ||

nit: As a follow-up this could be updated to use eth_type_vlan()

> +	     !(bp->fw_cap & BNXT_FW_CAP_DFLT_VLAN_TPID_PCP)))
>  		return -EPROTONOSUPPORT;
>  
>  	rc = bnxt_vf_ndo_prep(bp, vf_id);
>  	if (rc)
>  		return rc;

...