diff mbox series

net/bonding: fix offloading configuration

Message ID 20211109075726.59611-1-humin29@huawei.com (mailing list archive)
State New
Delegated to: Ferruh Yigit
Headers show
Series net/bonding: fix offloading configuration | expand


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

Commit Message

humin (Q) Nov. 9, 2021, 7:57 a.m. UTC
From: Chengchang Tang <tangchengchang@huawei.com>

Currently, part offloadings of the bonding device will not take effect
by using dev_configure(). Because the related configuration will not be
delivered to the slave devices in this way.

The offloading capability of the bonding device is the intersection of
the capability of all slave devices. Based on this, the following functions
are added to the bonding driver:
1. If a Tx offloading is within the capability of the bonding device (i.e,
all the slave devices support this Tx offloading), the enabling status of
the offloading of all slave devices depends on the configuration of the
bonding device.

2. For the Tx offloading that is not within the Tx offloading capability
of the bonding device, the enabling status of the offloading on the slave
devices is irrelevant to the bonding device configuration. And it depends
on the original configuration of the slave devices.

Fixes: e8b3e1a9b1bb ("net/bonding: switch to new offloading API")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
 drivers/net/bonding/rte_eth_bond_pmd.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
diff mbox series


diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 9bbe1291bc..5d7c25d2fb 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1713,17 +1713,24 @@  slave_configure(struct rte_eth_dev *bonded_eth_dev,
-	if (bonded_eth_dev->data->dev_conf.rxmode.offloads &
-		slave_eth_dev->data->dev_conf.rxmode.offloads |=
-	else
-		slave_eth_dev->data->dev_conf.rxmode.offloads &=
 	slave_eth_dev->data->dev_conf.rxmode.mtu =
+	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);
 	nb_rx_queues = bonded_eth_dev->data->nb_rx_queues;
 	nb_tx_queues = bonded_eth_dev->data->nb_tx_queues;