Skip to content

Commit

Permalink
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2023-01-13 (ixgbe)

This series contains updates to ixgbe driver only.

Jesse resolves warning for RCU pointer by no longer restoring old
pointer.

Sebastian adds waiting for updating of link info on devices utilizing
crosstalk fix to avoid false link state.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 16, 2023
2 parents b27401a + 6f8179c commit 5ef2702
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
21 changes: 18 additions & 3 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3292,13 +3292,14 @@ static bool ixgbe_need_crosstalk_fix(struct ixgbe_hw *hw)
s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
bool *link_up, bool link_up_wait_to_complete)
{
bool crosstalk_fix_active = ixgbe_need_crosstalk_fix(hw);
u32 links_reg, links_orig;
u32 i;

/* If Crosstalk fix enabled do the sanity check of making sure
* the SFP+ cage is full.
*/
if (ixgbe_need_crosstalk_fix(hw)) {
if (crosstalk_fix_active) {
u32 sfp_cage_full;

switch (hw->mac.type) {
Expand Down Expand Up @@ -3346,10 +3347,24 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
}
} else {
if (links_reg & IXGBE_LINKS_UP)
if (links_reg & IXGBE_LINKS_UP) {
if (crosstalk_fix_active) {
/* Check the link state again after a delay
* to filter out spurious link up
* notifications.
*/
mdelay(5);
links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
if (!(links_reg & IXGBE_LINKS_UP)) {
*link_up = false;
*speed = IXGBE_LINK_SPEED_UNKNOWN;
return 0;
}
}
*link_up = true;
else
} else {
*link_up = false;
}
}

switch (links_reg & IXGBE_LINKS_SPEED_82599) {
Expand Down
13 changes: 6 additions & 7 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6647,7 +6647,7 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
rx_ring->queue_index, ixgbe_rx_napi_id(rx_ring)) < 0)
goto err;

rx_ring->xdp_prog = adapter->xdp_prog;
WRITE_ONCE(rx_ring->xdp_prog, adapter->xdp_prog);

return 0;
err:
Expand Down Expand Up @@ -10297,14 +10297,13 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog)
synchronize_rcu();
err = ixgbe_setup_tc(dev, adapter->hw_tcs);

if (err) {
rcu_assign_pointer(adapter->xdp_prog, old_prog);
if (err)
return -EINVAL;
}
} else {
for (i = 0; i < adapter->num_rx_queues; i++)
(void)xchg(&adapter->rx_ring[i]->xdp_prog,
adapter->xdp_prog);
for (i = 0; i < adapter->num_rx_queues; i++) {
WRITE_ONCE(adapter->rx_ring[i]->xdp_prog,
adapter->xdp_prog);
}
}

if (old_prog)
Expand Down

0 comments on commit 5ef2702

Please sign in to comment.