Skip to content

Commit 5ef2702

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/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>
2 parents b27401a + 6f8179c commit 5ef2702

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,13 +3292,14 @@ static bool ixgbe_need_crosstalk_fix(struct ixgbe_hw *hw)
32923292
s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
32933293
bool *link_up, bool link_up_wait_to_complete)
32943294
{
3295+
bool crosstalk_fix_active = ixgbe_need_crosstalk_fix(hw);
32953296
u32 links_reg, links_orig;
32963297
u32 i;
32973298

32983299
/* If Crosstalk fix enabled do the sanity check of making sure
32993300
* the SFP+ cage is full.
33003301
*/
3301-
if (ixgbe_need_crosstalk_fix(hw)) {
3302+
if (crosstalk_fix_active) {
33023303
u32 sfp_cage_full;
33033304

33043305
switch (hw->mac.type) {
@@ -3346,10 +3347,24 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
33463347
links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
33473348
}
33483349
} else {
3349-
if (links_reg & IXGBE_LINKS_UP)
3350+
if (links_reg & IXGBE_LINKS_UP) {
3351+
if (crosstalk_fix_active) {
3352+
/* Check the link state again after a delay
3353+
* to filter out spurious link up
3354+
* notifications.
3355+
*/
3356+
mdelay(5);
3357+
links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
3358+
if (!(links_reg & IXGBE_LINKS_UP)) {
3359+
*link_up = false;
3360+
*speed = IXGBE_LINK_SPEED_UNKNOWN;
3361+
return 0;
3362+
}
3363+
}
33503364
*link_up = true;
3351-
else
3365+
} else {
33523366
*link_up = false;
3367+
}
33533368
}
33543369

33553370
switch (links_reg & IXGBE_LINKS_SPEED_82599) {

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6647,7 +6647,7 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
66476647
rx_ring->queue_index, ixgbe_rx_napi_id(rx_ring)) < 0)
66486648
goto err;
66496649

6650-
rx_ring->xdp_prog = adapter->xdp_prog;
6650+
WRITE_ONCE(rx_ring->xdp_prog, adapter->xdp_prog);
66516651

66526652
return 0;
66536653
err:
@@ -10297,14 +10297,13 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog)
1029710297
synchronize_rcu();
1029810298
err = ixgbe_setup_tc(dev, adapter->hw_tcs);
1029910299

10300-
if (err) {
10301-
rcu_assign_pointer(adapter->xdp_prog, old_prog);
10300+
if (err)
1030210301
return -EINVAL;
10303-
}
1030410302
} else {
10305-
for (i = 0; i < adapter->num_rx_queues; i++)
10306-
(void)xchg(&adapter->rx_ring[i]->xdp_prog,
10307-
adapter->xdp_prog);
10303+
for (i = 0; i < adapter->num_rx_queues; i++) {
10304+
WRITE_ONCE(adapter->rx_ring[i]->xdp_prog,
10305+
adapter->xdp_prog);
10306+
}
1030810307
}
1030910308

1031010309
if (old_prog)

0 commit comments

Comments
 (0)