[RFC,v2,20/26] app/test-pmd: use separate Rx and Tx queue limits

Message ID 20240813160003.423935-21-bruce.richards@intel.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series add meson config options for queues per port |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Bruce Richardson Aug. 13, 2024, 3:59 p.m. UTC
Update app to use the new defines RTE_MAX_ETHPORT_TX_QUEUES and
RTE_MAX_ETHPORT_RX_QUEUES rather than the old define
RTE_MAX_QUEUES_PER_PORT.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test-pmd/testpmd.c |  7 ++++---
 app/test-pmd/testpmd.h | 16 ++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index b1401136e4..84da9a80f2 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1305,7 +1305,7 @@  check_socket_id(const unsigned int socket_id)
 queueid_t
 get_allowed_max_nb_rxq(portid_t *pid)
 {
-	queueid_t allowed_max_rxq = RTE_MAX_QUEUES_PER_PORT;
+	queueid_t allowed_max_rxq = RTE_MAX_ETHPORT_RX_QUEUES;
 	bool max_rxq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
@@ -1353,7 +1353,7 @@  check_nb_rxq(queueid_t rxq)
 queueid_t
 get_allowed_max_nb_txq(portid_t *pid)
 {
-	queueid_t allowed_max_txq = RTE_MAX_QUEUES_PER_PORT;
+	queueid_t allowed_max_txq = RTE_MAX_ETHPORT_TX_QUEUES;
 	bool max_txq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
@@ -1564,7 +1564,8 @@  check_nb_txd(queueid_t txd)
 queueid_t
 get_allowed_max_nb_hairpinq(portid_t *pid)
 {
-	queueid_t allowed_max_hairpinq = RTE_MAX_QUEUES_PER_PORT;
+	queueid_t allowed_max_hairpinq = RTE_MIN(RTE_MAX_ETHPORT_RX_QUEUES,
+			RTE_MAX_ETHPORT_TX_QUEUES);
 	portid_t pi;
 	struct rte_eth_hairpin_cap cap;
 
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 9facd7f281..5e405775b1 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -332,10 +332,10 @@  struct rte_port {
 	uint8_t                 need_reconfig_queues; /**< need reconfiguring queues or not */
 	uint8_t                 rss_flag;   /**< enable rss or not */
 	uint8_t                 dcb_flag;   /**< enable dcb */
-	uint16_t                nb_rx_desc[RTE_MAX_QUEUES_PER_PORT+1]; /**< per queue rx desc number */
-	uint16_t                nb_tx_desc[RTE_MAX_QUEUES_PER_PORT+1]; /**< per queue tx desc number */
-	struct port_rxqueue     rxq[RTE_MAX_QUEUES_PER_PORT+1]; /**< per queue Rx config and state */
-	struct port_txqueue     txq[RTE_MAX_QUEUES_PER_PORT+1]; /**< per queue Tx config and state */
+	uint16_t                nb_rx_desc[RTE_MAX_ETHPORT_RX_QUEUES+1]; /**< per queue rx desc number */
+	uint16_t                nb_tx_desc[RTE_MAX_ETHPORT_TX_QUEUES+1]; /**< per queue tx desc number */
+	struct port_rxqueue     rxq[RTE_MAX_ETHPORT_RX_QUEUES+1]; /**< per queue Rx config and state */
+	struct port_txqueue     txq[RTE_MAX_ETHPORT_TX_QUEUES+1]; /**< per queue Tx config and state */
 	struct rte_ether_addr   *mc_addr_pool; /**< pool of multicast addrs */
 	uint32_t                mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
 	queueid_t               queue_nb; /**< nb. of queues for flow rules */
@@ -351,14 +351,14 @@  struct rte_port {
 	struct port_indirect_action *actions_list;
 	/**< Associated indirect actions. */
 	LIST_HEAD(, port_flow_tunnel) flow_tunnel_list;
-	const struct rte_eth_rxtx_callback *rx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
-	const struct rte_eth_rxtx_callback *tx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
+	const struct rte_eth_rxtx_callback *rx_dump_cb[RTE_MAX_ETHPORT_RX_QUEUES+1];
+	const struct rte_eth_rxtx_callback *tx_dump_cb[RTE_MAX_ETHPORT_TX_QUEUES+1];
 	/**< metadata value to insert in Tx packets. */
 	uint32_t		tx_metadata;
-	const struct rte_eth_rxtx_callback *tx_set_md_cb[RTE_MAX_QUEUES_PER_PORT+1];
+	const struct rte_eth_rxtx_callback *tx_set_md_cb[RTE_MAX_ETHPORT_TX_QUEUES+1];
 	/**< dynamic flags. */
 	uint64_t		mbuf_dynf;
-	const struct rte_eth_rxtx_callback *tx_set_dynf_cb[RTE_MAX_QUEUES_PER_PORT+1];
+	const struct rte_eth_rxtx_callback *tx_set_dynf_cb[RTE_MAX_ETHPORT_TX_QUEUES+1];
 	struct xstat_display_info xstats_info;
 };