代码拉取完成,页面将自动刷新
同步操作将从 compile_success/gazelle_kylin_src 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4667dcdd7c262d7789b74eb4fb0675af4e0fbf7c Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Wed, 28 Jun 2023 09:08:53 +0000
Subject: [PATCH] bond4 add dpdk return value check
---
src/lstack/core/lstack_dpdk.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
index f6cabf8..cd42047 100644
--- a/src/lstack/core/lstack_dpdk.c
+++ b/src/lstack/core/lstack_dpdk.c
@@ -490,7 +490,16 @@ int32_t dpdk_ethdev_init(int port_id, bool bond_port)
int slave_num = 2;
int32_t slave_port_id[2];
slave_port_id[0] = ethdev_port_id(get_global_cfg_params()->bond4_slave1_mac_addr);
+ if (slave_port_id[0] < 0) {
+ LSTACK_LOG(ERR, LSTACK, "get slave port id failed port = %d\n", slave_port_id[0]);
+ return slave_port_id[0];
+ }
+
slave_port_id[1] = ethdev_port_id(get_global_cfg_params()->bond4_slave2_mac_addr);
+ if (slave_port_id[1] < 0) {
+ LSTACK_LOG(ERR, LSTACK, "get slave port id failed port = %d\n", slave_port_id[1]);
+ return slave_port_id[1];
+ }
for (int i = 0; i < slave_num; i++) {
ret = dpdk_ethdev_init(slave_port_id[i], 0);
@@ -532,7 +541,15 @@ int32_t dpdk_ethdev_init(int port_id, bool bond_port)
if (bond_port) {
struct rte_eth_dev_info slave_dev_info;
int slave_id = rte_eth_bond_primary_get(port_id);
- rte_eth_dev_info_get(slave_id, &slave_dev_info);
+ if (slave_id < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk get bond primary port failed port = %d\n", slave_id);
+ return slave_id;
+ }
+ ret = rte_eth_dev_info_get(slave_id, &slave_dev_info);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk get bond dev info failed ret = %d\n", ret);
+ return ret;
+ }
dev_info.rx_offload_capa = slave_dev_info.rx_offload_capa;
dev_info.tx_offload_capa = slave_dev_info.tx_offload_capa;
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。