* [dpdk-stable] [PATCH v2] net/bonding: fix possible silent failure in configuration
[not found] <1542380067-140320-1-git-send-email-lee.daly@intel.com>
@ 2018-11-16 16:48 ` Lee Daly
2018-11-16 17:37 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Lee Daly @ 2018-11-16 16:48 UTC (permalink / raw)
To: declan.doherty, chas3; +Cc: dev, Lee Daly, stable
This patch checks the return value of function
rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
for error return value.
Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
V2:
syntax changes.
commit message update.
Signed-off-by: Lee Daly <lee.daly@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 156f31c..953cee5 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3420,9 +3420,16 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
"Failed to parse agg selection mode for bonded device %s",
name);
}
- if (internals->mode == BONDING_MODE_8023AD)
- rte_eth_bond_8023ad_agg_selection_set(port_id,
- agg_mode);
+ if (internals->mode == BONDING_MODE_8023AD) {
+ int ret = rte_eth_bond_8023ad_agg_selection_set(port_id,
+ agg_mode);
+ if (ret < 0) {
+ RTE_BOND_LOG(ERR,
+ "Invalid args for agg selection set for bonded device %s",
+ name);
+ return -1;
+ }
+ }
}
/* Parse/add slave ports to bonded device */
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread