[v2] app/testpmd: fix bitmap of link speeds when force speed

Message ID 1618369325-32797-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] app/testpmd: fix bitmap of link speeds when force speed |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-testing fail Testing issues

Commit Message

humin (Q) April 14, 2021, 3:02 a.m. UTC
  From: Huisong Li <lihuisong@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@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
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(+)
  

Comments

Ferruh Yigit April 14, 2021, 11:55 a.m. UTC | #1
On 4/14/2021 4:02 AM, Min Hu (Connor) wrote:
> From: Huisong Li <lihuisong@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@dpdk.org
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
> v2:
> * When users set 10M and 100M speed, fixed bit is still set.
>    v2 fix the bug.

Moving acks from previous version
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

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;
 }