Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: przemyslaw.kitszel@intel.com
Cc: kuba@kernel.org, netdev@vger.kernel.org,
	aleksandr.loktionov@intel.com, andrew+netdev@lunn.ch,
	anthony.l.nguyen@intel.com, anzaki@gmail.com,
	brett.creeley@amd.com, corbet@lwn.net, davem@davemloft.net,
	edumazet@kernel.org, horms@kernel.org, jacob.e.keller@intel.com,
	jedrzej.jagielski@intel.com, jiri@resnulli.us, leon@kernel.org,
	mbloch@nvidia.com, mschmidt@redhat.com, ohartoov@nvidia.com,
	pabeni@redhat.com, poros@redhat.com, rdunlap@infradead.org,
	saeedm@nvidia.com, skhan@linuxfoundation.org, tariqt@nvidia.com
Subject: Re: [net-next v6 06/15] ice: bump to 256qs for VF
Date: Thu, 19 Nov 2026 06:44:56 +0000	[thread overview]
Message-ID: <179507069682.3136.17019862181092608378@kernel.org> (raw)
In-Reply-To: <20261117094913.100756-7-przemyslaw.kitszel@intel.com>

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?

> 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;
>  }
>  

[ ... ]

> +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.

> +
> +		numq -= num;
> +		memmove(qbuf->queue_info, &qbuf->queue_info[num],
> +			numq * sizeof(*qbuf->queue_info));
> +	}
> +
> +	return 0;
> +}

[ ... ]

> 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

  reply	other threads:[~2026-11-19  6:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  9:44 [net-next v6 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 01/15] devlink, mlx5: add init/fini ops for shared devlink Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 02/15] ice: use shared devlink to store ice_adapters instead of custom xarray Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 03/15] ice: add VF queue ena/dis helper functions Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 04/15] ice: add helpers for Global RSS LUT alloc, free, vsi_update Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 05/15] ice: rename ICE_MAX_RSS_QS_PER_VF to ICE_MAX_QS_PER_VF_VCV1 Przemek Kitszel
2026-11-19  6:44   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 06/15] ice: bump to 256qs for VF Przemek Kitszel
2026-11-19  6:44   ` netdev-bot+sashiko [this message]
2026-11-17  9:44 ` [net-next v6 07/15] iavf: extend iavf_configure_queues() to support more queues Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 08/15] iavf: temporary rename of IAVF_MAX_REQ_QUEUES to IAVF_MAX_REQ_QUEUES_VCV1 Przemek Kitszel
2026-11-17  9:44 ` [net-next v6 09/15] iavf: increase max number of queues to 256 Przemek Kitszel
2026-11-19  6:44   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 10/15] iavf: use new opcodes to request more than 16 queues Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 11/15] ice: introduce handling of virtchnl LARGE VF opcodes Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 12/15] devlink: give user option to allocate resources Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 13/15] ice: represent RSS LUTs as devlink resources Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 14/15] devlink: add devlink_alloc_drv() Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko
2026-11-17  9:44 ` [net-next v6 15/15] ice: support up to 256 VF queues Przemek Kitszel
2026-11-19  6:45   ` netdev-bot+sashiko

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=179507069682.3136.17019862181092608378@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=anzaki@gmail.com \
    --cc=brett.creeley@amd.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jedrzej.jagielski@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ohartoov@nvidia.com \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=saeedm@nvidia.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tariqt@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox