[PATCH v9 48/48] net/sxe2: fix devargs parse error check for representors

liujie5 at linkdatatechnology.com liujie5 at linkdatatechnology.com
Wed Sep 2 04:07:13 CEST 2026


From: Jie Liu <liujie5 at linkdatatechnology.com>

rte_eth_devargs_parse() returns a positive value (the number of
representor ports) when a representor is specified in the device
string, and a negative value on error.  The old check treated any
non-zero return as an error, so probing a representor device always
failed.

Only treat a negative return as an error, so the positive
representor count is not misreported.

Fixes: d8e4e075acb4 ("net/sxe2: add probing skeleton")
Cc: stable at dpdk.org
Signed-off-by: Jie Liu <liujie5 at linkdatatechnology.com>
---
 drivers/net/sxe2/sxe2_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_ethdev.c b/drivers/net/sxe2/sxe2_ethdev.c
index 82ad6e660a..8b53092208 100644
--- a/drivers/net/sxe2/sxe2_ethdev.c
+++ b/drivers/net/sxe2/sxe2_ethdev.c
@@ -2316,7 +2316,7 @@ static int32_t sxe2_parse_eth_devargs(struct rte_device *dev,
 		ret = rte_eth_devargs_parse(dev->devargs->cls_str,
 					    eth_da,
 					    1);
-		if (ret) {
+		if (ret < 0) {
 			PMD_LOG_ERR(INIT, "Failed to parse device arguments: %s",
 				dev->devargs->cls_str);
 			return -rte_errno;
@@ -2327,7 +2327,7 @@ static int32_t sxe2_parse_eth_devargs(struct rte_device *dev,
 		ret = rte_eth_devargs_parse(dev->devargs->args,
 					    eth_da,
 					    1);
-		if (ret) {
+		if (ret < 0) {
 			PMD_LOG_ERR(INIT, "Failed to parse device arguments: %s",
 				dev->devargs->args);
 			return -rte_errno;
-- 
2.52.0



More information about the dev mailing list