> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Wednesday, November 18, 2026 3:35 PM
> To: Karlsson, Magnus <[email protected]>; 
> [email protected]
> Subject: Re: [PATCH iwl-net] ice: use the queue pair's XDP ring in 
> ice_qp_{dis, ena}()
> 
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [High] ice: XDP ring QINT_TQCTL interrupt mismatch in ice_qp_dis() and
>   ice_qp_ena()
> It also noticed 1 related pre-existing issue this patch does not
> introduce:
> - [Critical] ice: incorrect XDP queue indexing in
>   ice_cfg_txq_interrupt() [1]
> --
> 
> commit 16196a7c47f74a832fc91f862f75e019be2f6418
> Author: Magnus Karlsson <[email protected]>
> 
> ice: use the queue pair's XDP ring in ice_qp_{dis, ena}()
> 
> This commit updates ice_qp_dis(), ice_qp_ena(), ice_qp_clean_rings(), and
> ice_qp_reset_stats() to operate on vsi->rx_rings[q_idx]->xdp_ring instead
> of vsi->xdp_rings[q_idx].
> 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_base.c 
> > b/drivers/net/ethernet/intel/ice/ice_base.c
> > index 1667f686ff751..aa0ad313a97cd 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_base.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_base.c
> [ ... ]
> > @@ -1460,9 +1480,7 @@ int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
> >     err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, tx_ring, &txq_meta);
> >     if (!fail)
> >             fail = err;
> > -   if (vsi->xdp_rings) {
> > -           struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx];
> > -
> > +   if (xdp_ring) {
> >             memset(&txq_meta, 0, sizeof(txq_meta));
> >             ice_fill_txq_meta(vsi, xdp_ring, &txq_meta);
> >             err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, xdp_ring,
> > @@ -1497,9 +1515,11 @@ int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
> >             fail = err;
> >
> >     if (ice_is_xdp_ena_vsi(vsi)) {
> > -           struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx];
> > +           DEFINE_RAW_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1);
> > +           struct ice_tx_ring *xdp_ring = ice_qp_xdp_ring(vsi, q_idx);
> >
> > -           err = ice_vsi_cfg_single_txq(vsi, vsi->xdp_rings, q_idx);
> > +           qg_buf->num_txqs = 1;
> > +           err = ice_vsi_cfg_txq(vsi, xdp_ring, qg_buf);
> >             if (!fail)
> >                     fail = err;
> >             ice_set_ring_xdp(xdp_ring);
> 
> [Severity: High]
> Does ice_qp_ena() leave QINT_TQCTL_CAUSE_ENA_M cleared on xdp_ring after
> ice_qp_dis() stops it?
> 
> In ice_qp_dis(), ice_vsi_stop_tx_ring() clears QINT_TQCTL_CAUSE_ENA_M in
> QINT_TQCTL(xdp_ring->reg_idx).  When ice_qp_ena() re-enables the queue
> pair, it configures MSI-X via ice_qvec_cfg_msix() ->
> ice_cfg_txq_interrupt(), which still writes to a different queue index:
> 
> drivers/net/ethernet/intel/ice/ice_base.c:ice_cfg_txq_interrupt() {
>     ...
>       wr32(hw, QINT_TQCTL(vsi->txq_map[txq]), val);
>       if (ice_is_xdp_ena_vsi(vsi)) {
>               u32 xdp_txq = txq + vsi->num_xdp_txq;
> 
>               wr32(hw, QINT_TQCTL(vsi->txq_map[xdp_txq]),
>                    val);
>       }
>     ...
> }
> 
> When there are fewer queue vectors than CPUs, vsi->txq_map[q_idx +
> vsi->num_xdp_txq] is not xdp_ring->reg_idx.  As a result, xdp_ring's Tx
> interrupt remains disabled (breaking AF_XDP zero-copy Tx completions), and
> another ring's QINT_TQCTL is overwritten with this queue vector's MSI-X
> index.

This is an existing bug. Tx interrupts can be lost.

> [Severity: Critical]
> This problem wasn't introduced by this patch, but ice_cfg_txq_interrupt()
> and ice_vsi_release_msix() also compute the XDP queue offset in
> vsi->txq_map as txq + vsi->num_xdp_txq [1], whereas
> ice_prepare_xdp_rings() places XDP rings in vsi->txq_map starting at
> vsi->alloc_txq.
> 
> When the allocated LAN Tx queue count differs from vsi->num_xdp_txq (for
> example, after changing the channel count with ethtool), indexing
> vsi->txq_map[txq + vsi->num_xdp_txq] can access past the end of
> vsi->txq_map or corrupt QINT_TQCTL for the wrong hardware queues.  In
> addition, ice_vsi_release_msix() only iterates up to q_vector->num_ring_tx,
> which leaves the remaining XDP rings' QINT_TQCTL interrupt mappings active
> when there are fewer LAN Tx queues than XDP queues.
> 
> [1] https://sashiko.dev/#/bug/linux-0b308224-7107-4d23-9bbc-9ae5c80b362b
> 
> --
> Sashiko AI review ยท 
> https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to