From: Huisong Li <[email protected]>

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: [email protected]

Signed-off-by: Huisong Li <[email protected]>
Signed-off-by: Min Hu (Connor) <[email protected]>
---
v2:
* When users set 10M and 100M speed, fixed bit is still set.
  v2 fix the bug.
---
 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 56cf0bf..4eff5fd 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1525,6 +1525,9 @@ parse_and_check_speed_duplex(char *speedstr, char 
*duplexstr, uint32_t *speed)
                }
        }
 
+       if (*speed != ETH_LINK_SPEED_AUTONEG)
+               *speed |= ETH_LINK_SPEED_FIXED;
+
        return 0;
 }
 
-- 
2.7.4

Reply via email to