[PATCH v2 1/2] net/bonding: add error hint for invalid args

Wan Junjie wanjunjie at bytedance.com
Tue Feb 15 11:56:12 CET 2022


When invalid args exist, application exits with no error hint.
Adding a log message here will help users to know the reason.

Signed-off-by: Wan Junjie <wanjunjie at bytedance.com>
---
v2: fix typo in commit msg
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index bfa931098e..aa6519f83c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3439,8 +3439,10 @@ bond_probe(struct rte_vdev_device *dev)
 
 	kvlist = rte_kvargs_parse(rte_vdev_device_args(dev),
 		pmd_bond_init_valid_arguments);
-	if (kvlist == NULL)
+	if (kvlist == NULL) {
+		RTE_BOND_LOG(ERR, "Invalid args in %s", rte_vdev_device_args(dev));
 		return -1;
+	}
 
 	/* Parse link bonding mode */
 	if (rte_kvargs_count(kvlist, PMD_BOND_MODE_KVARG) == 1) {
-- 
2.33.0



More information about the dev mailing list