DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: stephen@networkplumber.org, thomas@monjalon.net,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v3 7/7] ethdev: deprecate queue stats mapping functions
Date: Fri,  3 Oct 2025 12:02:01 +0100	[thread overview]
Message-ID: <20251003110201.1541183-8-bruce.richardson@intel.com> (raw)
In-Reply-To: <20251003110201.1541183-1-bruce.richardson@intel.com>

Deprecate the queue stats mapping functions in the ethdev API, since we
no longer have queue stats in the main device statistics. As part of the
deprecation, rather than allowing test-pmd to use the deprecated
functions just remove the mapping functionality from testpmd itself.
Without the queue stats, the ability to test queue mappings is
pointless.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test-pmd/cmdline.c               | 57 ----------------------------
 app/test-pmd/config.c                | 30 ---------------
 doc/guides/rel_notes/deprecation.rst |  6 +++
 lib/ethdev/rte_ethdev.h              |  2 +
 4 files changed, 8 insertions(+), 87 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3731fba370..35f466185f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8032,62 +8032,6 @@ static cmdline_parse_inst_t cmd_set_fwd_eth_peer = {
 	},
 };
 
-/* *** CONFIGURE QUEUE STATS COUNTER MAPPINGS *** */
-struct cmd_set_qmap_result {
-	cmdline_fixed_string_t set;
-	cmdline_fixed_string_t qmap;
-	cmdline_fixed_string_t what;
-	portid_t port_id;
-	uint16_t queue_id;
-	uint8_t map_value;
-};
-
-static void
-cmd_set_qmap_parsed(void *parsed_result,
-		       __rte_unused struct cmdline *cl,
-		       __rte_unused void *data)
-{
-	struct cmd_set_qmap_result *res = parsed_result;
-	int is_rx = (strcmp(res->what, "tx") == 0) ? 0 : 1;
-
-	set_qmap(res->port_id, (uint8_t)is_rx, res->queue_id, res->map_value);
-}
-
-static cmdline_parse_token_string_t cmd_setqmap_set =
-	TOKEN_STRING_INITIALIZER(struct cmd_set_qmap_result,
-				 set, "set");
-static cmdline_parse_token_string_t cmd_setqmap_qmap =
-	TOKEN_STRING_INITIALIZER(struct cmd_set_qmap_result,
-				 qmap, "stat_qmap");
-static cmdline_parse_token_string_t cmd_setqmap_what =
-	TOKEN_STRING_INITIALIZER(struct cmd_set_qmap_result,
-				 what, "tx#rx");
-static cmdline_parse_token_num_t cmd_setqmap_portid =
-	TOKEN_NUM_INITIALIZER(struct cmd_set_qmap_result,
-			      port_id, RTE_UINT16);
-static cmdline_parse_token_num_t cmd_setqmap_queueid =
-	TOKEN_NUM_INITIALIZER(struct cmd_set_qmap_result,
-			      queue_id, RTE_UINT16);
-static cmdline_parse_token_num_t cmd_setqmap_mapvalue =
-	TOKEN_NUM_INITIALIZER(struct cmd_set_qmap_result,
-			      map_value, RTE_UINT8);
-
-static cmdline_parse_inst_t cmd_set_qmap = {
-	.f = cmd_set_qmap_parsed,
-	.data = NULL,
-	.help_str = "set stat_qmap rx|tx <port_id> <queue_id> <map_value>: "
-		"Set statistics mapping value on tx|rx queue_id of port_id",
-	.tokens = {
-		(void *)&cmd_setqmap_set,
-		(void *)&cmd_setqmap_qmap,
-		(void *)&cmd_setqmap_what,
-		(void *)&cmd_setqmap_portid,
-		(void *)&cmd_setqmap_queueid,
-		(void *)&cmd_setqmap_mapvalue,
-		NULL,
-	},
-};
-
 /* *** SET OPTION TO HIDE ZERO VALUES FOR XSTATS  DISPLAY *** */
 struct cmd_set_xstats_hide_zero_result {
 	cmdline_fixed_string_t keyword;
@@ -13949,7 +13893,6 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
 	&cmd_stop,
 	&cmd_mac_addr,
 	&cmd_set_fwd_eth_peer,
-	&cmd_set_qmap,
 	&cmd_set_xstats_hide_zero,
 	&cmd_set_xstats_show_state,
 	&cmd_set_xstats_hide_disabled,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index ff170159a1..3fd82c1325 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -6716,36 +6716,6 @@ tx_vlan_pvid_set(portid_t port_id, uint16_t vlan_id, int on)
 	rte_eth_dev_set_vlan_pvid(port_id, vlan_id, on);
 }
 
