🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by "Nowlin, Alexander" Sat, 07 Nov 2026 04:54
RE: [PATCH iwl-net 07/10] ice: take the switch rule AQ error from the response descriptor
#12401
Author: "Nowlin, Alexander"
Date: Sat, 07 Nov 2026 04:54
58 lines
23695 bytes
> -----Original Message-----
> From: Petr Oros <poros@redhat.com> 
> Sent: Friday, October 2, 2026 6:08 AM
> To: netdev@vger.kernel.org
> Cc: Oros, Petr <poros@redhat.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@kernel.org>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Lobakin, Aleksander <aleksander.lobakin@intel.com>; Alexei Starovoitov <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>; Jesper Dangaard Brouer <hawk@kernel.org>; John Fastabend <john.fastabend@gmail.com>; Stanislav Fomichev <sdf@fomichev.me>; Henry Tieman > <henry.w.tieman@intel.com>; Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>; Michal Swiatkowski <michal.swiatkowski@linux.intel.com>; Jesse Brandeburg <jbrandeb@kernel.org>; Preethi Banala <preethi.banala@intel.com>; Kiran Patil <kiran.patil@intel.com>; Dan Nowlin <dan.nowlin@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; intel-wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org; bpf@vger.kernel.org
> Subject: [PATCH iwl-net 07/10] ice: take the switch rule AQ error from the response descriptor
> 
> ice_aq_sw_rules() decides whether a rule removal failed with ENOENT by reading hw->adminq.sq_last_status after ice_aq_send_cmd() returned. That field is shared by every admin queue user and is only stable > while the send queue lock is held. Another AQ command completing in between can overwrite it, so a failed removal is reported as a generic error, and a successful one can even be turned into -ENOENT, because the check is not limited to the failure case. A caller that sees -ENOENT keeps its rule bookkeeping while the rule is gone from the hardware.
> 
> ice_vsi_sync_fltr() has the same problem with ENOSPC. It checks sq_last_status only after it has freed the list of filters it tried to add. Every entry is a separate devres allocation, so freeing a list of thousands of entries takes seconds, and by then the value usually belongs to a different command, so the MAC filter overflow handling is never entered. With debug prints of the error and sq_last_status added to both places:
> 
>   ice_aq_sw_rules: opc 0x2a0 status -5 aq 16
>   ice 0000:04:00.0 enp4s0f0np0: Failed to add MAC filters err -5 aq 0
> 
> Use the retval of the descriptor that ice_aq_send_cmd() copies back, only when the command failed, translate ENOSPC on add to -ENOSPC and let ice_vsi_sync_fltr() check the return code instead of sq_last_status.
> 
> i40e fixed the same kind of race in commit 53a9e346e159 ("i40e: Fix race condition while adding/deleting MAC/VLAN filters").
> 
> Fixes: ca1fdb885e5f ("ice: return correct error code from ice_aq_sw_rules")
> Assisted-by: LLM
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c   |  4 +---
>  drivers/net/ethernet/intel/ice/ice_switch.c | 13 ++++++++++---
>  2 files changed, 11 insertions(+), 6 deletions(-)

Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads