summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIntel <intel.com>2013-07-23 00:00:00 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:16:10 +0200
commite93b24a3da57166218598d116bd3a2df7865974a (patch)
tree61b5918d93c509c049965d6a079be02cd0579b7f
parentb451aa39db31c32a40edbbf3b2c6c53f034a8fc8 (diff)
downloaddpdk-e93b24a3da57166218598d116bd3a2df7865974a.zip
dpdk-e93b24a3da57166218598d116bd3a2df7865974a.tar.gz
dpdk-e93b24a3da57166218598d116bd3a2df7865974a.tar.xz
examples/qos_sched: add --msz for mempool size
Signed-off-by: Intel
-rwxr-xr-xexamples/qos_sched/args.c13
-rwxr-xr-xexamples/qos_sched/init.c5
-rwxr-xr-xexamples/qos_sched/main.h3
3 files changed, 17 insertions, 4 deletions
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index c9cfdb2..b28729f 100755
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -85,6 +85,7 @@ static const char usage[] =
" QoS enqueue size (default value is %u) \n"
" C = QoS dequeue size (default value is %u) \n"
" D = Worker lcore write burst size to NIC TX (default value is %u) \n"
+ " --msz M : Mempool size (in number of mbufs) for each pfc (default %u) \n"
" --rth \"A, B, C\" : RX queue threshold parameters \n"
" A = RX prefetch threshold (default value is %u) \n"
" B = RX host threshold (default value is %u) \n"
@@ -102,7 +103,8 @@ app_usage(const char *prgname)
{
printf(usage, prgname, app_master_core,
APP_RX_DESC_DEFAULT, APP_RING_SIZE, APP_TX_DESC_DEFAULT,
- MAX_PKT_RX_BURST, PKT_ENQUEUE, PKT_DEQUEUE, MAX_PKT_TX_BURST,
+ MAX_PKT_RX_BURST, PKT_ENQUEUE, PKT_DEQUEUE,
+ MAX_PKT_TX_BURST, NB_MBUF,
RX_PTHRESH, RX_HTHRESH, RX_WTHRESH,
TX_PTHRESH, TX_HTHRESH, TX_WTHRESH
);
@@ -336,6 +338,7 @@ app_parse_args(int argc, char **argv)
{ "mst", 1, 0, 0 },
{ "rsz", 1, 0, 0 },
{ "bsz", 1, 0, 0 },
+ { "msz", 1, 0, 0 },
{ "rth", 1, 0, 0 },
{ "tth", 1, 0, 0 },
{ "cfg", 1, 0, 0 },
@@ -388,6 +391,14 @@ app_parse_args(int argc, char **argv)
}
break;
}
+ if (str_is(optname, "msz")) {
+ mp_size = atoi(optarg);
+ if (mp_size <= 0) {
+ RTE_LOG(ERR, APP, "Invalid mempool size %s\n", optarg);
+ return -1;
+ }
+ break;
+ }
if (str_is(optname, "rth")) {
ret = app_parse_rth_conf(optarg);
if (ret) {
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 7c40fd8..b2e7b71 100755
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -81,6 +81,7 @@ struct ring_thresh tx_thresh = {
uint32_t nb_pfc;
const char *cfg_profile = NULL;
+int mp_size = NB_MBUF;
struct flow_conf qos_conf[MAX_DATA_STREAMS];
static const struct rte_eth_conf port_conf = {
@@ -343,7 +344,7 @@ int app_init(void)
/* create the mbuf pools for each RX Port */
rte_snprintf(pool_name, MAX_NAME_LEN, "mbuf_pool%u", i);
- qos_conf[i].mbuf_pool = rte_mempool_create(pool_name, NB_MBUF, MBUF_SIZE,
+ qos_conf[i].mbuf_pool = rte_mempool_create(pool_name, mp_size, MBUF_SIZE,
burst_conf.rx_burst * 4,
sizeof(struct rte_pktmbuf_pool_private),
rte_pktmbuf_pool_init, NULL,
@@ -365,7 +366,7 @@ int app_init(void)
rte_get_timer_hz());
RTE_LOG(INFO, APP, "Ring sizes: NIC RX = %u, Mempool = %d SW queue = %u,"
- "NIC TX = %u\n", ring_conf.rx_size, NB_MBUF, ring_conf.ring_size,
+ "NIC TX = %u\n", ring_conf.rx_size, mp_size, ring_conf.ring_size,
ring_conf.tx_size);
RTE_LOG(INFO, APP, "Burst sizes: RX read = %hu, RX write = %hu,\n"
diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h
index 243064c..20ed590 100755
--- a/examples/qos_sched/main.h
+++ b/examples/qos_sched/main.h
@@ -57,7 +57,7 @@ extern "C" {
#define MBUF_SIZE (1528 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define APP_RING_SIZE (8*1024)
-#define NB_MBUF (64*1024*32)
+#define NB_MBUF (2*1024*1024)
#define MAX_PKT_RX_BURST 64
#define PKT_ENQUEUE 64
@@ -159,6 +159,7 @@ struct ring_thresh
extern uint32_t nb_pfc;
extern const char *cfg_profile;
+extern int mp_size;
extern struct flow_conf qos_conf[];
extern int app_pipe_to_profile[MAX_SCHED_SUBPORTS][MAX_SCHED_PIPES];