Skip to contentSkip to conversation

app/testpmd: fix queue stats mapping configuration

RFC Superseded h00482409 1 participant 1 message Nov 20, 2020

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

h00482409

author
#0 lore raw

RFC v3 1/1 app/testpmd: fix queue stats mapping configuration

From: Huisong Li <[email protected]>

Currently, the queue stats mapping has the following problems:
1) Many PMD drivers don't support queue stats mapping. But there is no failure message after executing the command "set stat_qmap rx 0 2 2".
2) Once queue mapping is set, unrelated and unmapped queues are also displayed.
3) The configuration result does not take effect or can not be queried in real time.
4) The mapping arrays, "tx_queue_stats_mappings_array" & "rx_queue_stats_mappings_array" are global and their sizes are based on fixed max port and queue size assumptions.
5) These record structures, 'map_port_queue_stats_mapping_registers()' and its sub functions are redundant for majority of drivers.
6) The display of the queue stats and queue stats mapping is mixed together.

Since xstats is used to obtain queue statistics, we have made the following
simplifications and adjustments:
1) If PMD requires and supports queue stats mapping, configure to driver in real time by calling ethdev API after executing the command "set stat_qmap rx/tx ...". If not, the command can not be accepted.
2) Besed on the above adjustments, these record structures, 'map_port_queue_stats_mapping_registers()' and its sub functions can be removed. "tx-queue-stats-mapping" & "rx-queue-stats-mapping" parameters, and 'parse_queue_stats_mapping_config()' can be removed too.
3) remove display of queue stats mapping in 'fwd_stats_display()' & 'nic_stats_display()', and obtain queue stats by xstats.
Since the record structures is removed, 'nic_stats_mapping_display()' can be deleted.

Fixes 4dccdc789bf4b ("app/testpmd: simplify handling of stats mappings error")
Fixes 013af9b6b64f6 ("app/testpmd: various updates")
Fixes ed30d9b691b21 ("app/testpmd: add stats per queue")

---
V2 -> V3
* remove record structures, "rx/tx-queue-stats-mapping" parameters and related function.

V1 -> V2
* adjust commit log description.

 app/test-pmd/cmdline.c    |  17 ++---
 app/test-pmd/config.c     | 144 +++++-----------------------------
 app/test-pmd/parameters.c | 107 --------------------------
 app/test-pmd/testpmd.c    | 191 +++++-----------------------------------------
 app/test-pmd/testpmd.h    |  22 ------
 5 files changed, 46 insertions(+), 435 deletions(-)
app/test-pmd/cmdline.c +6 -11
index 5e2881e..4c1ee0d 100644
@@ -163,7 +163,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"Display:\n"
 			"--------\n\n"
 
-			"show port (info|stats|summary|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)\n"
+			"show port (info|stats|summary|xstats|fdir|dcb_tc|cap) (port_id|all)\n"
 			"    Display information for port_id, or all.\n\n"
 
 			"show port port_id (module_eeprom|eeprom)\n"
@@ -177,7 +177,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"show port (port_id) rss-hash [key]\n"
 			"    Display the RSS hash functions and RSS hash key of port\n\n"
 
-			"clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
+			"clear port (info|stats|xstats|fdir) (port_id|all)\n"
 			"    Clear information for port_id, or all.\n\n"
 
 			"show (rxq|txq) info (port_id) (queue_id)\n"
