* [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice)
@ 2024-06-11 18:42 Tony Nguyen
2024-06-11 18:42 ` [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Tony Nguyen
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 18:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen
This series contains updates to i40e and ice drivers.
Michal fixes an issue when an XDP program is unloaded via rmmod on i40e.
En-Wei Wu resolves IRQ collision during suspend for ice.
Paul corrects 200Gbps speed being reported as unknown for ice.
Wojciech adds retry mechanism when package download fails on ice.
The following are changes since commit 36534d3c54537bf098224a32dc31397793d4594d:
tcp: use signed arithmetic in tcp_rtx_probe0_timed_out()
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE
En-Wei Wu (1):
ice: avoid IRQ collision to fix init failure on ACPI S3 resume
Michal Kubiak (1):
i40e: Fix XDP program unloading while removing the driver
Paul Greenwalt (1):
ice: fix 200G link speed message log
Wojciech Drewek (1):
ice: implement AQ download pkg retry
drivers/net/ethernet/intel/i40e/i40e_main.c | 19 ++++++++++++-----
drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++--
drivers/net/ethernet/intel/ice/ice_main.c | 10 ++++++++-
3 files changed, 44 insertions(+), 8 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver
2024-06-11 18:42 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice) Tony Nguyen
@ 2024-06-11 18:42 ` Tony Nguyen
2024-06-11 18:57 ` Michal Kubiak
2024-06-11 18:42 ` [PATCH net 2/4] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Tony Nguyen
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 18:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Michal Kubiak, anthony.l.nguyen, maciej.fijalkowski,
magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
Wojciech Drewek, George Kuruvinakunnel, Simon Horman
From: Michal Kubiak <michal.kubiak@intel.com>
The commit 6533e558c650 ("i40e: Fix reset path while removing
the driver") introduced a new PF state "__I40E_IN_REMOVE" to block
modifying the XDP program while the driver is being removed.
Unfortunately, such a change is useful only if the ".ndo_bpf()"
callback was called out of the rmmod context because unloading the
existing XDP program is also a part of driver removing procedure.
In other words, from the rmmod context the driver is expected to
unload the XDP program without reporting any errors. Otherwise,
the kernel warning with callstack is printed out to dmesg.
Example failing scenario:
1. Load the i40e driver.
2. Load the XDP program.
3. Unload the i40e driver (using "rmmod" command).
Fix this by improving checks in ".ndo_bpf()" to determine if that
callback was called from the removing context and if the kernel
wants to unload the XDP program. Allow for unloading the XDP program
in such a case.
Fixes: 6533e558c650 ("i40e: Fix reset path while removing the driver")
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 284c3fad5a6e..2f478edb9f9f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -13293,6 +13293,20 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
bool need_reset;
int i;
+ /* Called from netdev unregister context. Unload the XDP program. */
+ if (vsi->netdev->reg_state == NETREG_UNREGISTERING) {
+ xdp_features_clear_redirect_target(vsi->netdev);
+ old_prog = xchg(&vsi->xdp_prog, NULL);
+ if (old_prog)
+ bpf_prog_put(old_prog);
+
+ return 0;
+ }
+
+ /* VSI shall be deleted in a moment, just return EINVAL */
+ if (test_bit(__I40E_IN_REMOVE, pf->state))
+ return -EINVAL;
+
/* Don't allow frames that span over multiple buffers */
if (vsi->netdev->mtu > frame_size - I40E_PACKET_HDR_PAD) {
NL_SET_ERR_MSG_MOD(extack, "MTU too large for linear frames and XDP prog does not support frags");
@@ -13301,14 +13315,9 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
/* When turning XDP on->off/off->on we reset and rebuild the rings. */
need_reset = (i40e_enabled_xdp_vsi(vsi) != !!prog);
-
if (need_reset)
i40e_prep_for_reset(pf);
- /* VSI shall be deleted in a moment, just return EINVAL */
- if (test_bit(__I40E_IN_REMOVE, pf->state))
- return -EINVAL;
-
old_prog = xchg(&vsi->xdp_prog, prog);
if (need_reset) {
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 2/4] ice: avoid IRQ collision to fix init failure on ACPI S3 resume
2024-06-11 18:42 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice) Tony Nguyen
2024-06-11 18:42 ` [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Tony Nguyen
@ 2024-06-11 18:42 ` Tony Nguyen
2024-06-11 18:42 ` [PATCH net 3/4] ice: fix 200G link speed message log Tony Nguyen
2024-06-11 18:42 ` [PATCH net 4/4] ice: implement AQ download pkg retry Tony Nguyen
3 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 18:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: En-Wei Wu, anthony.l.nguyen, david.m.ertman, shiraz.saleem,
Cyrus Lien, Wojciech Drewek, Pucha Himasekhar Reddy
From: En-Wei Wu <en-wei.wu@canonical.com>
A bug in https://bugzilla.kernel.org/show_bug.cgi?id=218906 describes
that irdma would break and report hardware initialization failed after
suspend/resume with Intel E810 NIC (tested on 6.9.0-rc5).
The problem is caused due to the collision between the irq numbers
requested in irdma and the irq numbers requested in other drivers
after suspend/resume.
The irq numbers used by irdma are derived from ice's ice_pf->msix_entries
which stores mappings between MSI-X index and Linux interrupt number.
It's supposed to be cleaned up when suspend and rebuilt in resume but
it's not, causing irdma using the old irq numbers stored in the old
ice_pf->msix_entries to request_irq() when resume. And eventually
collide with other drivers.
This patch fixes this problem. On suspend, we call ice_deinit_rdma() to
clean up the ice_pf->msix_entries (and free the MSI-X vectors used by
irdma if we've dynamically allocated them). On resume, we call
ice_init_rdma() to rebuild the ice_pf->msix_entries (and allocate the
MSI-X vectors if we would like to dynamically allocate them).
Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA")
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Signed-off-by: En-Wei Wu <en-wei.wu@canonical.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 1b61ca3a6eb6..45d850514f4c 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5564,7 +5564,7 @@ static int ice_suspend(struct device *dev)
*/
disabled = ice_service_task_stop(pf);
- ice_unplug_aux_dev(pf);
+ ice_deinit_rdma(pf);
/* Already suspended?, then there is nothing to do */
if (test_and_set_bit(ICE_SUSPENDED, pf->state)) {
@@ -5644,6 +5644,11 @@ static int ice_resume(struct device *dev)
if (ret)
dev_err(dev, "Cannot restore interrupt scheme: %d\n", ret);
+ ret = ice_init_rdma(pf);
+ if (ret)
+ dev_err(dev, "Reinitialize RDMA during resume failed: %d\n",
+ ret);
+
clear_bit(ICE_DOWN, pf->state);
/* Now perform PF reset and rebuild */
reset_type = ICE_RESET_PFR;
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 3/4] ice: fix 200G link speed message log
2024-06-11 18:42 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice) Tony Nguyen
2024-06-11 18:42 ` [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Tony Nguyen
2024-06-11 18:42 ` [PATCH net 2/4] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Tony Nguyen
@ 2024-06-11 18:42 ` Tony Nguyen
2024-06-11 18:42 ` [PATCH net 4/4] ice: implement AQ download pkg retry Tony Nguyen
3 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 18:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Paul Greenwalt, anthony.l.nguyen, Michal Swiatkowski,
Jesse Brandeburg, Pucha Himasekhar Reddy
From: Paul Greenwalt <paul.greenwalt@intel.com>
Commit 24407a01e57c ("ice: Add 200G speed/phy type use") added support
for 200G PHY speeds, but did not include 200G link speed message
support. As a result the driver incorrectly reports Unknown for 200G
link speed.
Fix this by adding 200G support to ice_print_link_msg().
Fixes: 24407a01e57c ("ice: Add 200G speed/phy type use")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 45d850514f4c..1766230abfff 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -805,6 +805,9 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
}
switch (vsi->port_info->phy.link_info.link_speed) {
+ case ICE_AQ_LINK_SPEED_200GB:
+ speed = "200 G";
+ break;
case ICE_AQ_LINK_SPEED_100GB:
speed = "100 G";
break;
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 4/4] ice: implement AQ download pkg retry
2024-06-11 18:42 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice) Tony Nguyen
` (2 preceding siblings ...)
2024-06-11 18:42 ` [PATCH net 3/4] ice: fix 200G link speed message log Tony Nguyen
@ 2024-06-11 18:42 ` Tony Nguyen
3 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 18:42 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Wojciech Drewek, anthony.l.nguyen, Michal Swiatkowski,
Brett Creeley, Przemek Kitszel, Pucha Himasekhar Reddy
From: Wojciech Drewek <wojciech.drewek@intel.com>
ice_aqc_opc_download_pkg (0x0C40) AQ sporadically returns error due
to FW issue. Fix this by retrying five times before moving to
Safe Mode. Sleep for 20 ms before retrying. This was tested with the
4.40 firmware.
Fixes: c76488109616 ("ice: Implement Dynamic Device Personalization (DDP) download")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c
index ce5034ed2b24..f182179529b7 100644
--- a/drivers/net/ethernet/intel/ice/ice_ddp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ddp.c
@@ -1339,6 +1339,7 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start,
for (i = 0; i < count; i++) {
bool last = false;
+ int try_cnt = 0;
int status;
bh = (struct ice_buf_hdr *)(bufs + start + i);
@@ -1346,8 +1347,26 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start,
if (indicate_last)
last = ice_is_last_download_buffer(bh, i, count);
- status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, last,
- &offset, &info, NULL);
+ while (1) {
+ status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE,
+ last, &offset, &info,
+ NULL);
+ if (hw->adminq.sq_last_status != ICE_AQ_RC_ENOSEC &&
+ hw->adminq.sq_last_status != ICE_AQ_RC_EBADSIG)
+ break;
+
+ try_cnt++;
+
+ if (try_cnt == 5)
+ break;
+
+ msleep(20);
+ }
+
+ if (try_cnt)
+ dev_dbg(ice_hw_to_dev(hw),
+ "ice_aq_download_pkg number of retries: %d\n",
+ try_cnt);
/* Save AQ status from download package */
if (status) {
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver
2024-06-11 18:42 ` [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Tony Nguyen
@ 2024-06-11 18:57 ` Michal Kubiak
2024-06-11 19:03 ` Tony Nguyen
0 siblings, 1 reply; 7+ messages in thread
From: Michal Kubiak @ 2024-06-11 18:57 UTC (permalink / raw)
To: Tony Nguyen
Cc: davem, kuba, pabeni, edumazet, netdev, maciej.fijalkowski,
magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
Wojciech Drewek, George Kuruvinakunnel, Simon Horman
On Tue, Jun 11, 2024 at 11:42:35AM -0700, Tony Nguyen wrote:
> From: Michal Kubiak <michal.kubiak@intel.com>
>
> The commit 6533e558c650 ("i40e: Fix reset path while removing
> the driver") introduced a new PF state "__I40E_IN_REMOVE" to block
> modifying the XDP program while the driver is being removed.
> Unfortunately, such a change is useful only if the ".ndo_bpf()"
> callback was called out of the rmmod context because unloading the
> existing XDP program is also a part of driver removing procedure.
> In other words, from the rmmod context the driver is expected to
> unload the XDP program without reporting any errors. Otherwise,
> the kernel warning with callstack is printed out to dmesg.
>
> Example failing scenario:
> 1. Load the i40e driver.
> 2. Load the XDP program.
> 3. Unload the i40e driver (using "rmmod" command).
>
> Fix this by improving checks in ".ndo_bpf()" to determine if that
> callback was called from the removing context and if the kernel
> wants to unload the XDP program. Allow for unloading the XDP program
> in such a case.
>
> Fixes: 6533e558c650 ("i40e: Fix reset path while removing the driver")
> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
> Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
> Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Reviewed-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
Hi Tony,
After my conversation with Kuba in a separate thread, I analyzed that
patch one more time and it seems the fix can be implemented in a simpler
way, so I am going to send the v2.
Therefore, please ignore this patch.
Thanks,
Michal
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver
2024-06-11 18:57 ` Michal Kubiak
@ 2024-06-11 19:03 ` Tony Nguyen
0 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2024-06-11 19:03 UTC (permalink / raw)
To: Michal Kubiak
Cc: davem, kuba, pabeni, edumazet, netdev, maciej.fijalkowski,
magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
Wojciech Drewek, George Kuruvinakunnel, Simon Horman
On 6/11/2024 11:57 AM, Michal Kubiak wrote:
> Hi Tony,
>
> After my conversation with Kuba in a separate thread, I analyzed that
> patch one more time and it seems the fix can be implemented in a simpler
> way, so I am going to send the v2.
> Therefore, please ignore this patch.
I found that conversation :(
I'll drop this and re-send tomorrow.
Thanks,
Tony
---
pw-bot: cr
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-06-11 19:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 18:42 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-06-11 (i40e, ice) Tony Nguyen
2024-06-11 18:42 ` [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Tony Nguyen
2024-06-11 18:57 ` Michal Kubiak
2024-06-11 19:03 ` Tony Nguyen
2024-06-11 18:42 ` [PATCH net 2/4] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Tony Nguyen
2024-06-11 18:42 ` [PATCH net 3/4] ice: fix 200G link speed message log Tony Nguyen
2024-06-11 18:42 ` [PATCH net 4/4] ice: implement AQ download pkg retry Tony Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox