Skip to contentSkip to conversation

ice: bring up ethtool selftests

PATCH In review Maciej Fijalkowski 2 participants 5 messages Jul 7, 2022 – Jul 26, 2022

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

cover ice: bring up ethtool selftests

Currently ethtool -t $IFACE fails for loopback testing. These two small patches bring it back to life.

These were pulled out from
https://lore.kernel.org/bpf/[email protected]/

and now I route them via net tree as fixes.

Thanks!
Maciej

Maciej Fijalkowski (2):
ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
ice: do not setup vlan for loopback VSI

 drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 ++-
 drivers/net/ethernet/intel/ice/ice_main.c    | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
Signature · 6 lines
2.27.0

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

PATCH 1/2 ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)

Tx side sets EOP and RS bits on descriptors to indicate that a particular descriptor is the last one and needs to generate an irq when it was sent. These bits should not be checked on completion path regardless whether it's the Tx or the Rx. DD bit serves this purpose and it indicates that a particular descriptor is either for Rx or was successfully Txed. EOF is also set as loopback test does not xmit fragmented frames.

Look at (DD | EOF) bits setting in ice_lbtest_receive_frames() instead of EOP and RS pair.

Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +2 -1
index 70335f6e8524..4efa5e5846e0 100644
@@ -658,7 +658,8 @@ static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring)
 		rx_desc = ICE_RX_DESC(rx_ring, i);
 
 		if (!(rx_desc->wb.status_error0 &
-		    cpu_to_le16(ICE_TX_DESC_CMD_EOP | ICE_TX_DESC_CMD_RS)))
+		    (cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S)) |
+		     cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)))))
 			continue;
 
 		rx_buf = &rx_ring->rx_buf[i];
Signature · 6 lines
2.27.0

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

RE: [Intel-wired-lan] [PATCH intel-net 1/2] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)

Quoted 17 lines

From: Intel-wired-lan <[email protected]> On Behalf Of Maciej Fijalkowski
Sent: Thursday, July 7, 2022 3:51 PM
To: [email protected]
Cc: [email protected]; [email protected]; Gerasymenko, Anatolii <[email protected]>; [email protected]; [email protected]; Karlsson, Magnus <[email protected]>
Subject: [Intel-wired-lan] [PATCH intel-net 1/2] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)

Tx side sets EOP and RS bits on descriptors to indicate that a particular descriptor is the last one and needs to generate an irq when it was sent. These bits should not be checked on completion path regardless whether it's the Tx or the Rx. DD bit serves this purpose and it indicates that a particular descriptor is either for Rx or was successfully Txed. EOF is also set as loopback test does not xmit fragmented frames.

Quoted 9 lines

Look at (DD | EOF) bits setting in ice_lbtest_receive_frames() instead of EOP and RS pair.

Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
#3 lore raw

PATCH 2/2 ice: do not setup vlan for loopback VSI

In reply to Maciej Fijalkowski

Currently loopback test is failiing due to the error returned from ice_vsi_vlan_setup(). Skip calling it when preparing loopback VSI.

Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
---
 drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +5 -3
index c1ac2f746714..2c40873bcbb2 100644
@@ -6010,10 +6010,12 @@ int ice_vsi_cfg(struct ice_vsi *vsi)
 	if (vsi->netdev) {
 		ice_set_rx_mode(vsi->netdev);
 
-		err = ice_vsi_vlan_setup(vsi);
+		if (vsi->type != ICE_VSI_LB) {
+			err = ice_vsi_vlan_setup(vsi);
 
-		if (err)
-			return err;
+			if (err)
+				return err;
+		}
 	}
 	ice_vsi_cfg_dcb_rings(vsi);
 
Signature · 1 line
2.27.0
Tested-by on v1 2/2
#4 lore raw

RE: [Intel-wired-lan] [PATCH intel-net 2/2] ice: do not setup vlan for loopback VSI

Quoted 9 lines

From: Intel-wired-lan <[email protected]> On Behalf Of Maciej Fijalkowski
Sent: Thursday, July 7, 2022 3:51 PM
To: [email protected]
Cc: [email protected]; [email protected]; Gerasymenko, Anatolii <[email protected]>; [email protected]; [email protected]; Karlsson, Magnus <[email protected]>
Subject: [Intel-wired-lan] [PATCH intel-net 2/2] ice: do not setup vlan for loopback VSI

Quoted 9 lines

Currently loopback test is failiing due to the error returned from ice_vsi_vlan_setup(). Skip calling it when preparing loopback VSI.

Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
---
 drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)