1 Star 0 Fork 76

mds.lanruo/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0096-net-bonding-fix-mbuf-fast-free-usage.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
liudongdong3 提交于 2022-06-16 16:03 . sync patches from 22.07
From 77eaa2e2b5ae1651abdaa0fb885bc3971e9e0587 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Wed, 25 May 2022 09:08:28 +0800
Subject: [PATCH 096/122] net/bonding: fix mbuf fast free usage
Usage of 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload has two
constraints: per-queue all mbufs comes from the same mempool and
has refcnt = 1.
Bonding mode Broadcast, Tx mbuf has more than one refcnt.
Bonding mode 8023AD, It contains two mempools separately for LACP
packets and other packets. In Tx or Rx, Fast mbuf free will operate
mbuf from different mempool.
This patch will prevent 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload
when in bonding mode Broadcast and mode 8023AD.
Fixes: 78aecefed955 ("bond: move param parsing in configure step")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index c929b55768..0d6f0a30d1 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3563,6 +3563,7 @@ 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;
uint8_t agg_mode;
@@ -3613,6 +3614,16 @@ 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;
+ }
+
/* set the max_rx_pktlen */
internals->max_rx_pktlen = internals->candidate_max_rx_pktlen;
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/dpdk.git
git@gitee.com:mdslanruo/dpdk.git
mdslanruo
dpdk
dpdk
master

搜索帮助