DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs
@ 2017-03-31 13:36 Andriy Berestovskyy
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Andriy Berestovskyy
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:36 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

At the moment ip_pipeline example uses 32 during the initialization,
which leads to an error on systems with more than 32 CPUs.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 examples/ip_pipeline/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index c7f9470..1dc2a04 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -69,7 +69,8 @@ static void
 app_init_core_map(struct app_params *app)
 {
 	APP_LOG(app, HIGH, "Initializing CPU core map ...");
-	app->core_map = cpu_core_map_init(4, 32, 4, 0);
+	app->core_map = cpu_core_map_init(RTE_MAX_NUMA_NODES, RTE_MAX_LCORE,
+				4, 0);
 
 	if (app->core_map == NULL)
 		rte_panic("Cannot create CPU core map\n");
-- 
2.7.4

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

* [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported
  2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
@ 2017-03-31 13:36 ` Andriy Berestovskyy
  2017-03-31 14:17   ` Dumitrescu, Cristian
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool Andriy Berestovskyy
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:36 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

Some PMDs (mostly VFs) do not provide link up/down functionality.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 examples/ip_pipeline/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 1dc2a04..be148fc 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -717,7 +717,8 @@ app_link_up_internal(struct app_params *app, struct app_link_params *cp)
 
 	/* PMD link up */
 	status = rte_eth_dev_set_link_up(cp->pmd_id);
-	if (status < 0)
+	/* Do not panic if PMD does not provide link up functionality */
+	if (status < 0 && status != -ENOTSUP)
 		rte_panic("%s (%" PRIu32 "): PMD set link up error %"
 			PRId32 "\n", cp->name, cp->pmd_id, status);
 
@@ -733,7 +734,8 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp)
 
 	/* PMD link down */
 	status = rte_eth_dev_set_link_down(cp->pmd_id);
-	if (status < 0)
+	/* Do not panic if PMD does not provide link down functionality */
+	if (status < 0 && status != -ENOTSUP)
 		rte_panic("%s (%" PRIu32 "): PMD set link down error %"
 			PRId32 "\n", cp->name, cp->pmd_id, status);
 
-- 
2.7.4

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

* [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool
  2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Andriy Berestovskyy
@ 2017-03-31 13:36 ` Andriy Berestovskyy
  2017-03-31 14:18   ` Dumitrescu, Cristian
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader Andriy Berestovskyy
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:36 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

Makes code a bit cleaner and type-aware.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 lib/librte_port/rte_port_fd.c          | 7 +------
 lib/librte_port/rte_port_source_sink.c | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/lib/librte_port/rte_port_fd.c b/lib/librte_port/rte_port_fd.c
index 0d640f3..03e69f5 100644
--- a/lib/librte_port/rte_port_fd.c
+++ b/lib/librte_port/rte_port_fd.c
@@ -110,15 +110,10 @@ rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 	struct rte_port_fd_reader *p = (struct rte_port_fd_reader *) port;
 	uint32_t i;
 
-	if (rte_mempool_get_bulk(p->mempool, (void **) pkts, n_pkts) != 0)
+	if (rte_pktmbuf_alloc_bulk(p->mempool, pkts, n_pkts) != 0)
 		return 0;
 
 	for (i = 0; i < n_pkts; i++) {
-		rte_mbuf_refcnt_set(pkts[i], 1);
-		rte_pktmbuf_reset(pkts[i]);
-	}
-
-	for (i = 0; i < n_pkts; i++) {
 		struct rte_mbuf *pkt = pkts[i];
 		void *pkt_data = rte_pktmbuf_mtod(pkt, void *);
 		ssize_t n_bytes;
diff --git a/lib/librte_port/rte_port_source_sink.c b/lib/librte_port/rte_port_source_sink.c
index 4cad710..796418a 100644
--- a/lib/librte_port/rte_port_source_sink.c
+++ b/lib/librte_port/rte_port_source_sink.c
@@ -289,14 +289,9 @@ rte_port_source_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 	struct rte_port_source *p = (struct rte_port_source *) port;
 	uint32_t i;
 
-	if (rte_mempool_get_bulk(p->mempool, (void **) pkts, n_pkts) != 0)
+	if (rte_pktmbuf_alloc_bulk(p->mempool, pkts, n_pkts) != 0)
 		return 0;
 
-	for (i = 0; i < n_pkts; i++) {
-		rte_mbuf_refcnt_set(pkts[i], 1);
-		rte_pktmbuf_reset(pkts[i]);
-	}
-
 	if (p->pkt_buff != NULL) {
 		for (i = 0; i < n_pkts; i++) {
 			uint8_t *pkt_data = rte_pktmbuf_mtod(pkts[i],
-- 
2.7.4

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

* [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader
  2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Andriy Berestovskyy
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool Andriy Berestovskyy
@ 2017-03-31 13:36 ` Andriy Berestovskyy
  2017-03-31 14:18   ` Dumitrescu, Cristian
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 5/5] port: minor typo Andriy Berestovskyy
  2017-03-31 14:17 ` [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Dumitrescu, Cristian
  4 siblings, 1 reply; 11+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:36 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

The code should return the actual number of packets read.

Fixes: 5a99f208 ("port: support file descriptor")
Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 lib/librte_port/rte_port_fd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_port/rte_port_fd.c b/lib/librte_port/rte_port_fd.c
index 03e69f5..914dfac 100644
--- a/lib/librte_port/rte_port_fd.c
+++ b/lib/librte_port/rte_port_fd.c
@@ -108,7 +108,7 @@ static int
 rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
 	struct rte_port_fd_reader *p = (struct rte_port_fd_reader *) port;
-	uint32_t i;
+	uint32_t i, j;
 
 	if (rte_pktmbuf_alloc_bulk(p->mempool, pkts, n_pkts) != 0)
 		return 0;
@@ -126,12 +126,12 @@ rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 		pkt->pkt_len = n_bytes;
 	}
 
-	for ( ; i < n_pkts; i++)
-		rte_pktmbuf_free(pkts[i]);
+	for (j = i; j < n_pkts; j++)
+		rte_pktmbuf_free(pkts[j]);
 
 	RTE_PORT_FD_READER_STATS_PKTS_IN_ADD(p, i);
 
-	return n_pkts;
+	return i;
 }
 
 static int
-- 
2.7.4

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

* [dpdk-dev] [PATCH 5/5] port: minor typo
  2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
                   ` (2 preceding siblings ...)
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader Andriy Berestovskyy
@ 2017-03-31 13:36 ` Andriy Berestovskyy
  2017-03-31 14:18   ` Dumitrescu, Cristian
  2017-03-31 14:17 ` [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Dumitrescu, Cristian
  4 siblings, 1 reply; 11+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:36 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 lib/librte_port/rte_port_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c
index 5aaa8f7..6862849 100644
--- a/lib/librte_port/rte_port_ethdev.c
+++ b/lib/librte_port/rte_port_ethdev.c
@@ -456,8 +456,8 @@ rte_port_ethdev_writer_nodrop_tx_bulk(void *port,
 			return 0;
 
 		/*
-		 * If we didnt manage to send all packets in single burst, move
-		 * remaining packets to the buffer and call send burst.
+		 * If we did not manage to send all packets in single burst,
+		 * move remaining packets to the buffer and call send burst.
 		 */
 		for (; n_pkts_ok < n_pkts; n_pkts_ok++) {
 			struct rte_mbuf *pkt = pkts[n_pkts_ok];
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs
  2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
                   ` (3 preceding siblings ...)
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 5/5] port: minor typo Andriy Berestovskyy
@ 2017-03-31 14:17 ` Dumitrescu, Cristian
  2017-04-21  0:16   ` Thomas Monjalon
  4 siblings, 1 reply; 11+ messages in thread
From: Dumitrescu, Cristian @ 2017-03-31 14:17 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev



> -----Original Message-----
> From: Andriy Berestovskyy
> [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> Sent: Friday, March 31, 2017 2:37 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 1/5] examples/ip_pipeline: add support for more than 32
> CPUs
> 
> At the moment ip_pipeline example uses 32 during the initialization,
> which leads to an error on systems with more than 32 CPUs.
> 
> Signed-off-by: Andriy Berestovskyy
> <Andriy.Berestovskyy@caviumnetworks.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Andriy Berestovskyy
@ 2017-03-31 14:17   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 11+ messages in thread
From: Dumitrescu, Cristian @ 2017-03-31 14:17 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev



> -----Original Message-----
> From: Andriy Berestovskyy
> [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> Sent: Friday, March 31, 2017 2:37 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not
> supported
> 
> Some PMDs (mostly VFs) do not provide link up/down functionality.
> 
> Signed-off-by: Andriy Berestovskyy
> <Andriy.Berestovskyy@caviumnetworks.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool Andriy Berestovskyy
@ 2017-03-31 14:18   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 11+ messages in thread
From: Dumitrescu, Cristian @ 2017-03-31 14:18 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev



> -----Original Message-----
> From: Andriy Berestovskyy
> [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> Sent: Friday, March 31, 2017 2:37 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 3/5] port: use mbuf alloc bulk instead of mempool
> 
> Makes code a bit cleaner and type-aware.
> 
> Signed-off-by: Andriy Berestovskyy
> <Andriy.Berestovskyy@caviumnetworks.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader Andriy Berestovskyy
@ 2017-03-31 14:18   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 11+ messages in thread
From: Dumitrescu, Cristian @ 2017-03-31 14:18 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev



> -----Original Message-----
> From: Andriy Berestovskyy
> [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> Sent: Friday, March 31, 2017 2:37 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 4/5] port: fix file descriptor reader
> 
> The code should return the actual number of packets read.
> 
> Fixes: 5a99f208 ("port: support file descriptor")
> Signed-off-by: Andriy Berestovskyy
> <Andriy.Berestovskyy@caviumnetworks.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH 5/5] port: minor typo
  2017-03-31 13:36 ` [dpdk-dev] [PATCH 5/5] port: minor typo Andriy Berestovskyy
@ 2017-03-31 14:18   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 11+ messages in thread
From: Dumitrescu, Cristian @ 2017-03-31 14:18 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev



> -----Original Message-----
> From: Andriy Berestovskyy
> [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> Sent: Friday, March 31, 2017 2:37 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 5/5] port: minor typo
> 
> Signed-off-by: Andriy Berestovskyy
> <Andriy.Berestovskyy@caviumnetworks.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs
  2017-03-31 14:17 ` [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Dumitrescu, Cristian
@ 2017-04-21  0:16   ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2017-04-21  0:16 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev, Dumitrescu, Cristian

31/03/2017 16:17, Dumitrescu, Cristian:
> > -----Original Message-----
> > From: Andriy Berestovskyy
> > [mailto:Andriy.Berestovskyy@caviumnetworks.com]
> > Sent: Friday, March 31, 2017 2:37 PM
> > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [PATCH 1/5] examples/ip_pipeline: add support for more than 32
> > CPUs
> > 
> > At the moment ip_pipeline example uses 32 during the initialization,
> > which leads to an error on systems with more than 32 CPUs.
> > 
> > Signed-off-by: Andriy Berestovskyy
> > <Andriy.Berestovskyy@caviumnetworks.com>
> > ---
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Series applied, thanks

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

end of thread, other threads:[~2017-04-21  0:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
2017-03-31 13:36 ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Andriy Berestovskyy
2017-03-31 14:17   ` Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 5/5] port: minor typo Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 14:17 ` [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Dumitrescu, Cristian
2017-04-21  0:16   ` 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).