* [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe)
@ 2023-01-13 21:42 Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 1/2] ixgbe: XDP: fix checker warning from rcu pointer Tony Nguyen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-01-13 21:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet; +Cc: Tony Nguyen, netdev
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.
The following are changes since commit 6e6eda44b939c0931533d6681d9f2ed41b44cde9:
sock: add tracepoint for send recv length
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 10GbE
Jesse Brandeburg (1):
ixgbe: XDP: fix checker warning from rcu pointer
Sebastian Czapla (1):
ixgbe: Filter out spurious link up indication
.../net/ethernet/intel/ixgbe/ixgbe_common.c | 21 ++++++++++++++++---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 13 ++++++------
2 files changed, 24 insertions(+), 10 deletions(-)
--
2.38.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] ixgbe: XDP: fix checker warning from rcu pointer
2023-01-13 21:42 [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Tony Nguyen
@ 2023-01-13 21:42 ` Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 2/2] ixgbe: Filter out spurious link up indication Tony Nguyen
2023-01-18 3:03 ` [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Jakub Kicinski
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-01-13 21:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet
Cc: Jesse Brandeburg, netdev, anthony.l.nguyen, maciej.fijalkowski,
magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
Chandan Kumar Rout
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
The ixgbe driver uses an older style failure mode when initializing the
XDP program and the queues. It causes some warnings when running C=2
checking builds (and it's the last one in the ethernet/intel tree).
$ make W=1 C=2 M=`pwd`/drivers/net/ethernet/intel modules
.../ixgbe_main.c:10301:25: error: incompatible types in comparison expression (different address spaces):
.../ixgbe_main.c:10301:25: struct bpf_prog [noderef] __rcu *
.../ixgbe_main.c:10301:25: struct bpf_prog *
Fix the problem by removing the line that tried to re-xchg "the old_prog
pointer" if there was an error, to make this driver act like the other
drivers which return the error code without "pointer restoration."
Also, update the "copy the pointer" logic to use WRITE_ONCE as many/all
the other drivers do, which required making a change in two separate
functions that write the xdp_prog variable in the ring.
The code here was modeled after the code in i40e/i40e_xdp_setup().
NOTE: Compile-tested only.
CC: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
CC: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ab8370c413f3..93699d2ae051 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -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:
@@ -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)
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] ixgbe: Filter out spurious link up indication
2023-01-13 21:42 [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 1/2] ixgbe: XDP: fix checker warning from rcu pointer Tony Nguyen
@ 2023-01-13 21:42 ` Tony Nguyen
2023-01-18 3:03 ` [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Jakub Kicinski
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-01-13 21:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet
Cc: Sebastian Czapla, netdev, anthony.l.nguyen, Sunitha Mekala
From: Sebastian Czapla <sebastianx.czapla@intel.com>
Add delayed link state recheck to filter false link up indication
caused by transceiver with no fiber cable attached.
Signed-off-by: Sebastian Czapla <sebastianx.czapla@intel.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
.../net/ethernet/intel/ixgbe/ixgbe_common.c | 21 ++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 38c4609bd429..878dd8dff528 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -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) {
@@ -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) {
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe)
2023-01-13 21:42 [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 1/2] ixgbe: XDP: fix checker warning from rcu pointer Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 2/2] ixgbe: Filter out spurious link up indication Tony Nguyen
@ 2023-01-18 3:03 ` Jakub Kicinski
2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2023-01-18 3:03 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, pabeni, edumazet, netdev
On Fri, 13 Jan 2023 13:42:46 -0800 Tony Nguyen wrote:
> 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.
Pulled, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-18 3:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-13 21:42 [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 1/2] ixgbe: XDP: fix checker warning from rcu pointer Tony Nguyen
2023-01-13 21:42 ` [PATCH net-next 2/2] ixgbe: Filter out spurious link up indication Tony Nguyen
2023-01-18 3:03 ` [PATCH net-next 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-13 (ixgbe) Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).