1 Star 0 Fork 72

叶青龙/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0204-net-bonding-fix-mbuf-fast-free-handling.patch 2.93 KB
一键复制 编辑 原始数据 按行查看 历史
From c90a36013ccaeeb3baf258e4e23120253faee7aa Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 15 Nov 2022 12:06:15 +0800
Subject: net/bonding: fix mbuf fast free handling
[ upstream commit b4924c0db589b5d4698abfab3ce60978d9df518b ]
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 this patch moves the modification of txmode
offlaods to the stage of adding slave device to report the correct txmode
offloads.
Fixes: 18c41457cbae ("net/bonding: fix mbuf fast free usage")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bonding/rte_eth_bond_api.c | 5 +++++
drivers/net/bonding/rte_eth_bond_pmd.c | 11 -----------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index b74477128a..1235573bf2 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -544,6 +544,11 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
return ret;
}
+ /* Bond mode Broadcast & 8023AD don't support MBUF_FAST_FREE offload. */
+ if (internals->mode == BONDING_MODE_8023AD ||
+ internals->mode == BONDING_MODE_BROADCAST)
+ internals->tx_offload_capa &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+
bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
internals->flow_type_rss_offloads;
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 2bf28b829d..29871cf8a3 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3600,7 +3600,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
const char *name = dev->device->name;
struct bond_dev_private *internals = dev->data->dev_private;
struct rte_kvargs *kvlist = internals->kvlist;
- uint64_t offloads;
int arg_count;
uint16_t port_id = dev - rte_eth_devices;
uint32_t link_speeds;
@@ -3652,16 +3651,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
}
}
- offloads = dev->data->dev_conf.txmode.offloads;
- 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;
- }
-
link_speeds = dev->data->dev_conf.link_speeds;
/*
* The default value of 'link_speeds' is zero. From its definition,
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeqinglong01/dpdk.git
git@gitee.com:yeqinglong01/dpdk.git
yeqinglong01
dpdk
dpdk
master

搜索帮助