Skip to contentSkip to conversation

ice: update ICE_PHY_TYPE_HIGH_MAX_INDEX

PATCH In review Paul Greenwalt 2 participants 6 messages Apr 26, 2023 – May 8, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ice: update ICE_PHY_TYPE_HIGH_MAX_INDEX

ICE_PHY_TYPE_HIGH_MAX_INDEX should be the maximum index value and not the length/number of ICE_PHY_TYPE_HIGH. This is not an issue because this define is only used when calling ice_get_link_speed_based_on_phy_type(), which will return ICE_AQ_LINK_SPEED_UNKNOWN for any invalid index. The caller of ice_get_link_speed_based_on_phy_type(), ice_update_phy_type() checks that the return value is a valid link speed before using it and ICE_AQ_LINK_SPEED_UNKNOWN is not. However, update the define to reflect the correct value.

---
 drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 -1
index 740236b3f0fc..8a624cef0eb0 100644
@@ -1105,7 +1105,7 @@ struct ice_aqc_get_phy_caps {
 #define ICE_PHY_TYPE_HIGH_100G_CAUI2		BIT_ULL(2)
 #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC	BIT_ULL(3)
 #define ICE_PHY_TYPE_HIGH_100G_AUI2		BIT_ULL(4)
-#define ICE_PHY_TYPE_HIGH_MAX_INDEX		5
+#define ICE_PHY_TYPE_HIGH_MAX_INDEX		4
 
 struct ice_aqc_get_phy_caps_data {
 	__le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
Signature · 6 lines
2.39.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#1 lore raw

PATCH 2/3 ice: refactor PHY type to ethtool link mode

Refactor ice_phy_type_to_ethtool to use phy_type_[low|high]_lkup table to map PHY type to AQ link speed and ethtool link mode. This removes complexity and simplifies future changes.

---
 drivers/net/ethernet/intel/ice/ice.h         |   1 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 309 +++----------------
 drivers/net/ethernet/intel/ice/ice_ethtool.h | 105 +++++++
 3 files changed, 141 insertions(+), 274 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/ice/ice_ethtool.h
drivers/net/ethernet/intel/ice/ice.h +1 -0
index d637032c8139..8b016511561f 100644
@@ -32,6 +32,7 @@
 #include <linux/pkt_sched.h>
 #include <linux/if_bridge.h>
 #include <linux/ctype.h>
+#include <linux/linkmode.h>
 #include <linux/bpf.h>
 #include <linux/btf.h>
 #include <linux/auxiliary_bus.h>
drivers/net/ethernet/intel/ice/ice_ethtool.c +35 -274

339 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_ethtool.h new file +105 -0

105 lines not on this page · raw message

Signature · 6 lines
2.39.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v1 2/3
#2 lore raw

Re: [Intel-wired-lan] [PATCH net 2/3] ice: refactor PHY type to ethtool link mode

Quoted 6 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Greenwalt, Paul
Sent: Thursday, April 27, 2023 12:21 AM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH net 2/3] ice: refactor PHY type to ethtool link mode

Quoted 8 lines

Refactor ice_phy_type_to_ethtool to use phy_type_[low|high]_lkup table to map PHY type to AQ link speed and ethtool link mode. This removes complexity and simplifies future changes.

---
drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_ethtool.c | 309 +++---------------- drivers/net/ethernet/intel/ice/ice_ethtool.h | 105 +++++++

3 files changed, 141 insertions(+), 274 deletions(-)  create mode 100644 drivers/net/ethernet/intel/ice/ice_ethtool.h

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#3 lore raw

PATCH 3/3 ice: update PHY type to ethtool link mode mapping

In reply to Paul Greenwalt

Some link modes can be more accurately reported due to newer link mode values that have been added to the kernel; update those PHY type to report modes that better reflect the link mode.

---
 drivers/net/ethernet/intel/ice/ice_ethtool.h | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.h +19 -19
index 00043ea9469a..b403ee79cd5e 100644
@@ -36,11 +36,11 @@ phy_type_low_lkup[] = {
 	[10] = ICE_PHY_TYPE(5GB, 5000baseT_Full),
 	[11] = ICE_PHY_TYPE(5GB, 5000baseT_Full),
 	[12] = ICE_PHY_TYPE(10GB, 10000baseT_Full),
-	[13] = ICE_PHY_TYPE(10GB, 10000baseT_Full),
+	[13] = ICE_PHY_TYPE(10GB, 10000baseCR_Full),
 	[14] = ICE_PHY_TYPE(10GB, 10000baseSR_Full),
 	[15] = ICE_PHY_TYPE(10GB, 10000baseLR_Full),
 	[16] = ICE_PHY_TYPE(10GB, 10000baseKR_Full),
-	[17] = ICE_PHY_TYPE(10GB, 10000baseT_Full),
+	[17] = ICE_PHY_TYPE(10GB, 10000baseCR_Full),
 	[18] = ICE_PHY_TYPE(10GB, 10000baseKR_Full),
 	[19] = ICE_PHY_TYPE(25GB, 25000baseCR_Full),
 	[20] = ICE_PHY_TYPE(25GB, 25000baseCR_Full),
@@ -51,36 +51,36 @@ phy_type_low_lkup[] = {
 	[25] = ICE_PHY_TYPE(25GB, 25000baseKR_Full),
 	[26] = ICE_PHY_TYPE(25GB, 25000baseKR_Full),
 	[27] = ICE_PHY_TYPE(25GB, 25000baseKR_Full),
-	[28] = ICE_PHY_TYPE(25GB, 25000baseCR_Full),
-	[29] = ICE_PHY_TYPE(25GB, 25000baseKR_Full),
+	[28] = ICE_PHY_TYPE(25GB, 25000baseSR_Full),
+	[29] = ICE_PHY_TYPE(25GB, 25000baseCR_Full),
 	[30] = ICE_PHY_TYPE(40GB, 40000baseCR4_Full),
 	[31] = ICE_PHY_TYPE(40GB, 40000baseSR4_Full),
 	[32] = ICE_PHY_TYPE(40GB, 40000baseLR4_Full),
 	[33] = ICE_PHY_TYPE(40GB, 40000baseKR4_Full),
-	[34] = ICE_PHY_TYPE(40GB, 40000baseCR4_Full),
+	[34] = ICE_PHY_TYPE(40GB, 40000baseSR4_Full),
 	[35] = ICE_PHY_TYPE(40GB, 40000baseCR4_Full),
 	[36] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
 	[37] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
 	[38] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
 	[39] = ICE_PHY_TYPE(50GB, 50000baseKR2_Full),
-	[40] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
+	[40] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
 	[41] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
-	[42] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
+	[42] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
 	[43] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
-	[44] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
-	[45] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
-	[46] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
-	[47] = ICE_PHY_TYPE(50GB, 50000baseSR2_Full),
-	[48] = ICE_PHY_TYPE(50GB, 50000baseKR2_Full),
-	[49] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
-	[50] = ICE_PHY_TYPE(50GB, 50000baseCR2_Full),
+	[44] = ICE_PHY_TYPE(50GB, 50000baseCR_Full),
+	[45] = ICE_PHY_TYPE(50GB, 50000baseSR_Full),
+	[46] = ICE_PHY_TYPE(50GB, 50000baseLR_ER_FR_Full),
+	[47] = ICE_PHY_TYPE(50GB, 50000baseLR_ER_FR_Full),
+	[48] = ICE_PHY_TYPE(50GB, 50000baseKR_Full),
+	[49] = ICE_PHY_TYPE(50GB, 50000baseSR_Full),
+	[50] = ICE_PHY_TYPE(50GB, 50000baseCR_Full),
 	[51] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
 	[52] = ICE_PHY_TYPE(100GB, 100000baseSR4_Full),
 	[53] = ICE_PHY_TYPE(100GB, 100000baseLR4_ER4_Full),
 	[54] = ICE_PHY_TYPE(100GB, 100000baseKR4_Full),
 	[55] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
 	[56] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
-	[57] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
+	[57] = ICE_PHY_TYPE(100GB, 100000baseSR4_Full),
 	[58] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
 	[59] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
 	[60] = ICE_PHY_TYPE(100GB, 100000baseKR4_Full),
@@ -96,10 +96,10 @@ phy_type_low_lkup[] = {
 static const struct ice_phy_type_to_ethtool
 phy_type_high_lkup[] = {
 	[0] = ICE_PHY_TYPE(100GB, 100000baseKR2_Full),
-	[1] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
-	[2] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
-	[3] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
-	[4] = ICE_PHY_TYPE(100GB, 100000baseCR4_Full),
+	[1] = ICE_PHY_TYPE(100GB, 100000baseSR2_Full),
+	[2] = ICE_PHY_TYPE(100GB, 100000baseCR2_Full),
+	[3] = ICE_PHY_TYPE(100GB, 100000baseSR2_Full),
+	[4] = ICE_PHY_TYPE(100GB, 100000baseCR2_Full),
 };
 
 #endif /* !_ICE_ETHTOOL_H_ */
Signature · 6 lines
2.39.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v1 3/3
#4 lore raw

Re: [Intel-wired-lan] [PATCH net 3/3] ice: update PHY type to ethtool link mode mapping

Quoted 6 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Greenwalt, Paul
Sent: Thursday, April 27, 2023 12:21 AM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH net 3/3] ice: update PHY type to ethtool link mode mapping

Quoted 7 lines

Some link modes can be more accurately reported due to newer link mode values that have been added to the kernel; update those PHY type to report modes that better reflect the link mode.

---
drivers/net/ethernet/intel/ice/ice_ethtool.h | 38 ++++++++++----------

1 file changed, 19 insertions(+), 19 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Tested-by on v1 1/3
#5 lore raw
In reply to Paul Greenwalt
Quoted 6 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Greenwalt, Paul
Sent: Thursday, April 27, 2023 12:21 AM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH net 1/3] ice: update ICE_PHY_TYPE_HIGH_MAX_INDEX

Quoted 8 lines

ICE_PHY_TYPE_HIGH_MAX_INDEX should be the maximum index value and not the length/number of ICE_PHY_TYPE_HIGH. This is not an issue because this define is only used when calling ice_get_link_speed_based_on_phy_type(),
which will return ICE_AQ_LINK_SPEED_UNKNOWN for any invalid index. The caller of ice_get_link_speed_based_on_phy_type(), ice_update_phy_type() checks that the return value is a valid link speed before using it and ICE_AQ_LINK_SPEED_UNKNOWN is not. However, update the define to reflect the correct value.

---
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan