remove prefix to some local macros in apps and examples

RTE_TEST_[RT]X_DESC_DEFAULT and RTE_TEST_[RT]X_DESC_MAX macros have been
copied in a lot of app/ and examples/ code.
Those macros are local to each program.

They are not related to a DPDK public header/API, drop the RTE_TEST_
prefix.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
This commit is contained in:
David Marchand 2022-10-04 10:01:16 +02:00
parent 1a852c1e87
commit 4ed8904955
25 changed files with 97 additions and 97 deletions

View File

@ -288,10 +288,10 @@ queueid_t nb_txq = 1; /**< Number of TX queues per port. */
* Configurable number of RX/TX ring descriptors.
* Defaults are supplied by drivers via ethdev.
*/
#define RTE_TEST_RX_DESC_DEFAULT 0
#define RTE_TEST_TX_DESC_DEFAULT 0
uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; /**< Number of RX descriptors. */
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /**< Number of TX descriptors. */
#define RX_DESC_DEFAULT 0
#define TX_DESC_DEFAULT 0
uint16_t nb_rxd = RX_DESC_DEFAULT; /**< Number of RX descriptors. */
uint16_t nb_txd = TX_DESC_DEFAULT; /**< Number of TX descriptors. */
#define RTE_PMD_PARAM_UNSET -1
/*
@ -1719,9 +1719,9 @@ init_config(void)
if (param_total_num_mbufs)
nb_mbuf_per_pool = param_total_num_mbufs;
else {
nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX +
nb_mbuf_per_pool = RX_DESC_MAX +
(nb_lcores * mb_mempool_cache) +
RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST;
TX_DESC_MAX + MAX_PKT_BURST;
nb_mbuf_per_pool *= RTE_MAX_ETHPORTS;
}

View File

@ -28,9 +28,6 @@
#define RTE_PORT_ALL (~(portid_t)0x0)
#define RTE_TEST_RX_DESC_MAX 2048
#define RTE_TEST_TX_DESC_MAX 2048
#define RTE_PORT_STOPPED (uint16_t)0
#define RTE_PORT_STARTED (uint16_t)1
#define RTE_PORT_CLOSED (uint16_t)2
@ -67,6 +64,9 @@ extern uint8_t cl_quit;
/* The prefix of the mbuf pool names created by the application. */
#define MBUF_POOL_NAME_PFX "mb_pool"
#define RX_DESC_MAX 2048
#define TX_DESC_MAX 2048
#define MAX_PKT_BURST 512
#define DEF_PKT_BURST 32

View File

@ -47,8 +47,8 @@
#define MBUF_CACHE_SIZE (250)
#define BURST_SIZE (32)
#define RTE_TEST_RX_DESC_MAX (2048)
#define RTE_TEST_TX_DESC_MAX (2048)
#define RX_DESC_MAX (2048)
#define TX_DESC_MAX (2048)
#define MAX_PKT_BURST (512)
#define DEF_PKT_BURST (16)
@ -225,8 +225,8 @@ test_setup(void)
"Ethernet header struct allocation failed!");
}
nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + DEF_PKT_BURST +
RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST;
nb_mbuf_per_pool = RX_DESC_MAX + DEF_PKT_BURST +
TX_DESC_MAX + MAX_PKT_BURST;
if (test_params->mbuf_pool == NULL) {
test_params->mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0,

View File

@ -18,8 +18,8 @@
#define NB_SOCKETS (2)
#define MEMPOOL_CACHE_SIZE 250
#define MAX_PKT_BURST (32)
#define RTE_TEST_RX_DESC_DEFAULT (1024)
#define RTE_TEST_TX_DESC_DEFAULT (1024)
#define RX_DESC_DEFAULT (1024)
#define TX_DESC_DEFAULT (1024)
#define RTE_PORT_ALL (~(uint16_t)0x0)
/* how long test would take at full line rate */
@ -703,8 +703,8 @@ test_pmd_perf(void)
init_mbufpool(NB_MBUF);
if (sc_flag == SC_CONTINUOUS) {
nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
nb_txd = RTE_TEST_TX_DESC_DEFAULT;
nb_rxd = RX_DESC_DEFAULT;
nb_txd = TX_DESC_DEFAULT;
}
printf("CONFIG RXD=%d TXD=%d\n", nb_rxd, nb_txd);

View File

@ -37,8 +37,8 @@ test_event_inline_ipsec(void)
#define NB_ETHPORTS_USED 1
#define MEMPOOL_CACHE_SIZE 32
#define MAX_PKT_BURST 32
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define RTE_PORT_ALL (~(uint16_t)0x0)
#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */
@ -1506,8 +1506,8 @@ inline_ipsec_testsuite_setup(void)
printf("Generate %d packets\n", MAX_TRAFFIC_BURST);
nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
nb_txd = RTE_TEST_TX_DESC_DEFAULT;
nb_rxd = RX_DESC_DEFAULT;
nb_txd = TX_DESC_DEFAULT;
/* configuring port 0 for the test is enough */
port_id = 0;

View File

@ -203,7 +203,7 @@ The global configuration for TX queues is stored in a static structure:
.hthresh = TX_HTHRESH,
.wthresh = TX_WTHRESH,
},
.tx_free_thresh = RTE_TEST_TX_DESC_DEFAULT + 1, /* disable feature */
.tx_free_thresh = TX_DESC_DEFAULT + 1, /* disable feature */
};
Receive, Process and Transmit Packets

