DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH  0/2] l2fwd improvements
@ 2016-04-19  9:35 Jerin Jacob
  2016-04-19  9:35 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: remove number of cycles per second hardcording Jerin Jacob
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jerin Jacob @ 2016-04-19  9:35 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, bruce.richardson, pablo.de.lara.guarch, Jerin Jacob


Jerin Jacob (2):
  examples/l2fwd: remove number of cycles per second hardcording
  examples/l2fwd: increase mempool cache size for better performance

 examples/l2fwd/main.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 1/2] examples/l2fwd: remove number of cycles per second hardcording
  2016-04-19  9:35 [dpdk-dev] [PATCH 0/2] l2fwd improvements Jerin Jacob
@ 2016-04-19  9:35 ` Jerin Jacob
  2016-04-19  9:35 ` [dpdk-dev] [PATCH 2/2] examples/l2fwd: increase mempool cache size for better performance Jerin Jacob
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jerin Jacob @ 2016-04-19  9:35 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, bruce.richardson, pablo.de.lara.guarch, Jerin Jacob

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 examples/l2fwd/main.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1ad9488..7bdd1b5 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -134,10 +134,9 @@ struct l2fwd_port_statistics {
 } __rte_cache_aligned;
 struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS];
 
-/* A tsc-based timer responsible for triggering statistics printout */
-#define TIMER_MILLISECOND 2000000ULL /* around 1ms at 2 Ghz */
 #define MAX_TIMER_PERIOD 86400 /* 1 day max */
-static int64_t timer_period = 10 * TIMER_MILLISECOND * 1000; /* default period is 10 seconds */
+/* A tsc-based timer responsible for triggering statistics printout */
+static uint64_t timer_period = 10; /* default period is 10 seconds */
 
 /* Print out statistics on packets dropped */
 static void
@@ -274,7 +273,7 @@ l2fwd_main_loop(void)
 				timer_tsc += diff_tsc;
 
 				/* if timer has reached its timeout */
