From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, anatoly.burakov@intel.com,
thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru,
stephen@networkplumber.org
Subject: [RFC PATCH 3/6] ethdev: decouple VMDq and DCB cofiguration
Date: Sat, 30 Aug 2025 17:17:03 +0000 [thread overview]
Message-ID: <20250830171706.428977-4-vladimir.medvedkin@intel.com> (raw)
In-Reply-To: <20250830171706.428977-1-vladimir.medvedkin@intel.com>
Current API expects that VMDq and DCB configuration are interconnected,
which may be true for some HW, but isn't universal. For one, we have a
VMDq+DCB configuration structure, but it is not needed because we already
have separate VMDq and DCB structures, so remove it.
Additionally, tx_adv_conf is currently a union, which makes the above
structure necessary, but again, it is not needed if we make tx_adv_conf a
structure and use separate VMDQ and DCB configurations.
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
app/test-pmd/testpmd.c | 31 +++++++++++++++++++++++++------
lib/ethdev/rte_ethdev.h | 35 +----------------------------------
2 files changed, 26 insertions(+), 40 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index b551140165..b5a7e7b3ee 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4103,10 +4103,14 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, enum dcb_mode_enable dcb_mode,
* given above, and the number of traffic classes available for use.
*/
if (dcb_mode == DCB_VT_ENABLED) {
- struct rte_eth_vmdq_dcb_conf *vmdq_rx_conf =
- ð_conf->rx_adv_conf.vmdq_dcb_conf;
- struct rte_eth_vmdq_dcb_tx_conf *vmdq_tx_conf =
- ð_conf->tx_adv_conf.vmdq_dcb_tx_conf;
+ struct rte_eth_vmdq_rx_conf *vmdq_rx_conf =
+ ð_conf->rx_adv_conf.vmdq_rx_conf;
+ struct rte_eth_vmdq_tx_conf *vmdq_tx_conf =
+ ð_conf->tx_adv_conf.vmdq_tx_conf;
+ struct rte_eth_dcb_conf *dcb_rx_conf =
+ ð_conf->rx_adv_conf.dcb_rx_conf;
+ struct rte_eth_dcb_conf *dcb_tx_conf =
+ ð_conf->tx_adv_conf.dcb_tx_conf;
/* VMDQ+DCB RX and TX configurations */
vmdq_rx_conf->enable_default_pool = 0;
@@ -4124,8 +4128,23 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, enum dcb_mode_enable dcb_mode,
}
for (i = 0; i < RTE_ETH_DCB_NUM_USER_PRIORITIES; i++) {
dcb_tc_val = prio_tc_en ? prio_tc[i] : i % num_tcs;
- vmdq_rx_conf->dcb_tc[i] = dcb_tc_val;
- vmdq_tx_conf->dcb_tc[i] = dcb_tc_val;
+ dcb_rx_conf->dcb_tc[i] = dcb_tc_val;
+ dcb_tx_conf->dcb_tc[i] = dcb_tc_val;
+ }
+
+ const int bw_share_percent = 100 / num_tcs;
+ const int bw_share_left = 100 - bw_share_percent * num_tcs;
+ for (i = 0; i < num_tcs; i++) {
+ dcb_rx_conf->dcb_tc_bw[i] = bw_share_percent;
+ dcb_tx_conf->dcb_tc_bw[i] = bw_share_percent;
+
+ dcb_rx_conf->dcb_tsa[i] = RTE_ETH_DCB_TSA_ETS;
+ dcb_tx_conf->dcb_tsa[i] = RTE_ETH_DCB_TSA_ETS;
+ }
+
+ for (i = 0; i < bw_share_left; i++) {
+ dcb_rx_conf->dcb_tc_bw[i]++;
+ dcb_tx_conf->dcb_tc_bw[i]++;
}
/* set DCB mode of RX and TX of multiple queues */
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 1579be5a95..c220760043 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -937,39 +937,10 @@ struct rte_eth_dcb_conf {
uint8_t dcb_tc_bw[RTE_ETH_DCB_NUM_TCS];
};
-struct rte_eth_vmdq_dcb_tx_conf {
- enum rte_eth_nb_pools nb_queue_pools; /**< With DCB, 16 or 32 pools. */
- /** Traffic class each UP mapped to. */
- uint8_t dcb_tc[RTE_ETH_DCB_NUM_USER_PRIORITIES];
-};
-
struct rte_eth_vmdq_tx_conf {
enum rte_eth_nb_pools nb_queue_pools; /**< VMDq mode, 64 pools. */
};
-/**
- * A structure used to configure the VMDq+DCB feature
- * of an Ethernet port.
- *
- * Using this feature, packets are routed to a pool of queues, based
- * on the VLAN ID in the VLAN tag, and then to a specific queue within
- * that pool, using the user priority VLAN tag field.
- *
- * A default pool may be used, if desired, to route all traffic which
- * does not match the VLAN filter rules.
- */
-struct rte_eth_vmdq_dcb_conf {
- enum rte_eth_nb_pools nb_queue_pools; /**< With DCB, 16 or 32 pools */
- uint8_t enable_default_pool; /**< If non-zero, use a default pool */
- uint8_t default_pool; /**< The default pool, if applicable */
- uint8_t nb_pool_maps; /**< We can have up to 64 filters/mappings */
- struct {
- uint16_t vlan_id; /**< The VLAN ID of the received frame */
- uint64_t pools; /**< Bitmask of pools for packet Rx */
- } pool_map[RTE_ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq VLAN pool maps. */
- /** Selects a queue in a pool */
- uint8_t dcb_tc[RTE_ETH_DCB_NUM_USER_PRIORITIES];
-};
/**
* A structure used to configure the VMDq feature of an Ethernet port when
@@ -1523,16 +1494,12 @@ struct rte_eth_conf {
are defined in implementation of each driver. */
struct {
struct rte_eth_rss_conf rss_conf; /**< Port RSS configuration */
- /** Port VMDq+DCB configuration. */
- struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;
/** Port DCB Rx configuration. */
struct rte_eth_dcb_conf dcb_rx_conf;
/** Port VMDq Rx configuration. */
struct rte_eth_vmdq_rx_conf vmdq_rx_conf;
} rx_adv_conf; /**< Port Rx filtering configuration. */
- union {
- /** Port VMDq+DCB Tx configuration. */
- struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
+ struct {
/** Port DCB Tx configuration. */
struct rte_eth_dcb_conf dcb_tx_conf;
/** Port VMDq Tx configuration. */
--
2.43.0
next prev parent reply other threads:[~2025-08-30 17:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 17:17 [RFC PATCH 0/6] ethdev: refactor and extend DCB configuration API Vladimir Medvedkin
2025-08-30 17:17 ` [RFC PATCH 1/6] ethdev: extend and refactor DCB configuration Vladimir Medvedkin
2025-08-30 19:52 ` Ivan Malov
2025-08-31 15:00 ` Vladimir Medvedkin
2025-08-30 19:57 ` Ivan Malov
2025-08-31 15:01 ` Vladimir Medvedkin
2025-08-30 17:17 ` [RFC PATCH 2/6] ethdev: remove nb_tcs from rte_eth_dcb_conf structure Vladimir Medvedkin
2025-08-30 17:17 ` Vladimir Medvedkin [this message]
2025-08-30 17:17 ` [RFC PATCH 4/6] ethdev: extend VMDq/DCB configuration with queue mapping Vladimir Medvedkin
2025-08-30 20:36 ` Ivan Malov
2025-08-31 15:09 ` Vladimir Medvedkin
2025-08-31 15:57 ` Ivan Malov
2025-08-30 17:17 ` [RFC PATCH 5/6] ethdev: remove dcb_capability_en from rte_eth_conf Vladimir Medvedkin
2025-08-30 20:46 ` Ivan Malov
2025-08-30 20:49 ` Ivan Malov
2025-08-30 17:17 ` [RFC PATCH 6/6] ethdev: move mq_mode to [r,t]x_adv_conf Vladimir Medvedkin
2025-08-30 21:13 ` [RFC PATCH 0/6] ethdev: refactor and extend DCB configuration API Ivan Malov
2025-08-31 14:55 ` Vladimir Medvedkin
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=20250830171706.428977-4-vladimir.medvedkin@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).