[dpdk-dev] [PATCH] app/testpmd: fix bitmap of link speeds when force speed

Min Hu (Connor) humin29 at huawei.com
Thu Apr 8 12:22:28 CEST 2021


From: Huisong Li <lihuisong at huawei.com>

Currently, when the user sets force link speed through 'link_speeds',
bit(0) of 'link_speeds' is not set to 1(ETH_LINK_SPEED_FIXED),
which conflicts with the definition.

Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
Cc: stable at dpdk.org

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 app/test-pmd/cmdline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f44116b..8c36de2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1523,6 +1523,9 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
 			printf("Unknown speed parameter\n");
 			return -1;
 		}
+
+		if (*speed != ETH_LINK_SPEED_AUTONEG)
+			*speed |= ETH_LINK_SPEED_FIXED;
 	}
 
 	return 0;
-- 
2.7.4



More information about the dev mailing list