> Subject: [PATCH 3/7] net/iavf: fix VLAN outer TPID setting on Tx
> 
> The outer VLAN TPID setting for Tx was cached in the driver but was not
> properly pushed to hardware (via PF) when changed. Add the necessary
> push call to the update function.
> 
> Fixes: 8599d7604e0a ("net/iavf: support QinQ strip")
> Fixes: 7ce1363b424f ("net/iavf: support QinQ insertion")
> Cc: [email protected]
> 
> Signed-off-by: Bruce Richardson <[email protected]>
> ---
>  drivers/net/intel/iavf/iavf_ethdev.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/intel/iavf/iavf_ethdev.c
> b/drivers/net/intel/iavf/iavf_ethdev.c
> index c4a6763f28..126be4c9a5 100644
> --- a/drivers/net/intel/iavf/iavf_ethdev.c
> +++ b/drivers/net/intel/iavf/iavf_ethdev.c
> @@ -1461,13 +1461,17 @@ iavf_vlan_tpid_set(struct rte_eth_dev *dev,
> enum rte_vlan_type vlan_type, uint16
>               return -ENOTSUP;
>       }
> 
> -     /* This API only fills internal iavf_adapter structure
> -      * and does not send any signal to hardware.
> -      * Inner VLAN always 0x8100, so not set explicitly.
> -      */
> +     /* Inner VLAN always 0x8100, so not set explicitly. */
>       if (qinq && vlan_type == RTE_ETH_VLAN_TYPE_OUTER)
>               adapter->tpid = tpid; /* Outer VLAN can be 0x88a8 or 0x8100
> */
> 
> +     /* Re-push insertion, and stripping if already enabled, so the new
> +      * outer TPID reaches the PF instead of only being cached here.
> +      */
> +     iavf_dev_vlan_insert_set(dev);
> +     if (dev_conf->rxmode.offloads &
> RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
> +             iavf_dev_vlan_offload_set(dev,
> RTE_ETH_QINQ_STRIP_MASK);

Should we check the return value of this call and fail if an error is reported?

> +
>       return 0;
>  }
> 
> --
> 2.53.0

Reply via email to