DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH v2 09/12] ethdev: check DCB availability
Date: Wed, 21 Oct 2026 12:30:23 +0200	[thread overview]
Message-ID: <20261021103027.2050351-10-david.marchand@redhat.com> (raw)
In-Reply-To: <20261021103027.2050351-1-david.marchand@redhat.com>

Add DCB capability check in rte_eth_dev_configure() using
dev->dev_ops->get_dcb_info.

When NULL, reject Rx modes with RTE_ETH_MQ_RX_DCB_FLAG and
Tx modes RTE_ETH_MQ_TX_DCB and RTE_ETH_MQ_TX_VMDQ_DCB.
Remove redundant DCB checks from drivers.

Check that documentation is aligned with driver code.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-doc-vs-code.sh          |  4 +++-
 doc/guides/rel_notes/release_26_11.rst | 11 ++++++++---
 drivers/net/intel/e1000/igb_ethdev.c   |  6 ------
 drivers/net/intel/fm10k/fm10k_ethdev.c |  5 -----
 lib/ethdev/rte_ethdev.c                | 16 ++++++++++++++++
 5 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/devtools/check-doc-vs-code.sh b/devtools/check-doc-vs-code.sh
index eeb235ae61..d4e045ca2c 100755
--- a/devtools/check-doc-vs-code.sh
+++ b/devtools/check-doc-vs-code.sh
@@ -181,6 +181,8 @@ check_mq_caps() # <driver>
 	[ -d $code ] || return 0
 	[ -f $doc ] || return 0
 
+	check_mq_cap $1 "DCB" "get_dcb_info" '\.get_dcb_info[[:space:]]*=' \
+		'RTE_ETH_MQ_(RX|TX).*DCB'
 	check_mq_cap $1 "VMDq" "max_vmdq_pools" 'max_vmdq_pools[[:space:]]*=' \
 		'RTE_ETH_MQ_(RX|TX).*VMDQ'
 }
@@ -201,7 +203,7 @@ if has_code_change 'RTE_FLOW_.*_TYPE_' ||
 		check_rte_flow $driver
 	done
 fi
-if has_code_change 'max_vmdq_pools|RTE_ETH_MQ_.*VMDQ' ||
+if has_code_change 'get_dcb_info|max_vmdq_pools|RTE_ETH_MQ_.*DCB|RTE_ETH_MQ_.*VMDQ' ||
 		has_file_change 'doc/guides/nics/features'; then
 	for driver in $(changed_net_drivers); do
 		check_mq_caps $driver
diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index be758a0c02..9341769c32 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -424,11 +424,16 @@ API Changes
   * Removed the ``unused`` field.
   * Changed the ``objs`` array from fixed size to variable size.
 
+* ethdev: Updated multi-queue mode validation at port configuration time:
+
+  * DCB modes (Rx ``RTE_ETH_MQ_RX_DCB_FLAG``, Tx ``RTE_ETH_MQ_TX_DCB``/``RTE_ETH_MQ_TX_VMDQ_DCB``)
+    are rejected if the driver has no ``get_dcb_info`` callback.
+  * VMDq modes (Rx ``RTE_ETH_MQ_RX_VMDQ_FLAG``,
+    Tx ``RTE_ETH_MQ_TX_VMDQ_DCB``/``RTE_ETH_MQ_TX_VMDQ_ONLY``) are rejected
+    if the driver reports no VMDq pool.
+
 * 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``).
   * A check was added in ``rte_eth_dev_mac_addr_add`` to validate that
     the ``pool`` parameter is 0 when VMDq is not configured.
   * The ``RTE_ETH_NUM_RECEIVE_MAC_ADDR`` and ``RTE_ETH_VMDQ_NUM_UC_HASH_ARRAY`` macros
diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c
index 524c030be6..181af58169 100644
--- a/drivers/net/intel/e1000/igb_ethdev.c
+++ b/drivers/net/intel/e1000/igb_ethdev.c
@@ -1144,12 +1144,6 @@ igb_check_mq_mode(struct rte_eth_dev *dev)
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
 	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
-	if ((rx_mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) ||
-	    tx_mq_mode == RTE_ETH_MQ_TX_DCB ||
-	    tx_mq_mode == RTE_ETH_MQ_TX_VMDQ_DCB) {
-		PMD_INIT_LOG(ERR, "DCB mode is not supported.");
-		return -EINVAL;
-	}
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* Check multi-queue mode.
 		 * To no break software we accept RTE_ETH_MQ_RX_NONE as this might
diff --git a/drivers/net/intel/fm10k/fm10k_ethdev.c b/drivers/net/intel/fm10k/fm10k_ethdev.c
index 9b123c0b2c..5aa15a8dba 100644
--- a/drivers/net/intel/fm10k/fm10k_ethdev.c
+++ b/drivers/net/intel/fm10k/fm10k_ethdev.c
@@ -416,11 +416,6 @@ fm10k_check_mq_mode(struct rte_eth_dev *dev)
 
 	vmdq_conf = &dev->data->dev_conf.rx_adv_conf.vmdq_rx_conf;
 
