[dpdk-dev] [dpdk-stable] [PATCH] net/bonding: do not inherit slave device configuration

Ferruh Yigit ferruh.yigit at intel.com
Tue Nov 19 13:18:47 CET 2019


On 11/19/2019 9:03 AM, Andrew Rybchenko wrote:
> Bonding device should control bonded devices configuration.
> 
> Also avoid usage of slave's data->dev_conf.
> 
> Fixes: 2efb58cbab6e ("bond: new link bonding library")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 707a0f3cdd..4f0e83205d 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1679,6 +1679,7 @@ int
>  slave_configure(struct rte_eth_dev *bonded_eth_dev,
>  		struct rte_eth_dev *slave_eth_dev)
>  {
> +	struct rte_eth_conf dev_conf;
>  	struct bond_rx_queue *bd_rx_q;
>  	struct bond_tx_queue *bd_tx_q;
>  	uint16_t nb_rx_queues;
> @@ -1693,34 +1694,34 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>  	/* Stop slave */
>  	rte_eth_dev_stop(slave_eth_dev->data->port_id);
>  
> +	memset(&dev_conf, 0, sizeof(dev_conf));
> +
>  	/* Enable interrupts on slave device if supported */
>  	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
> -		slave_eth_dev->data->dev_conf.intr_conf.lsc = 1;
> +		dev_conf.intr_conf.lsc = 1;

I assume the original intention is making incremental changes to the existing
slave configuration, if so we should copy the 'slave_eth_dev->data->dev_conf' to
'dev_conf' before start updating it.




More information about the dev mailing list