[PATCH] examples/ethtool: fix error message about ports limit

Thomas Monjalon thomas at monjalon.net
Wed Jan 28 11:33:50 CET 2026


The error message about the number of ports was swapping
the desired and maximum number of ports.

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Cc: stable at dpdk.org

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 examples/ethtool/ethtool-app/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index d380f69cea..b6bbae70d2 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -288,9 +288,7 @@ int main(int argc, char **argv)
 	if (cnt_ports == 0)
 		rte_exit(EXIT_FAILURE, "No available NIC ports!\n");
 	if (cnt_ports > MAX_PORTS) {
-		printf("Info: Using only %i of %i ports\n",
-			cnt_ports, MAX_PORTS
-			);
+		printf("Info: Using only %i of %i ports\n", MAX_PORTS, cnt_ports);
 		cnt_ports = MAX_PORTS;
 	}
 
-- 
2.52.0



More information about the stable mailing list