net/bonding: fix slave device Rx/Tx offload configuration

Message ID 20221028023646.32585-1-lihuisong@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series net/bonding: fix slave device Rx/Tx offload configuration |

Checks

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

Commit Message

lihuisong (C) Oct. 28, 2022, 2:36 a.m. UTC
  Normally, the Rx/Tx offload capability of bonding interface is
the intersection of the capability of all slave devices. And
Rx/Tx offloads configuration of slave device comes from bonding
interface. But now there is a risk that slave device retains its
previous offload configurations which is not within the offload
configurations of bond interface.

Fixes: 57b156540f51 ("net/bonding: fix offloading configuration")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
  

Comments

humin (Q) Nov. 1, 2022, 2:34 a.m. UTC | #1
Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2022/10/28 10:36, Huisong Li 写道:
> Normally, the Rx/Tx offload capability of bonding interface is
> the intersection of the capability of all slave devices. And
> Rx/Tx offloads configuration of slave device comes from bonding
> interface. But now there is a risk that slave device retains its
> previous offload configurations which is not within the offload
> configurations of bond interface.
>
> Fixes: 57b156540f51 ("net/bonding: fix offloading configuration")
> Cc: stable@dpdk.org
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 17 ++++-------------
>   1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index dc74852137..ca87490065 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1741,20 +1741,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   	slave_eth_dev->data->dev_conf.link_speeds =
>   			bonded_eth_dev->data->dev_conf.link_speeds;
>   
> -	slave_eth_dev->data->dev_conf.txmode.offloads |=
> -		bonded_eth_dev->data->dev_conf.txmode.offloads;
> -
> -	slave_eth_dev->data->dev_conf.txmode.offloads &=
> -		(bonded_eth_dev->data->dev_conf.txmode.offloads |
> -		~internals->tx_offload_capa);
> -
> -	slave_eth_dev->data->dev_conf.rxmode.offloads |=
> -		bonded_eth_dev->data->dev_conf.rxmode.offloads;
> -
> -	slave_eth_dev->data->dev_conf.rxmode.offloads &=
> -		(bonded_eth_dev->data->dev_conf.rxmode.offloads |
> -		~internals->rx_offload_capa);
> +	slave_eth_dev->data->dev_conf.txmode.offloads =
> +			bonded_eth_dev->data->dev_conf.txmode.offloads;
>   
> +	slave_eth_dev->data->dev_conf.rxmode.offloads =
> +			bonded_eth_dev->data->dev_conf.rxmode.offloads;
>   
>   	nb_rx_queues = bonded_eth_dev->data->nb_rx_queues;
>   	nb_tx_queues = bonded_eth_dev->data->nb_tx_queues;
  
Andrew Rybchenko Nov. 6, 2022, 9:45 a.m. UTC | #2
On 11/1/22 05:34, humin (Q) wrote:
> 在 2022/10/28 10:36, Huisong Li 写道:
>> Normally, the Rx/Tx offload capability of bonding interface is
>> the intersection of the capability of all slave devices. And
>> Rx/Tx offloads configuration of slave device comes from bonding
>> interface. But now there is a risk that slave device retains its
>> previous offload configurations which is not within the offload
>> configurations of bond interface.
>>
>> Fixes: 57b156540f51 ("net/bonding: fix offloading configuration")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
 >
 > Acked-by: Min Hu (Connor) <humin29@huawei.com>

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

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index dc74852137..ca87490065 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1741,20 +1741,11 @@  slave_configure(struct rte_eth_dev *bonded_eth_dev,
 	slave_eth_dev->data->dev_conf.link_speeds =
 			bonded_eth_dev->data->dev_conf.link_speeds;
 
-	slave_eth_dev->data->dev_conf.txmode.offloads |=
-		bonded_eth_dev->data->dev_conf.txmode.offloads;
-
-	slave_eth_dev->data->dev_conf.txmode.offloads &=
-		(bonded_eth_dev->data->dev_conf.txmode.offloads |
-		~internals->tx_offload_capa);
-
-	slave_eth_dev->data->dev_conf.rxmode.offloads |=
-		bonded_eth_dev->data->dev_conf.rxmode.offloads;
-
-	slave_eth_dev->data->dev_conf.rxmode.offloads &=
-		(bonded_eth_dev->data->dev_conf.rxmode.offloads |
-		~internals->rx_offload_capa);
+	slave_eth_dev->data->dev_conf.txmode.offloads =
+			bonded_eth_dev->data->dev_conf.txmode.offloads;
 
+	slave_eth_dev->data->dev_conf.rxmode.offloads =
+			bonded_eth_dev->data->dev_conf.rxmode.offloads;
 
 	nb_rx_queues = bonded_eth_dev->data->nb_rx_queues;
 	nb_tx_queues = bonded_eth_dev->data->nb_tx_queues;