From: Petr Oros <poros@redhat.com>
To: sashiko-reviews@lists.linux.dev
Cc: intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org
Subject: Re: [PATCH iwl-net 07/10] ice: take the switch rule AQ error from the response descriptor
Date: Tue, 6 Oct 2026 13:30:52 +0200 [thread overview]
Message-ID: <ba8144c2-10f5-4448-80f5-d10d786bd8bb@redhat.com> (raw)
In-Reply-To: <20261002132739.B6C0F1F000FF@smtp.kernel.org>
On 10/2/26 15:27, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] ice: conflated -ENOSPC causes silent MAC filter drop on queue full
> --
>
> commit 5b00f3f5a2fd8517b295e1041c4e6854bbdcfd81
> Author: Petr Oros <poros@redhat.com>
>
> ice: take the switch rule AQ error from the response descriptor
>
> This commit modifies how the driver extracts switch rule AQ errors by directly
> reading the return code from the descriptor that ice_aq_send_cmd() copies back,
> rather than from hw->adminq.sq_last_status. This avoids races when other
> commands complete and overwrite the shared last status variable.
>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
>> --- a/drivers/net/ethernet/intel/ice/ice_main.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> [ ... ]
>> @@ -450,7 +448,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
>> * should go into promiscuous mode. There should be some
>> * space reserved for promiscuous filters.
>> */
>> - if (hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOSPC &&
>> + if (err == -ENOSPC &&
>> !test_and_set_bit(ICE_FLTR_OVERFLOW_PROMISC,
>> vsi->state)) {
>> promisc_forced_on = true;
> [Severity: High]
> Does this change unintentionally catch transient software queue exhaustion
> errors?
>
> If ice_sq_send_cmd() returns a native software -ENOSPC because the control
> send queue is temporarily full (e.g., under heavy administrative queue load),
> this fallback block will now catch it.
>
> Previously, this block was gated behind the hardware-specific
> hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOSPC check. By changing it to
> check err == -ENOSPC, a temporary queue-full condition could be misidentified
> as a permanent hardware MAC filter limit.
>
> This would cause the driver to erroneously set the overflow state bit and
> return success, dropping MAC filters and leaving the hardware permanently out
> of sync with the OS.
The send queue can not be temporarily full. Commands are sent one at a
time under sq_lock and each one waits for its completion, and the queue
is reclaimed from the FW head pointer. It only fills up once the FW has
stopped processing the AQ for 191 commands in a row, and at that point
no filter can be programmed either way.
>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
>> --- a/drivers/net/ethernet/intel/ice/ice_switch.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_switch.c
> [ ... ]
>> + if (status) {
>> + enum libie_aq_err aq_err = le16_to_cpu(desc.retval) & 0xff;
>> +
>> + if (opc != ice_aqc_opc_add_sw_rules &&
>> + aq_err == LIBIE_AQ_RC_ENOENT)
>> + status = -ENOENT;
>> + else if (opc == ice_aqc_opc_add_sw_rules &&
>> + aq_err == LIBIE_AQ_RC_ENOSPC)
>> + status = -ENOSPC;
>> + }
> [Severity: High]
> Will this translation ignore hardware MAC filter exhaustion during rule
> updates?
>
> Because the error translation is strictly gated behind
> opc == ice_aqc_opc_add_sw_rules, if a rule update command (e.g., expanding
> a VSI list) triggers hardware exhaustion, it appears it will return a generic
> -EIO rather than -ENOSPC.
An update modifies an existing rule and the FW does not allocate
anything for it. The VSI list allocation in that path goes through
ice_aq_alloc_free_res(), not through ice_aq_sw_rules(), so the
translation is limited to add on purpose, the same way ca1fdb885e5f
limited ENOENT to the non-add commands.
>
> Additionally, native software -ENOSPC errors returned directly by
> ice_sq_send_cmd() will pass through unchanged, leading to the conflation
> issue mentioned above in ice_vsi_sync_fltr().
See above, that needs a send queue the FW stopped draining.
next prev parent reply other threads:[~2026-10-06 11:30 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 13:07 [PATCH iwl-net 00/10] ice: port missing i40e fixes Petr Oros
2026-10-02 13:07 ` [PATCH iwl-net 01/10] ice: replay UDP tunnel ports after a core or global reset Petr Oros
2026-10-03 9:52 ` Ivan Vecera
2026-10-05 10:24 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 02/10] ice: fix IRQ freeing in ice_vsi_req_irq_msix() error path Petr Oros
2026-10-03 9:53 ` Ivan Vecera
2026-10-05 10:24 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 03/10] ice: stop the LAN Tx queues when ice_vsi_open() fails Petr Oros
2026-10-03 9:54 ` Ivan Vecera
2026-10-05 12:03 ` Petr Oros
2026-10-02 13:07 ` [PATCH iwl-net 04/10] ice: restore the default XPS map after a netdev TC change Petr Oros
2026-10-03 9:55 ` Ivan Vecera
2026-10-05 10:25 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 05/10] ice: report VF tx_dropped with tx_errors instead of tx_discards Petr Oros
2026-10-03 9:55 ` Ivan Vecera
2026-10-05 10:26 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 06/10] ice: keep adding MAC filters after one that already exists Petr Oros
2026-10-03 9:55 ` Ivan Vecera
2026-10-05 10:26 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 07/10] ice: take the switch rule AQ error from the response descriptor Petr Oros
2026-10-02 13:27 ` sashiko-bot
2026-10-06 11:30 ` Petr Oros [this message]
2026-10-03 9:55 ` Ivan Vecera
2026-10-05 10:27 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 08/10] ice: detect a PF reset that does not complete Petr Oros
2026-10-03 9:55 ` Ivan Vecera
2026-10-05 10:27 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 09/10] ice: program multicast magic wake before tearing down the main VSI Petr Oros
2026-10-02 13:28 ` sashiko-bot
2026-10-06 11:38 ` Petr Oros
2026-10-03 9:56 ` Ivan Vecera
2026-10-05 10:27 ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 10/10] ice: fix unsigned stat widths Petr Oros
2026-10-02 13:12 ` Loktionov, Aleksandr
2026-10-03 9:56 ` Ivan Vecera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba8144c2-10f5-4448-80f5-d10d786bd8bb@redhat.com \
--to=poros@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.