-				if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
+				if (unlikely(timer_tsc >= timer_period)) {
 
 					/* do this only on master core */
 					if (lcore_id == rte_get_master_lcore()) {
@@ -381,7 +380,7 @@ l2fwd_parse_timer_period(const char *q_arg)
 static int
 l2fwd_parse_args(int argc, char **argv)
 {
-	int opt, ret;
+	int opt, ret, timer_secs;
 	char **argvopt;
 	int option_index;
 	char *prgname = argv[0];
@@ -417,12 +416,13 @@ l2fwd_parse_args(int argc, char **argv)
 
 		/* timer period */
 		case 'T':
-			timer_period = l2fwd_parse_timer_period(optarg) * 1000 * TIMER_MILLISECOND;
-			if (timer_period < 0) {
+			timer_secs = l2fwd_parse_timer_period(optarg);
+			if (timer_secs < 0) {
 				printf("invalid timer period\n");
 				l2fwd_usage(prgname);
 				return -1;
 			}
+			timer_period = timer_secs;
 			break;
 
 		/* long options */
@@ -541,6 +541,9 @@ main(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
 
+	/* convert to number of cycles */
+	timer_period *= rte_get_timer_hz();
+
 	/* create the mbuf pool */
 	l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
 		0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
-- 
2.1.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 2/2] examples/l2fwd: increase mempool cache size for better performance
  2016-04-19  9:35 [dpdk-dev] [PATCH 0/2] l2fwd improvements Jerin Jacob
  2016-04-19  9:35 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: remove number of cycles per second hardcording Jerin Jacob
@ 2016-04-19  9:35 ` Jerin Jacob
  2016-04-29 17:45 ` [dpdk-dev] [PATCH 0/2] l2fwd improvements De Lara Guarch, Pablo
  2016-05-10 12:39 ` Pattan, Reshma
  3 siblings, 0 replies; 6+ messages in thread
From: Jerin Jacob @ 2016-04-19  9:35 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, bruce.richardson, pablo.de.lara.guarch, Jerin Jacob

l3fwd sets the mempool cache size to 256, selected the same value for l2fwd

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 examples/l2fwd/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 7bdd1b5..24715e3 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -80,6 +80,7 @@ static volatile bool force_quit;
 
 #define MAX_PKT_BURST 32
 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
+#define MEMPOOL_CACHE_SIZE 256
 
 /*
  * Configurable number of RX/TX ring descriptors
@@ -545,8 +546,9 @@ main(int argc, char **argv)
 	timer_period *= rte_get_timer_hz();
 
 	/* create the mbuf pool */
-	l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
-		0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
+	l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF,
+		MEMPOOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
+		rte_socket_id());
 	if (l2fwd_pktmbuf_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
 
-- 
2.1.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH  0/2] l2fwd improvements
  2016-04-19  9:35 [dpdk-dev] [PATCH 0/2] l2fwd improvements Jerin Jacob
  2016-04-19  9:35 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: remove number of cycles per second hardcording Jerin Jacob
  2016-04-19  9:35 ` [dpdk-dev] [PATCH 2/2] examples/l2fwd: increase mempool cache size for better performance Jerin Jacob
@ 2016-04-29 17:45 ` De Lara Guarch, Pablo
  2016-05-10 12:39 ` Pattan, Reshma
  3 siblings, 0 replies; 6+ messages in thread
From: De Lara Guarch, Pablo @ 2016-04-29 17:45 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas.monjalon, Richardson, Bruce



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, April 19, 2016 10:35 AM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Richardson, Bruce; De Lara Guarch,
> Pablo; Jerin Jacob
> Subject: [dpdk-dev] [PATCH 0/2] l2fwd improvements
> 
> 
> Jerin Jacob (2):
>   examples/l2fwd: remove number of cycles per second hardcording
>   examples/l2fwd: increase mempool cache size for better performance
> 
>  examples/l2fwd/main.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> --
> 2.1.0

Series-acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH  0/2] l2fwd improvements
  2016-04-19  9:35 [dpdk-dev] [PATCH 0/2] l2fwd improvements Jerin Jacob
                   ` (2 preceding siblings ...)
  2016-04-29 17:45 ` [dpdk-dev] [PATCH 0/2] l2fwd improvements De Lara Guarch, Pablo
@ 2016-05-10 12:39 ` Pattan, Reshma
  2016-06-08 20:18   ` Thomas Monjalon
  3 siblings, 1 reply; 6+ messages in thread
From: Pattan, Reshma @ 2016-05-10 12:39 UTC (permalink / raw)
  To: Jerin Jacob, dev
  Cc: thomas.monjalon, Richardson, Bruce, De Lara Guarch, Pablo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> Sent: Tuesday, April 19, 2016 10:35 AM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Richardson, Bruce
> <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 0/2] l2fwd improvements
> 
> 
> Jerin Jacob (2):
>   examples/l2fwd: remove number of cycles per second hardcording
>   examples/l2fwd: increase mempool cache size for better performance
> 
>  examples/l2fwd/main.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> --
> 2.1.0

Looks ok, small typo in patch 1 subject line "hardcoding"
Acked-by: Reshma Pattan <reshma.pattan@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH  0/2] l2fwd improvements
  2016-05-10 12:39 ` Pattan, Reshma
@ 2016-06-08 20:18   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2016-06-08 20:18 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Pattan, Reshma, dev, Richardson, Bruce, De Lara Guarch, Pablo

> > Jerin Jacob (2):
> >   examples/l2fwd: remove number of cycles per second hardcording
> >   examples/l2fwd: increase mempool cache size for better performance
> 
> Looks ok, small typo in patch 1 subject line "hardcoding"
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-08 20:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19  9:35 [dpdk-dev] [PATCH 0/2] l2fwd improvements Jerin Jacob
2016-04-19  9:35 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: remove number of cycles per second hardcording Jerin Jacob
2016-04-19  9:35 ` [dpdk-dev] [PATCH 2/2] examples/l2fwd: increase mempool cache size for better performance Jerin Jacob
2016-04-29 17:45 ` [dpdk-dev] [PATCH 0/2] l2fwd improvements De Lara Guarch, Pablo
2016-05-10 12:39 ` Pattan, Reshma
2016-06-08 20:18   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).