Skip to contentSkip to conversation

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

PATCH Superseded Min Hu (Connor) 3 participants 5 messages Apr 8, 2021 – Apr 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix bitmap of link speeds when force speed

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")
---
 app/test-pmd/cmdline.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/cmdline.c +3 -0
index f44116b..8c36de2 100644
@@ -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;
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Min Hu (Connor)

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")
---
  app/test-pmd/cmdline.c | 3 +++
  1 file changed, 3 insertions(+)
app/test-pmd/cmdline.c +0 -0
index f44116b..8c36de2 100644

app/test-pmd/cmdline.c parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) · line 1531

Quoted 9 lines
app/test-pmd/cmdline.c +3 -0
@@ -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;

This has a history, same patch has been done in the past by Andrew [1], later reverted [2] (by me) since some PMDs failed and we were close to release.

In recent discussion [3] already agreed to get the patch again before -rc1, and this time there will be time to fix failing PMDs. Thanks for making the patch.

[1] Commit bdca79053b6a ("app/testpmd: set fixed flag for exact link speed")

[2] Commit f53cc91f412a ("app/testpmd: revert fixed flag for exact link speed")

[3] http://inbox.dpdk.org/dev/[email protected]/#t

Acked-by
#2 lore raw
Quoted 30 lines · Ferruh Yigit
Quoted 28 lines · Min Hu (Connor)

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")
---
  app/test-pmd/cmdline.c | 3 +++
  1 file changed, 3 insertions(+)
app/test-pmd/cmdline.c +3 -0
index f44116b..8c36de2 100644
@@ -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;
      }
 
Quoted 4 lines

app/test-pmd/cmdline.c parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) · line 1531

Quoted 2 lines
app/test-pmd/cmdline.c +0 -0
      return 0;
Quoted 7 lines

This has a history, same patch has been done in the past by Andrew [1], later reverted [2] (by me) since some PMDs failed and we were close to release.

In recent discussion [3] already agreed to get the patch again before -rc1, and this time there will be time to fix failing PMDs.
Thanks for making the patch.

+1

Quoted 7 lines

[1] Commit bdca79053b6a ("app/testpmd: set fixed flag for exact link speed")

[2] Commit f53cc91f412a ("app/testpmd: revert fixed flag for exact link speed")

[3] http://inbox.dpdk.org/dev/[email protected]/#t

#3 lore raw

PATCH v2 1/1 app/testpmd: fix bitmap of link speeds when force speed

In reply to Min Hu (Connor)

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")

---
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(+)
app/test-pmd/cmdline.c +3 -0
index 56cf0bf..4eff5fd 100644
@@ -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;
 }
 
Signature · 1 line
2.7.4
Acked-by Acked-by Ajit Khaparde on v2 1/1 Applied
#4 lore raw
Quoted 9 lines · Min Hu (Connor)

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")
Quoted 6 lines

---
v2:
* When users set 10M and 100M speed, fixed bit is still set. v2 fix the bug.

Moving acks from previous version

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