@@ -7552,9 +7552,6 @@ static void cmd_showportall_parsed(void *parsed_result,
 		RTE_ETH_FOREACH_DEV(i)
 			fdir_get_infos(i);
 #endif
-	else if (!strcmp(res->what, "stat_qmap"))
-		RTE_ETH_FOREACH_DEV(i)
-			nic_stats_mapping_display(i);
 	else if (!strcmp(res->what, "dcb_tc"))
 		RTE_ETH_FOREACH_DEV(i)
 			port_dcb_info_display(i);
@@ -7570,14 +7567,14 @@ cmdline_parse_token_string_t cmd_showportall_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
 cmdline_parse_token_string_t cmd_showportall_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
-				 "info#summary#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
+				 "info#summary#stats#xstats#fdir#dcb_tc#cap");
 cmdline_parse_token_string_t cmd_showportall_all =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
 cmdline_parse_inst_t cmd_showportall = {
 	.f = cmd_showportall_parsed,
 	.data = NULL,
 	.help_str = "show|clear port "
-		"info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap all",
+		"info|summary|stats|xstats|fdir|dcb_tc|cap all",
 	.tokens = {
 		(void *)&cmd_showportall_show,
 		(void *)&cmd_showportall_port,
@@ -7619,8 +7616,6 @@ static void cmd_showport_parsed(void *parsed_result,
 	else if (!strcmp(res->what, "fdir"))
 		 fdir_get_infos(res->portnum);
 #endif
-	else if (!strcmp(res->what, "stat_qmap"))
-		nic_stats_mapping_display(res->portnum);
 	else if (!strcmp(res->what, "dcb_tc"))
 		port_dcb_info_display(res->portnum);
 	else if (!strcmp(res->what, "cap"))
@@ -7634,7 +7629,7 @@ cmdline_parse_token_string_t cmd_showport_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
 cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
-				 "info#summary#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
+				 "info#summary#stats#xstats#fdir#dcb_tc#cap");
 cmdline_parse_token_num_t cmd_showport_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, RTE_UINT16);
 
@@ -7642,7 +7637,7 @@ cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
 	.data = NULL,
 	.help_str = "show|clear port "
-		"info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap "
+		"info|summary|stats|xstats|fdir|dcb_tc|cap "
 		"<port_id>",
 	.tokens = {
 		(void *)&cmd_showport_show,
app/test-pmd/config.c +21 -123

184 lines not on this page · raw message

app/test-pmd/parameters.c +0 -107

131 lines not on this page · raw message

app/test-pmd/testpmd.c +19 -172

248 lines not on this page · raw message

app/test-pmd/testpmd.h +0 -22
index 6b901a8..5f23162 100644
@@ -206,8 +206,6 @@ struct rte_port {
 	uint16_t                tunnel_tso_segsz; /**< Segmentation offload MSS for tunneled pkts. */
 	uint16_t                tx_vlan_id;/**< The tag ID */
 	uint16_t                tx_vlan_id_outer;/**< The outer tag ID */
-	uint8_t                 tx_queue_stats_mapping_enabled;
-	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */
 	uint8_t                 need_setup;     /**< port just attached */
 	uint8_t                 need_reconfig;  /**< need reconfiguring port or not */
@@ -326,25 +324,6 @@ enum dcb_mode_enable
 	DCB_ENABLED
 };
 
-#define MAX_TX_QUEUE_STATS_MAPPINGS 1024 /* MAX_PORT of 32 @ 32 tx_queues/port */
-#define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */
-
-struct queue_stats_mappings {
-	portid_t port_id;
-	uint16_t queue_id;
-	uint8_t stats_counter_id;
-} __rte_cache_aligned;
-
-extern struct queue_stats_mappings tx_queue_stats_mappings_array[];
-extern struct queue_stats_mappings rx_queue_stats_mappings_array[];
-
-/* Assign both tx and rx queue stats mappings to the same default values */
-extern struct queue_stats_mappings *tx_queue_stats_mappings;
-extern struct queue_stats_mappings *rx_queue_stats_mappings;
-
-extern uint16_t nb_tx_queue_stats_mappings;
-extern uint16_t nb_rx_queue_stats_mappings;
-
 extern uint8_t xstats_hide_zero; /**< Hide zero values for xstats display */
 
 /* globals used for configuration */
@@ -790,7 +769,6 @@ void nic_stats_display(portid_t port_id);
 void nic_stats_clear(portid_t port_id);
 void nic_xstats_display(portid_t port_id);
 void nic_xstats_clear(portid_t port_id);
-void nic_stats_mapping_display(portid_t port_id);
 void device_infos_display(const char *identifier);
 void port_infos_display(portid_t port_id);
 void port_summary_display(portid_t port_id);
Signature · 1 line
2.7.4