[1/2] net/bonding: fix bond3 and bond4 process mbuf fast free

Message ID 20221108084038.25136-2-lihuisong@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Andrew Rybchenko
Headers
Series net/bonding: fix mbuf fast free for bond3 and bond4 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

lihuisong (C) Nov. 8, 2022, 8:40 a.m. UTC
  The RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE offload can't be used in bonding
mode Broadcast and mode 8023AD. Currently, bonding driver forcibly removes
from the dev->data->dev_conf.txmode.offloads and processes as success in
bond_ethdev_configure(). But this still cause that rte_eth_dev_configure()
fails to execute because of the failure of validating Tx offload in the
eth_dev_validate_offloads(). So bonding driver shouldn't modify offloads
in dev->data->dev_conf.txmode and should return error in this case.

Fixes: 18c41457cbae ("net/bonding: fix mbuf fast free usage")
Cc: stable@dpdk.org

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

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 864e073db8..b5e832276a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3712,10 +3712,8 @@  bond_ethdev_configure(struct rte_eth_dev *dev)
 	if ((offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) &&
 			(internals->mode == BONDING_MODE_8023AD ||
 			internals->mode == BONDING_MODE_BROADCAST)) {
-		RTE_BOND_LOG(WARNING,
-			"bond mode broadcast & 8023AD don't support MBUF_FAST_FREE offload, force disable it.");
-		offloads &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
-		dev->data->dev_conf.txmode.offloads = offloads;
+		RTE_BOND_LOG(ERR, "bond mode broadcast & 8023AD don't support MBUF_FAST_FREE offload.");
+		return -EINVAL;
 	}
 
 	link_speeds = dev->data->dev_conf.link_speeds;