From: Bruce Richardson <bruce.richardson@intel.com>
To: Dawid Wesierski <dawid.wesierski@intel.com>
Cc: <dev@dpdk.org>, <marek.kasiewicz@intel.com>
Subject: Re: [PATCH 2/2] net/iavf: disable runtime queue setup during queue rate limiting
Date: Fri, 10 Jul 2026 16:14:17 +0100 [thread overview]
Message-ID: <alEMScYtuGJfEo_U@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260708231926.1550698-3-dawid.wesierski@intel.com>
On Wed, Jul 08, 2026 at 07:19:26PM -0400, Dawid Wesierski wrote:
> Runtime queue setup on E810 VFs causes queue state corruption when
> queues are dynamically reconfigured while the hardware rate limiter
> is actively pacing TX queues. Queue configuration messages to the PF
> via virtchnl can race with ongoing TX operations, leading to undefined
> behavior.
>
> Rather than gating this behind a devarg that an application would have
> to know to set (and could just as easily avoid triggering the race by
> not calling rte_eth_{rx,tx}_queue_setup() on a running port), stop
> advertising RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP and
> RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP as soon as the application
> commits a per-queue bandwidth rte_tm hierarchy, i.e. as soon as the
> condition that causes the race actually exists. iavf_dev_info_get() is
> re-queried by the ethdev layer on every rx/tx_queue_setup() call, so
> this is enough for the generic layer to start rejecting runtime queue
> (re)configuration with -EBUSY once queue rate limiting is active, and
> to automatically allow it again once the rte_tm hierarchy is torn
> down.
>
> vf->qtc_map, already used elsewhere to look up a queue's TC mapping,
> is repurposed as the "queue bandwidth committed" signal since it's set
> by iavf_hierarchy_commit() exactly when a per-queue bandwidth mapping
> has been pushed to the PF, regardless of whether the port was stopped
> at the time. Fix two related issues found while making it load-bearing
> for this check:
>
> - iavf_hierarchy_commit() replaced vf->qtc_map on every successful
> commit without freeing the previous allocation, leaking memory.
> - vf->qtc_map was never released on VF teardown, so
> iavf_uninit_vf()/iavf_init_vf() (e.g. across a VF reset) could leave
> a stale pointer referencing freed unrelated memory, and the runtime
> queue setup capability would never be re-advertised after a reset.
>
> Both are fixed by freeing vf->qtc_map before replacing it in
> iavf_hierarchy_commit(), and freeing and clearing it in
> iavf_uninit_vf().
>
> Signed-off-by: Marek Kasiewicz <marek.kasiewicz@intel.com>
> Signed-off-by: Dawid Wesierski <dawid.wesierski@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
However, this patch needs a rebase since some of the changes to cleanup
the qtc_map were made in a previously-applied patch.
> doc/guides/nics/intel_vf.rst | 10 ++++++++++
> doc/guides/rel_notes/release_26_07.rst | 3 +++
> drivers/net/intel/iavf/iavf_ethdev.c | 23 ++++++++++++++++++++---
> drivers/net/intel/iavf/iavf_tm.c | 2 ++
> 4 files changed, 35 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
> index e010f852cf..a47e3f6736 100644
> --- a/doc/guides/nics/intel_vf.rst
> +++ b/doc/guides/nics/intel_vf.rst
> @@ -150,6 +150,16 @@ Intel\ |reg| E800 Series Ethernet devices:
> for example: ``-a 18:00.0,quanta_size=2048``.
> The default value is 1024, and quanta size should be set as the product of 64 in legacy host interface mode.
>
> +* Runtime (post-start) Rx/Tx queue setup can race with the hardware Tx rate
> + limiter on E810 VFs and corrupt queue state.
> + Once an application commits a per-queue bandwidth ``rte_tm`` hierarchy,
> + the driver automatically stops advertising
> + ``RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP`` and
> + ``RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP``,
> + so ``rte_eth_rx_queue_setup()``/``rte_eth_tx_queue_setup()``
> + are rejected with ``-EBUSY`` on a running port for as long as queue rate
> + limiting is active.
> +
> * When using the Intel out-of-tree "ice" PF/kernel driver v1.13.7 or later,
> to create VFs with >16 queues (aka. "large VFs"),
> it is necessary to change the rss_lut_vf_addr setting in sysfs from the default of 64 to 512.
> diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
> index 6352ef27ab..7ea80112f4 100644
> --- a/doc/guides/rel_notes/release_26_07.rst
> +++ b/doc/guides/rel_notes/release_26_07.rst
> @@ -143,6 +143,9 @@ New Features
>
> * Added support for transmitting LLDP packets based on mbuf packet type.
> * Implemented AVX2 context descriptor transmit paths.
> + * Runtime Rx/Tx queue setup is now automatically disabled while a
> + per-queue bandwidth ``rte_tm`` hierarchy is committed, to avoid
> + corrupting queue state on E810 VFs.
>
> * **Updated Intel ice driver.**
>
> diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
> index 80e740ef29..5d0c361978 100644
> --- a/drivers/net/intel/iavf/iavf_ethdev.c
> +++ b/drivers/net/intel/iavf/iavf_ethdev.c
> @@ -1160,9 +1160,18 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> dev_info->reta_size = vf->vf_res->rss_lut_size;
> dev_info->flow_type_rss_offloads = IAVF_RSS_OFFLOAD_ALL;
> dev_info->max_mac_addrs = IAVF_NUM_MACADDR_MAX;
> - dev_info->dev_capa =
> - RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
> - RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
> + /*
> + * Runtime queue setup can race with the hardware Tx rate limiter on
> + * E810 VFs and corrupt queue state. Once a per-queue bandwidth rte_tm
> + * hierarchy has been committed (vf->qtc_map is set), stop advertising
> + * the capability so the ethdev layer rejects further rx/tx_queue_setup()
> + * calls on a running port with -EBUSY. The capability is re-advertised
> + * automatically once the rte_tm hierarchy is torn down.
> + */
> + if (vf->qtc_map == NULL)
> + dev_info->dev_capa =
> + RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
> + RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
> dev_info->rx_offload_capa =
> RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
> RTE_ETH_RX_OFFLOAD_QINQ_STRIP |
> @@ -2756,6 +2765,14 @@ iavf_uninit_vf(struct rte_eth_dev *dev)
> rte_free(vf->qos_cap);
> vf->qos_cap = NULL;
>
> + /*
> + * Drop the committed queue/TC bandwidth mapping so a subsequent
> + * iavf_init_vf() (e.g. after a device reset) starts with runtime
> + * Rx/Tx queue setup available again (see iavf_dev_info_get()).
> + */
> + rte_free(vf->qtc_map);
> + vf->qtc_map = NULL;
> +
> rte_free(vf->rss_lut);
> vf->rss_lut = NULL;
> rte_free(vf->rss_key);
> diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c
> index e3492ec491..c9d856e937 100644
> --- a/drivers/net/intel/iavf/iavf_tm.c
> +++ b/drivers/net/intel/iavf/iavf_tm.c
> @@ -905,6 +905,8 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,
> if (ret_val)
> goto fail_clear;
>
> + /* replace the previously committed mapping, if any */
> + rte_free(vf->qtc_map);
> vf->qtc_map = qtc_map;
> if (adapter->stopped == 1)
> vf->tm_conf.committed = true;
> --
> 2.47.3
>
next prev parent reply other threads:[~2026-07-10 15:14 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 16:40 [PATCH 0/7] intel network and pcapng updates Dawid Wesierski
2026-06-08 16:40 ` [PATCH 1/7] net/iavf: increase max ring descriptors to hardware limit Dawid Wesierski
2026-06-08 16:40 ` [PATCH 2/7] net/iavf: allow runtime queue rate limit configuration Dawid Wesierski
2026-06-08 16:40 ` [PATCH 3/7] net/ice/base: reduce default scheduler burst size Dawid Wesierski
2026-06-08 16:40 ` [PATCH 4/7] net/ice: timestamp all received packets when PTP is enabled Dawid Wesierski
2026-06-08 16:40 ` [PATCH 5/7] net/iavf: disable runtime queue setup capability Dawid Wesierski
2026-06-08 16:40 ` [PATCH 6/7] pcapng: add user-supplied timestamp support Dawid Wesierski
2026-06-08 17:09 ` Stephen Hemminger
2026-06-08 16:40 ` [PATCH 7/7] net/ice: add header split mbuf callback support Dawid Wesierski
2026-06-08 16:59 ` [PATCH 0/7] intel network and pcapng updates Thomas Monjalon
2026-06-18 14:44 ` [PATCH v3 1/1] pcapng: add user-supplied timestamp support Dawid Wesierski
2026-06-18 15:20 ` Stephen Hemminger
2026-06-18 14:44 ` [PATCH v2 0/7] Intel network drivers enhancements Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 1/7] ethdev: add header split mbuf callback API Dawid Wesierski
2026-06-18 16:26 ` Thomas Monjalon
2026-06-18 14:44 ` [PATCH v2 2/7] net/iavf: increase max ring descriptors to hardware limit Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 3/7] net/iavf: allow runtime queue rate limit configuration Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 4/7] net/ice/base: reduce default scheduler burst size Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 5/7] net/ice: timestamp all received packets when PTP is enabled Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 6/7] net/iavf: disable runtime queue setup capability Dawid Wesierski
2026-06-18 14:44 ` [PATCH v2 7/7] net/intel: support header split mbuf callback Dawid Wesierski
2026-06-29 15:33 ` Tested the v3 series on Intel E810-C (Columbiaville) hardware Dawid Wesierski
2026-06-30 12:06 ` [PATCH v3 0/6] Intel network drivers enhancements Dawid Wesierski
2026-06-30 12:06 ` [PATCH v3 1/6] net/iavf: increase max ring descriptors to hardware limit Dawid Wesierski
2026-06-30 14:29 ` Bruce Richardson
2026-06-30 12:06 ` [PATCH v3 2/6] net/iavf: allow runtime queue rate limit configuration Dawid Wesierski
2026-06-30 14:46 ` Bruce Richardson
2026-06-30 12:06 ` [PATCH v3 3/6] net/ice: add scheduler rate-limiter burst size devarg Dawid Wesierski
2026-06-30 15:20 ` Bruce Richardson
2026-06-30 12:06 ` [PATCH v3 4/6] net/ice: timestamp all received packets when PTP is enabled Dawid Wesierski
2026-06-30 15:39 ` Bruce Richardson
2026-07-03 20:00 ` Dawid Wesierski
2026-06-30 12:06 ` [PATCH v3 5/6] net/iavf: disable runtime queue setup capability Dawid Wesierski
2026-06-30 15:44 ` Bruce Richardson
2026-07-08 23:18 ` Dawid Wesierski
2026-06-30 12:06 ` [PATCH v3 6/6] app/testpmd: add pinned external-buffer Rx pool command Dawid Wesierski
2026-07-01 10:42 ` [PATCH v3 0/6] Intel network drivers enhancements Bruce Richardson
2026-07-03 12:19 ` [PATCH v4 0/5] " Dawid Wesierski
2026-07-03 12:19 ` [PATCH v4 1/5] net/iavf: increase max ring descriptors to hardware limit Dawid Wesierski
2026-07-03 12:19 ` [PATCH v4 2/5] net/iavf: allow runtime queue rate limit configuration Dawid Wesierski
2026-07-03 12:19 ` [PATCH v4 3/5] net/ice: add scheduler rate-limiter burst size devarg Dawid Wesierski
2026-07-03 12:19 ` [PATCH v4 4/5] net/iavf: disable runtime queue setup capability Dawid Wesierski
2026-07-03 12:19 ` [PATCH v4 5/5] app/testpmd: add pinned external-buffer Rx pool command Dawid Wesierski
2026-07-08 23:19 ` [PATCH v5 0/2] net/iavf, ice: fix runtime queue setup race and burst-size doc Dawid Wesierski
2026-07-08 23:19 ` [PATCH 1/2] doc: fix ice scheduler rate-limiter burst size description Dawid Wesierski
2026-07-10 15:07 ` Bruce Richardson
2026-07-13 9:44 ` [PATCH v6 0/2] doc: ice: update documentation for rl_burst_size devarg Dawid Wesierski
2026-07-08 23:19 ` [PATCH 2/2] net/iavf: disable runtime queue setup during queue rate limiting Dawid Wesierski
2026-07-10 15:14 ` Bruce Richardson [this message]
2026-07-13 9:42 ` [PATCH v6 0/2] Intel network driver enhancements Dawid Wesierski
2026-07-13 9:42 ` [PATCH v6 1/2] doc: fix ice scheduler rate-limiter burst size description Dawid Wesierski
2026-07-13 9:42 ` [PATCH v6 2/2] net/iavf: disable runtime queue setup during queue rate limiting Dawid Wesierski
2026-07-13 9:42 ` [PATCH v6 0/2] Intel network driver enhancements Dawid Wesierski
2026-07-13 9:42 ` [PATCH v6 1/2] doc: fix ice scheduler rate-limiter burst size description Dawid Wesierski
2026-07-13 10:05 ` Bruce Richardson
2026-07-13 9:42 ` [PATCH v6 2/2] net/iavf: disable runtime queue setup during queue rate limiting Dawid Wesierski
2026-07-13 10:09 ` Bruce Richardson
2026-06-18 15:45 ` [PATCH v2 0/7] Intel network drivers enhancements Stephen Hemminger
2026-06-18 15:46 ` Stephen Hemminger
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=alEMScYtuGJfEo_U@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dawid.wesierski@intel.com \
--cc=dev@dpdk.org \
--cc=marek.kasiewicz@intel.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 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.