[PATCH v4 01/10] ethdev: check VMDq availability
David Marchand
david.marchand at redhat.com
Thu Jul 9 18:02:37 CEST 2026
Refuse VMDq related Rx/Tx modes when the driver do not announce VMDq
pools availability.
This will used later as a gate to ignore/reject VMDq related matters.
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
---
Changes since v2:
- added an entry in release notes,
- changed approach: relied on pre-existing dev_info->max_vmdq_pools
rather than introduce a new device capability,
Changes since v1:
- dropped incorrect VMDq feature announce for bnxt representors, em,
i40e representors, ipn3ke representors,
---
doc/guides/rel_notes/release_26_07.rst | 6 ++++++
lib/ethdev/rte_ethdev.c | 16 ++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
index 6352ef27ab..5e9178d36b 100644
--- a/doc/guides/rel_notes/release_26_07.rst
+++ b/doc/guides/rel_notes/release_26_07.rst
@@ -314,6 +314,12 @@ API Changes
- ``rte_flow_dynf_metadata_get``
- ``rte_flow_dynf_metadata_set``
+* **ethdev: updated VMDq related API.**
+
+ * At port configuration time, the number of VMDq pools advertised by a driver is now used to
+ validate VMDq related Rx and Tx modes (``RTE_ETH_MQ_RX_VMDQ_FLAG``, ``RTE_ETH_MQ_TX_VMDQ_DCB``,
+ ``RTE_ETH_MQ_TX_VMDQ_ONLY``).
+
* **mlx5: promoted driver event and steering management APIs from experimental to stable.**
The following mlx5 functions are no longer marked experimental:
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9efeaf77cb..9e305d98c1 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1581,6 +1581,22 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
goto rollback;
}
+ if (dev_info.max_vmdq_pools == 0) {
+ if ((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0) {
+ RTE_ETHDEV_LOG_LINE(ERR, "Ethdev port_id=%u does not support VMDq rx mode",
+ port_id);
+ ret = -EINVAL;
+ goto rollback;
+ }
+ if (dev_conf->txmode.mq_mode == RTE_ETH_MQ_TX_VMDQ_DCB ||
+ dev_conf->txmode.mq_mode == RTE_ETH_MQ_TX_VMDQ_ONLY) {
+ RTE_ETHDEV_LOG_LINE(ERR, "Ethdev port_id=%u does not support VMDq tx mode",
+ port_id);
+ ret = -EINVAL;
+ goto rollback;
+ }
+ }
+
/*
* Setup new number of Rx/Tx queues and reconfigure device.
*/
--
2.54.0
More information about the dev
mailing list