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 <[email protected]> --- 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

