patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/bonding: fix MTU set for slaves
@ 2022-01-26 13:10 Ferruh Yigit
  2022-01-27  4:07 ` Jiang, YuX
  2022-01-27  9:18 ` Min Hu (Connor)
  0 siblings, 2 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-01-26 13:10 UTC (permalink / raw)
  To: Chas Williams, Min Hu (Connor), Ivan Ilchenko, Andrew Rybchenko
  Cc: dev, Ferruh Yigit, stable, Andrew Rybchenko, yux.jiang

ethdev requires device to be configured before setting MTU.

In bonding PMD, while configuring slaves, bonding first sets MTU later
configures them, which causes failure if slaves are not configured in
advance.

Fixing by changing the order in slave configure as requested in ethdev
layer, configure first and set MTU later.

Bugzilla ID: 864
Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: yux.jiang@intel.com
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 9607141b393e..6fd52035c9a8 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1741,14 +1741,6 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 		}
 	}
 
-	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
-				     bonded_eth_dev->data->mtu);
-	if (errval != 0 && errval != -ENOTSUP) {
-		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
-				slave_eth_dev->data->port_id, errval);
-		return errval;
-	}
-
 	/* Configure device */
 	errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
 			nb_rx_queues, nb_tx_queues,
@@ -1759,6 +1751,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 		return errval;
 	}
 
+	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
+				     bonded_eth_dev->data->mtu);
+	if (errval != 0 && errval != -ENOTSUP) {
+		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
+				slave_eth_dev->data->port_id, errval);
+		return errval;
+	}
+
 	/* Setup Rx Queues */
 	for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) {
 		bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id];
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net/bonding: fix MTU set for slaves
  2022-01-26 13:10 [PATCH] net/bonding: fix MTU set for slaves Ferruh Yigit
@ 2022-01-27  4:07 ` Jiang, YuX
  2022-01-27  9:18 ` Min Hu (Connor)
  1 sibling, 0 replies; 4+ messages in thread
From: Jiang, YuX @ 2022-01-27  4:07 UTC (permalink / raw)
  To: Yigit, Ferruh, Chas Williams, Min Hu (Connor),
	Ivan Ilchenko, Andrew Rybchenko
  Cc: dev, stable, Andrew Rybchenko

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, January 26, 2022 9:11 PM
> To: Chas Williams <chas3@att.com>; Min Hu (Connor)
> <humin29@huawei.com>; Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; stable@dpdk.org;
> Andrew Rybchenko <arybchenko@solarflare.com>; Jiang, YuX
> <yux.jiang@intel.com>
> Subject: [PATCH] net/bonding: fix MTU set for slaves
> 
> ethdev requires device to be configured before setting MTU.
> 
> In bonding PMD, while configuring slaves, bonding first sets MTU later
> configures them, which causes failure if slaves are not configured in advance.
> 
> Fixing by changing the order in slave configure as requested in ethdev layer,
> configure first and set MTU later.
> 
> Bugzilla ID: 864
> Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
Tested-by: Yu Jiang <YuX.Jiang@intel.com>
> Cc: Andrew Rybchenko <arybchenko@solarflare.com>
> Cc: yux.jiang@intel.com
> ---
Verified patchset https://patches.dpdk.org/project/dpdk/patch/20220126131037.2403369-1-ferruh.yigit@intel.com/ on baseline v22.03-rc0's 8a5a91401d .
Tested pass on nic Ethernet Connection X722 for 10GbE SFP+ 37d0/Ubuntu21.10,5.13.0-19-generic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net/bonding: fix MTU set for slaves
  2022-01-26 13:10 [PATCH] net/bonding: fix MTU set for slaves Ferruh Yigit
  2022-01-27  4:07 ` Jiang, YuX
@ 2022-01-27  9:18 ` Min Hu (Connor)
  2022-02-01 11:44   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Min Hu (Connor) @ 2022-01-27  9:18 UTC (permalink / raw)
  To: Ferruh Yigit, Chas Williams, Ivan Ilchenko, Andrew Rybchenko
  Cc: dev, stable, Andrew Rybchenko, yux.jiang

Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2022/1/26 21:10, Ferruh Yigit 写道:
> ethdev requires device to be configured before setting MTU.
> 
> In bonding PMD, while configuring slaves, bonding first sets MTU later
> configures them, which causes failure if slaves are not configured in
> advance.
> 
> Fixing by changing the order in slave configure as requested in ethdev
> layer, configure first and set MTU later.
> 
> Bugzilla ID: 864
> Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Andrew Rybchenko <arybchenko@solarflare.com>
> Cc: yux.jiang@intel.com
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 9607141b393e..6fd52035c9a8 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1741,14 +1741,6 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   		}
>   	}
>   
> -	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
> -				     bonded_eth_dev->data->mtu);
> -	if (errval != 0 && errval != -ENOTSUP) {
> -		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> -		return errval;
> -	}
> -
>   	/* Configure device */
>   	errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
>   			nb_rx_queues, nb_tx_queues,
> @@ -1759,6 +1751,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   		return errval;
>   	}
>   
> +	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
> +				     bonded_eth_dev->data->mtu);
> +	if (errval != 0 && errval != -ENOTSUP) {
> +		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
> +				slave_eth_dev->data->port_id, errval);
> +		return errval;
> +	}
> +
>   	/* Setup Rx Queues */
>   	for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) {
>   		bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id];
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net/bonding: fix MTU set for slaves
  2022-01-27  9:18 ` Min Hu (Connor)
@ 2022-02-01 11:44   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-02-01 11:44 UTC (permalink / raw)
  To: Min Hu (Connor), Chas Williams, Ivan Ilchenko, Andrew Rybchenko
  Cc: dev, stable, Andrew Rybchenko, yux.jiang

On 1/27/2022 9:18 AM, Min Hu (Connor) wrote:

<...>

> 在 2022/1/26 21:10, Ferruh Yigit 写道:
>> ethdev requires device to be configured before setting MTU.
>>
>> In bonding PMD, while configuring slaves, bonding first sets MTU later
>> configures them, which causes failure if slaves are not configured in
>> advance.
>>
>> Fixing by changing the order in slave configure as requested in ethdev
>> layer, configure first and set MTU later.
>>
>> Bugzilla ID: 864
>> Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Tested-by: Yu Jiang <YuX.Jiang@intel.com>
> 
> Acked-by: Min Hu (Connor) <humin29@huawei.com>
> 

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-01 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 13:10 [PATCH] net/bonding: fix MTU set for slaves Ferruh Yigit
2022-01-27  4:07 ` Jiang, YuX
2022-01-27  9:18 ` Min Hu (Connor)
2022-02-01 11:44   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).