Skip to content

Commit aac9e05

Browse files
dcskidmoJeff Kirsher
authored andcommitted
ixgbe: cleanup crosstalk fix
This patch address a few issues with the initial crosstalk fix. Most important of which is the SDP that indicates the presents of a SFP+ module changes between HW types. With this change that is taken in to consideration It also moves the check closer to the base code that checks link. This makes it so we only need to do the check in one spot. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent fdb359e commit aac9e05

File tree

4 files changed

+72
-41
lines changed

4 files changed

+72
-41
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,6 @@ struct ixgbe_adapter {
804804

805805
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
806806
u32 rss_key[IXGBE_RSS_KEY_SIZE / sizeof(u32)];
807-
808-
bool need_crosstalk_fix;
809807
};
810808

811809
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
277277
{
278278
s32 ret_val;
279279
u32 ctrl_ext;
280+
u16 device_caps;
280281

281282
/* Set the media type */
282283
hw->phy.media_type = hw->mac.ops.get_media_type(hw);
@@ -301,6 +302,22 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
301302
if (ret_val)
302303
return ret_val;
303304

305+
/* Cashe bit indicating need for crosstalk fix */
306+
switch (hw->mac.type) {
307+
case ixgbe_mac_82599EB:
308+
case ixgbe_mac_X550EM_x:
309+
case ixgbe_mac_x550em_a:
310+
hw->mac.ops.get_device_caps(hw, &device_caps);
311+
if (device_caps & IXGBE_DEVICE_CAPS_NO_CROSSTALK_WR)
312+
hw->need_crosstalk_fix = false;
313+
else
314+
hw->need_crosstalk_fix = true;
315+
break;
316+
default:
317+
hw->need_crosstalk_fix = false;
318+
break;
319+
}
320+
304321
/* Clear adapter stopped flag */
305322
hw->adapter_stopped = false;
306323

@@ -3199,6 +3216,31 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw)
31993216
return 0;
32003217
}
32013218

3219+
/**
3220+
* ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix
3221+
* @hw: pointer to hardware structure
3222+
*
3223+
* Contains the logic to identify if we need to verify link for the
3224+
* crosstalk fix
3225+
**/
3226+
static bool ixgbe_need_crosstalk_fix(struct ixgbe_hw *hw)
3227+
{
3228+
/* Does FW say we need the fix */
3229+
if (!hw->need_crosstalk_fix)
3230+
return false;
3231+
3232+
/* Only consider SFP+ PHYs i.e. media type fiber */
3233+
switch (hw->mac.ops.get_media_type(hw)) {
3234+
case ixgbe_media_type_fiber:
3235+
case ixgbe_media_type_fiber_qsfp:
3236+
break;
3237+
default:
3238+
return false;
3239+
}
3240+
3241+
return true;
3242+
}
3243+
32023244
/**
32033245
* ixgbe_check_mac_link_generic - Determine link and speed status
32043246
* @hw: pointer to hardware structure
@@ -3214,6 +3256,35 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
32143256
u32 links_reg, links_orig;
32153257
u32 i;
32163258

3259+
/* If Crosstalk fix enabled do the sanity check of making sure
3260+
* the SFP+ cage is full.
3261+
*/
3262+
if (ixgbe_need_crosstalk_fix(hw)) {
3263+
u32 sfp_cage_full;
3264+
3265+
switch (hw->mac.type) {
3266+
case ixgbe_mac_82599EB:
3267+
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
3268+
IXGBE_ESDP_SDP2;
3269+
break;
3270+
case ixgbe_mac_X550EM_x:
3271+
case ixgbe_mac_x550em_a:
3272+
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
3273+
IXGBE_ESDP_SDP0;
3274+
break;
3275+
default:
3276+
/* sanity check - No SFP+ devices here */
3277+
sfp_cage_full = false;
3278+
break;
3279+
}
3280+
3281+
if (!sfp_cage_full) {
3282+
*link_up = false;
3283+
*speed = IXGBE_LINK_SPEED_UNKNOWN;
3284+
return 0;
3285+
}
3286+
}
3287+
32173288
/* clear the old state */
32183289
links_orig = IXGBE_READ_REG(hw, IXGBE_LINKS);
32193290

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5625,7 +5625,6 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
56255625
struct pci_dev *pdev = adapter->pdev;
56265626
unsigned int rss, fdir;
56275627
u32 fwsm;
5628-
u16 device_caps;
56295628
int i;
56305629

56315630
/* PCI config space info */
@@ -5771,22 +5770,6 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
57715770
adapter->tx_ring_count = IXGBE_DEFAULT_TXD;
57725771
adapter->rx_ring_count = IXGBE_DEFAULT_RXD;
57735772

5774-
/* Cache bit indicating need for crosstalk fix */
5775-
switch (hw->mac.type) {
5776-
case ixgbe_mac_82599EB:
5777-
case ixgbe_mac_X550EM_x:
5778-
case ixgbe_mac_x550em_a:
5779-
hw->mac.ops.get_device_caps(hw, &device_caps);
5780-
if (device_caps & IXGBE_DEVICE_CAPS_NO_CROSSTALK_WR)
5781-
adapter->need_crosstalk_fix = false;
5782-
else
5783-
adapter->need_crosstalk_fix = true;
5784-
break;
5785-
default:
5786-
adapter->need_crosstalk_fix = false;
5787-
break;
5788-
}
5789-
57905773
/* set default work limits */
57915774
adapter->tx_work_limit = IXGBE_DEFAULT_TX_WORK;
57925775

@@ -6707,18 +6690,6 @@ static void ixgbe_watchdog_update_link(struct ixgbe_adapter *adapter)
67076690
link_up = true;
67086691
}
67096692

6710-
/* If Crosstalk fix enabled do the sanity check of making sure
6711-
* the SFP+ cage is empty.
6712-
*/
6713-
if (adapter->need_crosstalk_fix) {
6714-
u32 sfp_cage_full;
6715-
6716-
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
6717-
IXGBE_ESDP_SDP2;
6718-
if (ixgbe_is_sfp(hw) && link_up && !sfp_cage_full)
6719-
link_up = false;
6720-
}
6721-
67226693
if (adapter->ixgbe_ieee_pfc)
67236694
pfc_en |= !!(adapter->ixgbe_ieee_pfc->pfc_en);
67246695

@@ -7065,16 +7036,6 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
70657036
struct ixgbe_hw *hw = &adapter->hw;
70667037
s32 err;
70677038

7068-
/* If crosstalk fix enabled verify the SFP+ cage is full */
7069-
if (adapter->need_crosstalk_fix) {
7070-
u32 sfp_cage_full;
7071-
7072-
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
7073-
IXGBE_ESDP_SDP2;
7074-
if (!sfp_cage_full)
7075-
return;
7076-
}
7077-
70787039
/* not searching for SFP so there is nothing to do here */
70797040
if (!(adapter->flags2 & IXGBE_FLAG2_SEARCH_FOR_SFP) &&
70807041
!(adapter->flags2 & IXGBE_FLAG2_SFP_NEEDS_RESET))

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,6 +3525,7 @@ struct ixgbe_hw {
35253525
bool force_full_reset;
35263526
bool allow_unsupported_sfp;
35273527
bool wol_enabled;
3528+
bool need_crosstalk_fix;
35283529
};
35293530

35303531
struct ixgbe_info {

0 commit comments

Comments
 (0)