Re: [net-next v6 06/15] ice: bump to 256qs for VF

From
netdev-bot+sashiko@kernel.org
Date
2026-11-19 06:44:58
Reply to
Przemek Kitszel, 2026-11-17
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 (1) · Medium: 2 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message does not match the code.
- [Medium] ice_lag_cfg_lan_txq()
  (drivers/net/ethernet/intel/ice/ice_lag.c) splits the…

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but it is worth
  reporting.

--

ice: bump to 256qs for VF

This commit resizes the ice per-VF bitmaps and arrays (txq_ena, rxq_ena,
qs_bw, LAG q_home) from 16 to 256 queues and widens num_req_qs. It raises
the VIRTCHNL_OP_REQUEST_QUEUES limit to 256. It also splits the LAG
cfg_txqs admin queue command into chunks of at most U8_MAX queues.
Raise also the limits for the default VF queue count and for
VIRTCHNL_OP_REQUEST_QUEUES to 256. New virtchnl opcodes, needed to
make use of more than 16 queues, are handled by subsequent commits
of this series, the work is split for easier review.
[Severity: Medium]
Is the default VF queue count actually raised by this patch? In
ice_set_per_vf_res() the count is still bounded by the MSI-X count:

    num_txq = min_t(u16, num_msix_per_vf - ICE_NONQ_VECS_VF,
                    ICE_MAX_QS_PER_VF);

num_msix_per_vf is at most ICE_NUM_VF_MSIX_MED (17) and ICE_NONQ_VECS_VF
is 1, so the default stays at 16 or below.

Several functional changes are described only in the v2/v3/v5 notes
below the --- line. Those notes are dropped when the patch is applied:

- ice_vc_cfg_qs_msg() now rolls back by qpair[].rxq.queue_id, up to
  last_valid. Before, it used the qpair index i, which could be left over
  from the CRC check loop, so it could disable the wrong queues. That
  looks like a separate fix.

- ice_lag_cfg_lan_txq() splits the LAG cfg_txqs command into chunks of
  at most U8_MAX queues.

- ice_vsi_set_rss_params() changes vsi->rss_size for VF VSIs from 16
  to 256.

- struct ice_lag is now allocated with kvzalloc, since q_home grows
  to 64KB.

Could the commit message describe these changes? Could the rollback fix
in ice_vc_cfg_qs_msg() go in its own patch?
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 08a17ded0ad55..4bb28564c0d65 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -549,6 +549,41 @@ ice_lag_qbuf_recfg(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *qbuf,
 	return count;
 }
 
[ ... ]
quoted hunk ↗ jump to hunk
+static int
+ice_lag_cfg_lan_txq(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *qbuf,
+		    u16 numq, u8 oldport, u8 newport)
+{
+	while (numq) {
+		int num = min(numq, U8_MAX);
+		int err;
+
+		err = ice_aq_cfg_lan_txq(hw, qbuf,
+					 struct_size(qbuf, queue_info, num),
+					 num, oldport, newport,
+					 ICE_AQC_Q_CFG_TC_CHNG, NULL);
+		if (err)
+			return err;
[Severity: Medium]
If the second or a later ice_aq_cfg_lan_txq() call fails, firmware has
already moved the Tx queues of the earlier chunks from oldport to
newport. Does anything move them back?

All three callers, ice_lag_move_vf_node_tc(), ice_lag_reclaim_vf_tc()
and ice_lag_move_vf_nodes_tc_sync(), treat the error as if nothing was
applied. They skip ice_aq_move_sched_elems() for the VF VSI node and
resume the subtree:

    ice_lag_move_vf_node_tc()
        if (ice_lag_cfg_lan_txq(&lag->pf->hw, qbuf, valq, oldport, newport)) {
            dev_warn(dev, "Failure to configure queues for LAG failover\n");
            goto qbuf_err;
        ...
    qbuf_err:
        kfree(qbuf);
    resume_traffic:
        ice_sched_suspend_resume_elems(&lag->pf->hw, 1, &tmp_teid, false)

The VF's Tx queues would then be split across the two ports, while the
VSI scheduler node stays under the old port's tree. That would last
until the next failover or VF reset.

Before this change the move was a single command, which firmware either
applied in full or rejected in full.
quoted hunk ↗ jump to hunk
+
+		numq -= num;
+		memmove(qbuf->queue_info, &qbuf->queue_info[num],
+			numq * sizeof(*qbuf->queue_info));
+	}
+
+	return 0;
+}
[ ... ]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/intel/ice/ice_lag.h b/drivers/net/ethernet/intel/ice/ice_lag.h
index 4bfffecbdc975..39f6a6cc844d8 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.h
+++ b/drivers/net/ethernet/intel/ice/ice_lag.h
@@ -52,7 +52,7 @@ struct ice_lag {
 	u8 bond_lport_sec; /* lport values for secondary PF */
 
 	/* q_home keeps track of which interface the q is currently on */
-	u8 q_home[ICE_MAX_SRIOV_VFS][ICE_MAX_QS_PER_VF_VCV1];
+	u8 q_home[ICE_MAX_SRIOV_VFS][ICE_MAX_QS_PER_VF];
 
 	/* placeholder VSI for hanging VF queues from on secondary interface */
 	struct ice_vsi *sec_vf[ICE_MAX_SRIOV_VFS];
[Severity: High]
This is a pre-existing issue and was not introduced by this patch. Is
the per-VF queue count capped at ICE_MAX_QS_PER_VF anywhere?

ice_sriov_set_msix_vec_count() takes its value from a write to the
sriov_vf_msix_count sysfs file:

    queues = msix_vec_count;
    ...
    if (queues > min(ice_get_avail_txq_count(pf),
                     ice_get_avail_rxq_count(pf)))
        return -EINVAL;
    ...
    vf->num_vf_qs = queues;

The VF VSI then gets alloc_txq = alloc_rxq = num_vf_qs, and
num_lan_q_entries[0] follows alloc_txq.

In ice_lag_aa_failover() the loop is bounded by
num_q = pv_ctx->num_lan_q_entries[0], and it does:

    lag->q_home[vf_id][i] = dest;

For i >= 256, can this write into the next VF's row? For the highest
vf_id, can it write into sec_vf[], which follows q_home in struct
ice_lag, or past the end of the allocation?

The same question applies without LAG. ice_vc_cfg_qs_msg() accepts any
queue_id below vsi->alloc_txq and passes it to
ice_vf_vsi_dis_single_txq(). That function does
test_bit()/clear_bit(q_id, vf->txq_ena) on a 256-bit bitmap. Can a
queue_id >= 256 chosen by the guest clear bits in rxq_ena or in later
fields of struct ice_vf?

The same uncapped path existed before, with the 16-entry sizes. The
later patches in the series don't seem to add a cap in
ice_sriov_set_msix_vec_count() either.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117094913.100756-1-przemyslaw.kitszel%40intel.com
Thread (25 messages) 25 messages, 2 authors, last reply 13h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help