[v2] net/iavf: initialize large VF setting at startup

Message ID 20220210104914.5444-1-ghalem.boudour@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: initialize large VF setting at startup |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Ghalem Boudour Feb. 10, 2022, 10:49 a.m. UTC
  lv_enabled is used to remember if large VF setting is configured, but
its value is not initialized at startup. This can lead to a different
configuration regarding the initial configuration of the PF.
For example, a first start is done with 8 rx and 8 tx queues. Large VF
is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required
and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed
but reta size is 256 as the PF has been configured during the second
start.

In order to have a consistent behavior regarding reta size whatever
the configuration of the PF (may be changed by a previous boot) the
lv_enabled must be set properly at the init phase.

Signed-off-by: Ghalem Boudour <ghalem.boudour@6wind.com>
Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
---
v2:
* Enable large VF at initialization independently of rss configuration
---
 drivers/net/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Xu, Ting Feb. 10, 2022, 2:17 p.m. UTC | #1
> -----Original Message-----
> From: Ghalem Boudour <ghalem.boudour@6wind.com>
> Sent: Thursday, February 10, 2022 6:49 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Xu, Ting <ting.xu@intel.com>; Ghalem Boudour
> <ghalem.boudour@6wind.com>; Thibaut Collet <thibaut.collet@6wind.com>;
> Olivier Matz <olivier.matz@6wind.com>
> Subject: [PATCH v2] net/iavf: initialize large VF setting at startup
> 
> lv_enabled is used to remember if large VF setting is configured, but its value
> is not initialized at startup. This can lead to a different configuration
> regarding the initial configuration of the PF.
> For example, a first start is done with 8 rx and 8 tx queues. Large VF is not
> needed and reta size is 64.
> A second start is done with 20 rx and tx queues. Large VF is required and reta
> size is 256.
> A third start is done with 2 rx and tx queues. Large VF is not needed but reta
> size is 256 as the PF has been configured during the second start.
> 
> In order to have a consistent behavior regarding reta size whatever the
> configuration of the PF (may be changed by a previous boot) the lv_enabled
> must be set properly at the init phase.
> 
> Signed-off-by: Ghalem Boudour <ghalem.boudour@6wind.com>
> Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
> ---
> v2:
> * Enable large VF at initialization independently of rss configuration
> ---
>  drivers/net/iavf/iavf_ethdev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 79397f15e54f..d6190ac24ac6 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -2278,6 +2278,9 @@ iavf_init_vf(struct rte_eth_dev *dev)
>  		}
>  	}
> 
> +	if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
> +		vf->lv_enabled = true;
> +
>  	if (vf->vf_res->vf_cap_flags &
> VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
>  		if (iavf_get_supported_rxdid(adapter) != 0) {
>  			PMD_INIT_LOG(ERR, "failed to do get supported
> rxdid");
> --
> 2.30.2

Acked-by: Ting Xu <ting.xu@intel.com>
  
Qi Zhang Feb. 11, 2022, 1:28 a.m. UTC | #2
> -----Original Message-----
> From: Xu, Ting <ting.xu@intel.com>
> Sent: Thursday, February 10, 2022 10:17 PM
> To: Ghalem Boudour <ghalem.boudour@6wind.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Thibaut Collet <thibaut.collet@6wind.com>; Olivier Matz
> <olivier.matz@6wind.com>
> Subject: RE: [PATCH v2] net/iavf: initialize large VF setting at startup
> 
> > -----Original Message-----
> > From: Ghalem Boudour <ghalem.boudour@6wind.com>
> > Sent: Thursday, February 10, 2022 6:49 PM
> > To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Cc: dev@dpdk.org; Xu, Ting <ting.xu@intel.com>; Ghalem Boudour
> > <ghalem.boudour@6wind.com>; Thibaut Collet
> <thibaut.collet@6wind.com>;
> > Olivier Matz <olivier.matz@6wind.com>
> > Subject: [PATCH v2] net/iavf: initialize large VF setting at startup
> >
> > lv_enabled is used to remember if large VF setting is configured, but
> > its value is not initialized at startup. This can lead to a different
> > configuration regarding the initial configuration of the PF.
> > For example, a first start is done with 8 rx and 8 tx queues. Large VF
> > is not needed and reta size is 64.
> > A second start is done with 20 rx and tx queues. Large VF is required
> > and reta size is 256.
> > A third start is done with 2 rx and tx queues. Large VF is not needed
> > but reta size is 256 as the PF has been configured during the second start.
> >
> > In order to have a consistent behavior regarding reta size whatever
> > the configuration of the PF (may be changed by a previous boot) the
> > lv_enabled must be set properly at the init phase.
> >
> > Signed-off-by: Ghalem Boudour <ghalem.boudour@6wind.com>
> > Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
> > Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
> > ---
> > v2:
> > * Enable large VF at initialization independently of rss configuration
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 79397f15e54f..d6190ac24ac6
> > 100644
> > --- a/drivers/net/iavf/iavf_ethdev.c
> > +++ b/drivers/net/iavf/iavf_ethdev.c
> > @@ -2278,6 +2278,9 @@ iavf_init_vf(struct rte_eth_dev *dev)
> >  		}
> >  	}
> >
> > +	if (vf->vsi_res->num_queue_pairs >
> IAVF_MAX_NUM_QUEUES_DFLT)
> > +		vf->lv_enabled = true;
> > +
> >  	if (vf->vf_res->vf_cap_flags &
> > VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
> >  		if (iavf_get_supported_rxdid(adapter) != 0) {
> >  			PMD_INIT_LOG(ERR, "failed to do get supported
> rxdid");
> > --
> > 2.30.2
> 
> Acked-by: Ting Xu <ting.xu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 79397f15e54f..d6190ac24ac6 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2278,6 +2278,9 @@  iavf_init_vf(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
+		vf->lv_enabled = true;
+
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
 		if (iavf_get_supported_rxdid(adapter) != 0) {
 			PMD_INIT_LOG(ERR, "failed to do get supported rxdid");