ixgbe: correct SDP0 check of SFP cage for X550
Subsystems (3)
PATCH 1/1 ixgbe: correct SDP0 check of SFP cage for X550
SDP0 for X550 NICs is active low to indicate the presence of an SFP in the cage (MOD_ABS#). Invert the results of the logical AND to set sfp_cage_full variable correctly.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +2 -2
@@ -3308,8 +3308,8 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,break ;case ixgbe_mac_X550EM_x:case ixgbe_mac_x550em_a: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP0 ; + sfp_cage_full = !(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP0 );break ;default :/* sanity check - No SFP+ devices here */
Signature · 1 line
2.25.1
Jakub Kicinski
maintainerQuoted 6 lines · On Wed, 20 Apr 2022 16:51:30 -0400 Jeff Daly wrote:
SDP0 for X550 NICs is active low to indicate the presence of an SFP in the cage (MOD_ABS#). Invert the results of the logical AND to set
sfp_cage_fullvariable correctly.Fixes aac9e053f104 ("ixgbe: cleanup crosstalk fix")
No new lines between tags, please.
Quoted 11 lines
Suggested-by Stephen Douthit <[email protected]>Signed-off-by Jeff Daly <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +0
-0
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed, · line 3312
Quoted 7 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +2
-2@@ -3308,8 +3308,8 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,break ;case ixgbe_mac_X550EM_x:case ixgbe_mac_x550em_a: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP0 ; + sfp_cage_full = !(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP0 );
nit: you need to adjust the continuation line so that it starts after the column in which ( is, above. Alternatively you can use ~ on the result of the register read to avoid the brackets.
PATCH v2 1/1 ixgbe: correct SDP0 check of SFP cage for X550
In reply to Jeff DalySDP0 for X550 NICs is active low to indicate the presence of an SFP in the cage (MOD_ABS#). Invert the results of the logical AND to set sfp_cage_full variable correctly.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +5 -5
@@ -3299,17 +3299,17 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,* the SFP+ cage is full. */ if (ixgbe_need_crosstalk_fix (hw)) { -u32 sfp_cage_full; +bool sfp_cage_full;switch (hw->mac.type) {case ixgbe_mac_82599EB: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP2 ; + sfp_cage_full = !!(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP2 );break ;case ixgbe_mac_X550EM_x:case ixgbe_mac_x550em_a: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP0 ; + sfp_cage_full = !(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP0 );break ;default :/* sanity check - No SFP+ devices here */
Signature · 1 line
2.25.1
Piotr Skajewski
NAKPATCH v2 1/1 ixgbe: correct SDP0 check of SFP cage for X550
Hi Jeff,
Our analysis (using 0x15c4) showed that every time the cage is empty SDP indicates 0 and when cage is full it indicates 1. No matter what transceiver we used, from those we have. The same happens even we don't use the device which fall into crosstalk fix e.g 0x15c2.
When proposed patch was applied, the devices are no longer able to negotiate speed. So basically this patch should not be accepted.
NACK
BR,
Piotr
Quoted 3 lines · Jeff Daly
SDP0 for X550 NICs is active low to indicate the presence of an SFP in the cage (MOD_ABS#). Invert the results of the logical AND to set
sfp_cage_fullvariable correctly.
Hi Jeff,
Adding our developer and adding his response here:
"
Our analysis (using 0x15c4) showed that every time the cage is empty SDP indicates 0 and when cage is full it indicates 1. No matter what transceiver we used, from those we have. The same happens even we don't use the device which fall into crosstalk fix e.g 0x15c2.
When proposed patch was applied, the devices are no longer able to negotiate speed. So basically this patch should not be accepted.
NACK
BR,
Piotr
"
Quoted 34 lines
Fixes aac9e053f104 ("ixgbe: cleanup crosstalk fix")Suggested-by Stephen Douthit <[email protected]>Signed-off-by Jeff Daly <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +5
-5@@ -3299,17 +3299,17 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,* the SFP+ cage is full. */ if (ixgbe_need_crosstalk_fix (hw)) { -u32 sfp_cage_full; +bool sfp_cage_full;switch (hw->mac.type) {case ixgbe_mac_82599EB: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP2 ; + sfp_cage_full = !!(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP2 );break ;case ixgbe_mac_X550EM_x:case ixgbe_mac_x550em_a: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP0 ; + sfp_cage_full = !(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP0 );break ;default :/* sanity check - No SFP+ devices here */
Quoted 35 lines
-----Original Message-----
From: Tony Nguyen <[email protected]>
Sent: Thursday, May 12, 2022 1:09 PM
To: Jeff Daly <[email protected]>; intel-wired-lan at osuosl.org; Skajewski, PiotrX <[email protected]>
Cc: Stephen Douthit <[email protected]>; Jesse Brandeburg <[email protected]>; David S. Miller <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Jeff Kirsher <[email protected]>; Don Skidmore <[email protected]>; moderated list:INTEL ETHERNET DRIVERS <[email protected]>; open list:NETWORKING DRIVERS <[email protected]>; open list <[email protected]>
Subject: Re: [PATCH v2 1/1] ixgbe: correct SDP0 check of SFP cage for X550Caution: This is an external email. Please take care when clicking links or opening attachments.
Quoted 3 lines · Jeff Daly
SDP0 for X550 NICs is active low to indicate the presence of an SFP in the cage (MOD_ABS#). Invert the results of the logical AND to set
sfp_cage_fullvariable correctly.Hi Jeff,
Adding our developer and adding his response here:
"
Our analysis (using0x15c4) showed that every time the cage is empty SDP indicates 0 and when cage is full it indicates 1. No matter what transceiver we used, from those we have. The same happens even we don't use the device which fall into crosstalk fix e.g0x15c2.
Quoted 8 lines
When proposed patch was applied, the devices are no longer able to negotiate speed. So basically this patch should not be accepted.
NACK
BR,
Piotr
"
Here's the issue: the pin definition of SDP MOD_ABS is that the signal will be a '1' from the cage when the module is absent. it's up to the platform to invert the signal if it's intended to be used as an interrupt input since the SDPx interrupt detection is only rising edge. you can see this implementation on pg 107 of Intel document 331520-05 (rev 3.4) as figure 3-11. while the document is for the 82599, it clearly shows that SDP2 (as in the code below) is used for MOD_ABS indication, vs in the X550 platform implementation where it appears to (always?) be SDP0. But, since it's a platform-supplied inverter that turns the MOD_ABS signal from an active high to active low (and therefore is read by the code as a and active high 'MODULE PRESENT' signal), there should be an option to change the polarity of the signal to indicate presence or absence. I submitted a different patch for the TX_DISABLE configuration for platforms that don't use SDP3 for TX_DISABLE and it was nack'd because there were no more module params allowed (which is ideally what this patch would also be).
So, it doesn't appear to be specifically required for the platform to implement the signal with an inverter, shouldn't there be a configuration option that makes this opposite polarity depending on the platform?
Quoted 37 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c s32 ixgbe_check_mac_link_generic(struct
Quoted 14 lines
Fixes aac9e053f104 ("ixgbe: cleanup crosstalk fix")Suggested-by Stephen Douthit <[email protected]>Signed-off-by Jeff Daly <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +0
-0@@ -3299,17 +3299,17 @@ s32 ixgbe_check_mac_link_generic(struct
ixgbe_hw*hw,ixgbe_link_speed*speed,Quoted 22 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +5
-5* the SFP+ cage is full. */ if (ixgbe_need_crosstalk_fix (hw)) { -u32 sfp_cage_full; +bool sfp_cage_full;switch (hw->mac.type) {case ixgbe_mac_82599EB: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP2 ; + sfp_cage_full = !!(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP2 );break ;case ixgbe_mac_X550EM_x:case ixgbe_mac_x550em_a: - sfp_cage_full =IXGBE_READ_REG (hw,IXGBE_ESDP ) & -IXGBE_ESDP_SDP0 ; + sfp_cage_full = !(IXGBE_READ_REG (hw,IXGBE_ESDP ) & +IXGBE_ESDP_SDP0 );break ;default :/* sanity check - No SFP+ devices here */