View File

@ -49,8 +49,8 @@
#define CRC_24B_LEN 3
/* Configurable number of RX/TX ring descriptors */
#define RTE_TEST_RX_DESC_DEFAULT 128
#define RTE_TEST_TX_DESC_DEFAULT 512
#define RX_DESC_DEFAULT 128
#define TX_DESC_DEFAULT 512
#define BBDEV_ASSERT(a) do { \
if (!(a)) { \
@ -467,7 +467,7 @@ initialize_ports(struct app_config_params *app_params,
/* initialize RX queues for encoder */
for (q = 0; q < app_params->num_enc_cores; q++) {
ret = rte_eth_rx_queue_setup(port_id, q,
RTE_TEST_RX_DESC_DEFAULT,
RX_DESC_DEFAULT,
rte_eth_dev_socket_id(port_id),
NULL, ethdev_mbuf_mempool);
if (ret < 0) {
@ -479,7 +479,7 @@ initialize_ports(struct app_config_params *app_params,
/* initialize TX queues for decoder */
for (q = 0; q < app_params->num_dec_cores; q++) {
ret = rte_eth_tx_queue_setup(port_id, q,
RTE_TEST_TX_DESC_DEFAULT,
TX_DESC_DEFAULT,
rte_eth_dev_socket_id(port_id), NULL);
if (ret < 0) {
printf("rte_eth_tx_queue_setup: err=%d, queue=%u\n",

View File

@ -84,10 +84,10 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -87,11 +87,11 @@ static uint32_t max_flow_ttl = DEF_FLOW_TTL;
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -76,10 +76,10 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr ports_eth_addr[MAX_PORTS];

View File

@ -72,11 +72,11 @@ enum cdev_type {
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -7,8 +7,8 @@
int
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
{
uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
uint16_t nb_rxd = RX_DESC_DEFAULT;
uint16_t nb_txd = TX_DESC_DEFAULT;
struct rte_eth_conf port_conf = {
.rxmode = {
.split_hdr_size = 0,

View File

@ -46,8 +46,8 @@
#define MAX_RX_QUEUE_PER_LCORE 16
#define MAX_TX_QUEUE_PER_PORT 16
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
#define MEMPOOL_CACHE_SIZE 256

View File

@ -660,8 +660,8 @@ main(int argc, char **argv)
rte_panic("Invalid port pair config\n");
}
nb_mbufs = RTE_MAX(nb_ports * (RTE_TEST_RX_DESC_DEFAULT +
RTE_TEST_TX_DESC_DEFAULT +
nb_mbufs = RTE_MAX(nb_ports * (RX_DESC_DEFAULT +
TX_DESC_DEFAULT +
MAX_PKT_BURST + rte_lcore_count() *
MEMPOOL_CACHE_SIZE), 8192U);

View File

@ -45,10 +45,10 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -51,10 +51,10 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -55,10 +55,10 @@ static int promiscuous_on;
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -43,8 +43,8 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define MAX_TX_QUEUE_PER_PORT RTE_MAX_ETHPORTS
#define MAX_RX_QUEUE_PER_PORT 128
@ -56,8 +56,8 @@
#define NB_SOCKETS 8
/* Static global variables used within this file. */
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/**< Ports set in promiscuous mode off by default. */
static int promiscuous_on;

View File

@ -121,8 +121,8 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
/*
* These two thresholds were decided on by running the training algorithm on
@ -134,8 +134,8 @@
#define NUM_TELSTATS RTE_DIM(telstats_strings)
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -20,8 +20,8 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define MAX_PKT_BURST 32
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */

View File

@ -53,8 +53,8 @@
#define MAX_LCORE_PARAMS 1024
uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
uint16_t nb_rxd = RX_DESC_DEFAULT;
uint16_t nb_txd = TX_DESC_DEFAULT;
/**< Ports set in promiscuous mode off by default. */
static int promiscuous_on;
@ -445,7 +445,7 @@ print_usage(const char *prgname)
" another is route entry at while line leads with character '%c'.\n"
" --rule_ipv6=FILE: Specify the ipv6 rules entries file.\n"
" --alg: ACL classify method to use, one of: %s.\n\n",
prgname, RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT,
prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT,
ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg);
}

View File

@ -45,10 +45,10 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
static uint16_t nb_rxd = RX_DESC_DEFAULT;
static uint16_t nb_txd = TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static struct rte_ether_addr lsi_ports_eth_addr[RTE_MAX_ETHPORTS];

View File

@ -57,8 +57,8 @@
#define DEVICE_SAFE_REMOVE 2
/* Configurable number of RX/TX ring descriptors */
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 512
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 512
#define INVALID_PORT_ID 0xFF
#define INVALID_DMA_ID -1
@ -445,8 +445,8 @@ port_init(uint16_t port)
/*configure the number of supported virtio devices based on VMDQ limits */
num_devices = dev_info.max_vmdq_pools;
rx_ring_size = RTE_TEST_RX_DESC_DEFAULT;
tx_ring_size = RTE_TEST_TX_DESC_DEFAULT;
rx_ring_size = RX_DESC_DEFAULT;
tx_ring_size = TX_DESC_DEFAULT;
tx_rings = (uint16_t)rte_lcore_count();
@ -493,7 +493,7 @@ port_init(uint16_t port)
"for port %u: %s.\n", port, strerror(-retval));
return retval;
}
if (rx_ring_size > RTE_TEST_RX_DESC_DEFAULT) {
if (rx_ring_size > RX_DESC_DEFAULT) {
RTE_LOG(ERR, VHOST_PORT, "Mbuf pool has an insufficient size "
"for Rx queues on port %u.\n", port);
return -1;

View File

@ -38,8 +38,8 @@
* 1024 queues require to meet the needs of a large number of vmdq_pools.
* (RX/TX_queue_nb * RX/TX_ring_descriptors_nb) per port.
*/
#define NUM_MBUFS_PER_PORT (MAX_QUEUES * RTE_MAX(RTE_TEST_RX_DESC_DEFAULT, \
RTE_TEST_TX_DESC_DEFAULT))
#define NUM_MBUFS_PER_PORT (MAX_QUEUES * RTE_MAX(RX_DESC_DEFAULT, \
TX_DESC_DEFAULT))
#define MBUF_CACHE_SIZE 64
#define MAX_PKT_BURST 32
@ -47,8 +47,8 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define INVALID_PORT_ID 0xFF
@ -177,8 +177,8 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_txconf *txconf;
struct rte_eth_conf port_conf;
uint16_t rxRings, txRings;
uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT;
uint16_t txRingSize = RTE_TEST_TX_DESC_DEFAULT;
uint16_t rxRingSize = RX_DESC_DEFAULT;
uint16_t txRingSize = TX_DESC_DEFAULT;
int retval;
uint16_t q;
uint16_t queues_per_pool;
@ -269,8 +269,8 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
&txRingSize);
if (retval != 0)
return retval;
if (RTE_MAX(rxRingSize, txRingSize) > RTE_MAX(RTE_TEST_RX_DESC_DEFAULT,
RTE_TEST_TX_DESC_DEFAULT)) {
if (RTE_MAX(rxRingSize, txRingSize) > RTE_MAX(RX_DESC_DEFAULT,
TX_DESC_DEFAULT)) {
printf("Mbuf pool has an insufficient size for port %u.\n",
port);
return -1;

View File

@ -39,8 +39,8 @@
* 1024 queues require to meet the needs of a large number of vmdq_pools.
* (RX/TX_queue_nb * RX/TX_ring_descriptors_nb) per port.
*/
#define NUM_MBUFS_PER_PORT (MAX_QUEUES * RTE_MAX(RTE_TEST_RX_DESC_DEFAULT, \
RTE_TEST_TX_DESC_DEFAULT))
#define NUM_MBUFS_PER_PORT (MAX_QUEUES * RTE_MAX(RX_DESC_DEFAULT, \
TX_DESC_DEFAULT))
#define MBUF_CACHE_SIZE 64
#define MAX_PKT_BURST 32
@ -48,8 +48,8 @@
/*
* Configurable number of RX/TX ring descriptors
*/
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RX_DESC_DEFAULT 1024
#define TX_DESC_DEFAULT 1024
#define INVALID_PORT_ID 0xFF
@ -191,8 +191,8 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
{
struct rte_eth_dev_info dev_info;
struct rte_eth_conf port_conf = {0};
uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT;
uint16_t txRingSize = RTE_TEST_TX_DESC_DEFAULT;
uint16_t rxRingSize = RX_DESC_DEFAULT;
uint16_t txRingSize = TX_DESC_DEFAULT;
int retval;
uint16_t q;
uint16_t queues_per_pool;
@ -300,7 +300,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
if (retval != 0)
return retval;
if (RTE_MAX(rxRingSize, txRingSize) >
RTE_MAX(RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT)) {
RTE_MAX(RX_DESC_DEFAULT, TX_DESC_DEFAULT)) {
printf("Mbuf pool has an insufficient size for port %u.\n",
port);
return -1;