-	if (rx_mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) {
-		PMD_INIT_LOG(ERR, "DCB mode is not supported.");
-		return -EINVAL;
-	}
-
 	if (!(rx_mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG))
 		return 0;
 
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index f843e8808a..39a895c9e4 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1573,6 +1573,22 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev->dev_ops->get_dcb_info == NULL) {
+		if ((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) != 0) {
+			RTE_ETHDEV_LOG_LINE(ERR, "Ethdev port_id=%u does not support DCB rx mode",
+				port_id);
+			ret = -EINVAL;
+			goto rollback;
+		}
+		if (dev_conf->txmode.mq_mode == RTE_ETH_MQ_TX_DCB ||
+				dev_conf->txmode.mq_mode == RTE_ETH_MQ_TX_VMDQ_DCB) {
+			RTE_ETHDEV_LOG_LINE(ERR, "Ethdev port_id=%u does not support DCB tx mode",
+				port_id);
+			ret = -EINVAL;
+			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",
-- 
2.54.0


  parent reply	other threads:[~2026-10-21 10:31 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 13:05 [PATCH 0/8] Validate multiqueue configuration in ethdev David Marchand
2026-10-16 13:05 ` [PATCH 1/8] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-16 13:05 ` [PATCH 2/8] drivers/net: fix reported VMDq capability David Marchand
2026-10-16 13:05 ` [PATCH 3/8] drivers/net: remove check on VMDq modes David Marchand
2026-10-16 13:05 ` [PATCH 4/8] devtools: check VMDq capability David Marchand
2026-10-16 13:05 ` [PATCH 5/8] ethdev: check DCB availability David Marchand
2026-10-16 13:05 ` [PATCH 6/8] drivers/net: fix reported RSS capability David Marchand
2026-10-16 13:05 ` [PATCH 7/8] ethdev: check RSS availability David Marchand
2026-10-16 13:05 ` [PATCH 8/8] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-16 16:44 ` [PATCH 0/8] Validate multiqueue configuration in ethdev Stephen Hemminger
2026-10-19  6:41   ` Renyong Wan
2026-10-21 10:30 ` [PATCH v2 00/12] " David Marchand
2026-10-21 10:30   ` [PATCH v2 01/12] devtools: fix matching in doc check David Marchand
2026-10-21 10:42     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 02/12] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-21 10:30   ` [PATCH v2 03/12] devtools: handle multiple drivers in doc check David Marchand
2026-10-22  9:39     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 04/12] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-21 10:30   ` [PATCH v2 05/12] drivers/net: fix reported VMDq capability David Marchand
2026-10-21 10:53     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 06/12] drivers/net: remove check on VMDq modes David Marchand
2026-10-21 10:55     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 07/12] devtools: check VMDq capability David Marchand
2026-10-22  9:44     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 08/12] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-21 11:04     ` Bruce Richardson
2026-10-21 10:30   ` David Marchand [this message]
2026-10-21 11:07     ` [PATCH v2 09/12] ethdev: check DCB availability Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 10/12] drivers/net: fix reported RSS capability David Marchand
2026-10-22  6:17     ` Renyong Wan
2026-10-21 10:30   ` [PATCH v2 11/12] ethdev: check RSS availability David Marchand
2026-10-21 10:30   ` [PATCH v2 12/12] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-21 17:42   ` [PATCH v2 00/12] Validate multiqueue configuration in ethdev Stephen Hemminger
2026-10-22 17:44 ` [PATCH v3 00/13] " David Marchand
2026-10-22 17:44   ` [PATCH v3 01/13] devtools: fix matching in doc check David Marchand
2026-10-22 17:44   ` [PATCH v3 02/13] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-22 17:44   ` [PATCH v3 03/13] devtools: support Intel drivers in doc check David Marchand
2026-10-23 10:11     ` Thomas Monjalon
2026-10-22 17:44   ` [PATCH v3 04/13] devtools: handle multiple " David Marchand
2026-10-23 10:13     ` Thomas Monjalon
2026-10-23 15:08       ` David Marchand
2026-10-22 17:44   ` [PATCH v3 05/13] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-22 17:44   ` [PATCH v3 06/13] drivers/net: fix reported VMDq capability David Marchand
2026-10-22 17:44   ` [PATCH v3 07/13] drivers/net: remove check on VMDq modes David Marchand
2026-10-27  2:38     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 08/13] devtools: check VMDq capability David Marchand
2026-10-22 17:44   ` [PATCH v3 09/13] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-22 17:44   ` [PATCH v3 10/13] ethdev: check DCB availability David Marchand
2026-10-27  2:39     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 11/13] drivers/net: fix reported RSS capability David Marchand
2026-10-22 17:44   ` [PATCH v3 12/13] ethdev: check RSS availability David Marchand
2026-10-27  2:41     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 13/13] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-26 18:11   ` [PATCH v3 00/13] Validate multiqueue configuration in ethdev 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=20261021103027.2050351-10-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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