-void
-set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
-{
-	int ret;
-
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
-
-	if (is_rx ? (rx_queue_id_is_invalid(queue_id)) : (tx_queue_id_is_invalid(queue_id)))
-		return;
-
-	if (!is_rx) { /* tx */
-		ret = rte_eth_dev_set_tx_queue_stats_mapping(port_id, queue_id,
-							     map_value);
-		if (ret) {
-			fprintf(stderr,
-				"failed to set tx queue stats mapping.\n");
-			return;
-		}
-	} else { /* rx */
-		ret = rte_eth_dev_set_rx_queue_stats_mapping(port_id, queue_id,
-							     map_value);
-		if (ret) {
-			fprintf(stderr,
-				"failed to set rx queue stats mapping.\n");
-			return;
-		}
-	}
-}
-
 void
 set_xstats_hide_zero(uint8_t on_off)
 {
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 4b9da99484..4df0e83de2 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -68,6 +68,12 @@ Deprecation Notices
   and the header struct ``rte_vxlan_gpe_hdr`` with the macro ``RTE_ETHER_VXLAN_GPE_HLEN``
   will be removed in DPDK 25.11.
 
+* ethdev: The queue stats mapping functions
+  ``rte_eth_dev_set_tx_queue_stats_mapping`` and ``rte_eth_dev_set_rx_queue_stats_mapping``
+  are deprecated and will be removed in a future release.
+  Following the removal of queue statistics from the main ethdev statistics struture,
+  these functions are no longer needed.
+
 * ethdev: The flow API matching pattern structures, ``struct rte_flow_item_*``,
   should start with relevant protocol header structure from lib/net/.
   The individual protocol header fields and the protocol header struct
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 4cfc940000..a122df4e8e 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -3445,6 +3445,7 @@ int rte_eth_xstats_reset(uint16_t port_id);
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
+__rte_deprecated
 int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
 		uint16_t tx_queue_id, uint8_t stat_idx);
 
@@ -3466,6 +3467,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
+__rte_deprecated
 int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
 					   uint16_t rx_queue_id,
 					   uint8_t stat_idx);
-- 
2.48.1


      parent reply	other threads:[~2025-10-03 11:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 14:12 [RFC PATCH 0/6] remove deprecated queue stats Bruce Richardson
2025-09-23 14:12 ` [RFC PATCH 1/6] net/ice: don't report empty queue xstats Bruce Richardson
2025-09-23 14:12 ` [RFC PATCH 2/6] net/ipn3ke: drop unsupported per-queue xstats Bruce Richardson
2025-09-24  1:38   ` Xu, Rosen
2025-09-23 14:12 ` [RFC PATCH 3/6] ethdev: remove queue stats from ethdev stats structure Bruce Richardson
2025-09-24  7:37   ` Morten Brørup
2025-09-24  7:42     ` Bruce Richardson
2025-09-23 14:12 ` [RFC PATCH 4/6] drivers/net: update to remove queue stats from eth stats Bruce Richardson
2025-09-24  1:39   ` Xu, Rosen
2025-09-23 14:12 ` [RFC PATCH 5/6] app: " Bruce Richardson
2025-09-23 14:12 ` [RFC PATCH 6/6] doc: update docs for ethdev changes Bruce Richardson
2025-09-23 15:04 ` [RFC PATCH 0/6] remove deprecated queue stats Stephen Hemminger
2025-09-23 15:33   ` Bruce Richardson
2025-09-29 15:00 ` [PATCH v2 " Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 1/6] net/ice: don't report empty queue xstats Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 2/6] net/ipn3ke: drop unsupported per-queue xstats Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 3/6] ethdev: remove queue stats from ethdev stats structure Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 4/6] drivers/net: update to remove queue stats from eth stats Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 5/6] app: " Bruce Richardson
2025-09-29 15:00   ` [PATCH v2 6/6] doc: update docs for ethdev changes Bruce Richardson
2025-09-29 16:41   ` [PATCH v2 0/6] remove deprecated queue stats Stephen Hemminger
2025-09-29 16:50     ` Bruce Richardson
2025-10-03 11:04     ` Bruce Richardson
2025-09-29 22:57   ` Stephen Hemminger
2025-10-03 11:01 ` [PATCH v3 0/7] " Bruce Richardson
2025-10-03 11:01   ` [PATCH v3 1/7] net/ice: don't report empty queue xstats Bruce Richardson
2025-10-03 11:01   ` [PATCH v3 2/7] net/ipn3ke: drop unsupported per-queue xstats Bruce Richardson
2025-10-03 11:01   ` [PATCH v3 3/7] ethdev: remove queue stats from ethdev stats structure Bruce Richardson
2025-10-03 11:01   ` [PATCH v3 4/7] drivers/net: update to remove queue stats from eth stats Bruce Richardson
2025-10-03 11:01   ` [PATCH v3 5/7] app: " Bruce Richardson
2025-10-03 11:02   ` [PATCH v3 6/7] doc: update docs for ethdev changes Bruce Richardson
2025-10-03 11:02   ` Bruce Richardson [this message]

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=20251003110201.1541183-8-bruce.richardson@intel.com \
    --to=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).