DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Misc fixes
@ 2015-02-20 12:10 Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 1/3] doc: add librte_reorder to doxygen conf Sergio Gonzalez Monroy
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-02-20 12:10 UTC (permalink / raw)
  To: dev

This series fixes a few small issues in different files:
 - doxygen syntax of a couple of comments in struct mbuf
 - add missing reorder library directory to doxygen config
 - rte_reorder_create was not being checked for possible errors, so
   add proper error checking and move it before launching threads.

Sergio Gonzalez Monroy (3):
  doc: add librte_reorder to doxygen conf
  mbuf: fix a couple of doxygen comments
  examples/packet_ordering: move creation of reorder buffer

 doc/api/doxy-api.conf           |  1 +
 examples/packet_ordering/main.c | 37 +++++++++++++++++++++++++------------
 lib/librte_mbuf/rte_mbuf.h      |  4 ++--
 3 files changed, 28 insertions(+), 14 deletions(-)

-- 
1.9.3

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

* [dpdk-dev] [PATCH 1/3] doc: add librte_reorder to doxygen conf
  2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
@ 2015-02-20 12:10 ` Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 2/3] mbuf: fix a couple of doxygen comments Sergio Gonzalez Monroy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-02-20 12:10 UTC (permalink / raw)
  To: dev

Add missing reorder lirbary directory to doxygen configuration.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 doc/api/doxy-api.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf
index 27c782c..86298b7 100644
--- a/doc/api/doxy-api.conf
+++ b/doc/api/doxy-api.conf
@@ -34,6 +34,7 @@ INPUT                   = doc/api/doxy-api-index.md \
                           lib/librte_eal/common/include/generic \
                           lib/librte_acl \
                           lib/librte_distributor \
+                          lib/librte_reorder \
                           lib/librte_ether \
                           lib/librte_hash \
                           lib/librte_ip_frag \
-- 
1.9.3

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

* [dpdk-dev] [PATCH 2/3] mbuf: fix a couple of doxygen comments
  2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 1/3] doc: add librte_reorder to doxygen conf Sergio Gonzalez Monroy
@ 2015-02-20 12:10 ` Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 3/3] examples/packet_ordering: move creation of reorder buffer Sergio Gonzalez Monroy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-02-20 12:10 UTC (permalink / raw)
  To: dev

Fix a couple of doxygen comments in mbuf structure:
 - seqn had no doxygen syntax.
 - usr was not generating proper link to function.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 lib/librte_mbuf/rte_mbuf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index ace6736..32e957b 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -286,11 +286,11 @@ struct rte_mbuf {
 			     PKT_RX_FDIR_* flag in ol_flags. */
 		} fdir;           /**< Filter identifier if FDIR enabled */
 		uint32_t sched;   /**< Hierarchical scheduler */
-		uint32_t usr;	  /**< User defined tags. See @rte_distributor_process */
+		uint32_t usr;	  /**< User defined tags. See rte_distributor_process() */
 	} hash;                   /**< hash information */
 
-	/* sequence number - field used in distributor and reorder library */
 	uint32_t seqn;
+	/**< Sequence number. See also rte_reorder_insert() */
 
 	/* second cache line - fields only used in slow path or on TX */
 	MARKER cacheline1 __rte_cache_aligned;
-- 
1.9.3

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

* [dpdk-dev] [PATCH 3/3] examples/packet_ordering: move creation of reorder buffer
  2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 1/3] doc: add librte_reorder to doxygen conf Sergio Gonzalez Monroy
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 2/3] mbuf: fix a couple of doxygen comments Sergio Gonzalez Monroy
@ 2015-02-20 12:10 ` Sergio Gonzalez Monroy
  2015-02-24  2:04 ` [dpdk-dev] [PATCH 0/3] Misc fixes Thomas Monjalon
  2015-02-24  8:46 ` Olivier MATZ
  4 siblings, 0 replies; 6+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-02-20 12:10 UTC (permalink / raw)
  To: dev

There was no error checking after calling rte_reorder_create.
Move the creation of the reorder buffer before launching threads
in case of memory error.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 examples/packet_ordering/main.c | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 75e2f46..3d7daaa 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -82,6 +82,11 @@ struct worker_thread_args {
 	struct rte_ring *ring_out;
 };
 
+struct send_thread_args {
+	struct rte_ring *ring_in;
+	struct rte_reorder_buffer *buffer;
+};
+
 struct output_buffer {
 	unsigned count;
 	struct rte_mbuf *mbufs[MAX_PKTS_BURST];
@@ -455,7 +460,7 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp)
  * transmitting.
  */
 static int
-send_thread(struct rte_ring *ring_in)
+send_thread(struct send_thread_args *args)
 {
 	int ret;
 	unsigned int i, dret;
@@ -464,15 +469,13 @@ send_thread(struct rte_ring *ring_in)
 	static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS];
 	struct rte_mbuf *mbufs[MAX_PKTS_BURST];
 	struct rte_mbuf *rombufs[MAX_PKTS_BURST] = {NULL};
-	struct rte_reorder_buffer *buffer;
 
-	RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__,
-							rte_lcore_id());
-	buffer = rte_reorder_create("PKT_RO", rte_socket_id(), REORDER_BUFFER_SIZE);
+	RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, rte_lcore_id());
+
 	while (!quit_signal) {
 
 		/* deque the mbufs from workers_to_tx ring */
-		nb_dq_mbufs = rte_ring_dequeue_burst(ring_in,
+		nb_dq_mbufs = rte_ring_dequeue_burst(args->ring_in,
 				(void *)mbufs, MAX_PKTS_BURST);
 
 		if (unlikely(nb_dq_mbufs == 0))
@@ -482,7 +485,7 @@ send_thread(struct rte_ring *ring_in)
 
 		for (i = 0; i < nb_dq_mbufs; i++) {
 			/* send dequeued mbufs for reordering */
-			ret = rte_reorder_insert(buffer, mbufs[i]);
+			ret = rte_reorder_insert(args->buffer, mbufs[i]);
 
 			if (ret == -1 && rte_errno == ERANGE) {
 				/* Too early pkts should be transmitted out directly */
@@ -510,7 +513,7 @@ send_thread(struct rte_ring *ring_in)
 		 * drain MAX_PKTS_BURST of reordered
 		 * mbufs for transmit
 		 */
-		dret = rte_reorder_drain(buffer, rombufs, MAX_PKTS_BURST);
+		dret = rte_reorder_drain(args->buffer, rombufs, MAX_PKTS_BURST);
 		for (i = 0; i < dret; i++) {
 
 			struct output_buffer *outbuf;
@@ -584,6 +587,7 @@ main(int argc, char **argv)
 	uint8_t port_id;
 	uint8_t nb_ports_available;
 	struct worker_thread_args worker_args = {NULL, NULL};
+	struct send_thread_args send_args = {NULL, NULL};
 	struct rte_ring *rx_to_workers;
 	struct rte_ring *workers_to_tx;
 
@@ -661,6 +665,13 @@ main(int argc, char **argv)
 	if (workers_to_tx == NULL)
 		rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
 
+	if (!disable_reorder) {
+		send_args.buffer = rte_reorder_create("PKT_RO", rte_socket_id(),
+				REORDER_BUFFER_SIZE);
+		if (send_args.buffer == NULL)
+			rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
+	}
+
 	last_lcore_id   = get_last_lcore_id();
 	master_lcore_id = rte_get_master_lcore();
 
@@ -673,14 +684,16 @@ main(int argc, char **argv)
 			rte_eal_remote_launch(worker_thread, (void *)&worker_args,
 					lcore_id);
 
-	if (disable_reorder)
+	if (disable_reorder) {
 		/* Start tx_thread() on the last slave core */
 		rte_eal_remote_launch((lcore_function_t *)tx_thread, workers_to_tx,
 				last_lcore_id);
-	else
+	} else {
+		send_args.ring_in = workers_to_tx;
 		/* Start send_thread() on the last slave core */
-		rte_eal_remote_launch((lcore_function_t *)send_thread, workers_to_tx,
-				last_lcore_id);
+		rte_eal_remote_launch((lcore_function_t *)send_thread,
+				(void *)&send_args,	last_lcore_id);
+	}
 
 	/* Start rx_thread() on the master core */
 	rx_thread(rx_to_workers);
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH 0/3] Misc fixes
  2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
                   ` (2 preceding siblings ...)
  2015-02-20 12:10 ` [dpdk-dev] [PATCH 3/3] examples/packet_ordering: move creation of reorder buffer Sergio Gonzalez Monroy
@ 2015-02-24  2:04 ` Thomas Monjalon
  2015-02-24  8:46 ` Olivier MATZ
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-02-24  2:04 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev

2015-02-20 12:10, Sergio Gonzalez Monroy:
> This series fixes a few small issues in different files:
>  - doxygen syntax of a couple of comments in struct mbuf
>  - add missing reorder library directory to doxygen config
>  - rte_reorder_create was not being checked for possible errors, so
>    add proper error checking and move it before launching threads.
> 
> Sergio Gonzalez Monroy (3):
>   doc: add librte_reorder to doxygen conf
>   mbuf: fix a couple of doxygen comments
>   examples/packet_ordering: move creation of reorder buffer

Applied, thanks

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

* Re: [dpdk-dev] [PATCH 0/3] Misc fixes
  2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
                   ` (3 preceding siblings ...)
  2015-02-24  2:04 ` [dpdk-dev] [PATCH 0/3] Misc fixes Thomas Monjalon
@ 2015-02-24  8:46 ` Olivier MATZ
  4 siblings, 0 replies; 6+ messages in thread
From: Olivier MATZ @ 2015-02-24  8:46 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy, dev

On 02/20/2015 01:10 PM, Sergio Gonzalez Monroy wrote:
> This series fixes a few small issues in different files:
>   - doxygen syntax of a couple of comments in struct mbuf
>   - add missing reorder library directory to doxygen config
>   - rte_reorder_create was not being checked for possible errors, so
>     add proper error checking and move it before launching threads.
>
> Sergio Gonzalez Monroy (3):
>    doc: add librte_reorder to doxygen conf
>    mbuf: fix a couple of doxygen comments
>    examples/packet_ordering: move creation of reorder buffer
>
>   doc/api/doxy-api.conf           |  1 +
>   examples/packet_ordering/main.c | 37 +++++++++++++++++++++++++------------
>   lib/librte_mbuf/rte_mbuf.h      |  4 ++--
>   3 files changed, 28 insertions(+), 14 deletions(-)
>

Series:
Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

end of thread, other threads:[~2015-02-24  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 12:10 [dpdk-dev] [PATCH 0/3] Misc fixes Sergio Gonzalez Monroy
2015-02-20 12:10 ` [dpdk-dev] [PATCH 1/3] doc: add librte_reorder to doxygen conf Sergio Gonzalez Monroy
2015-02-20 12:10 ` [dpdk-dev] [PATCH 2/3] mbuf: fix a couple of doxygen comments Sergio Gonzalez Monroy
2015-02-20 12:10 ` [dpdk-dev] [PATCH 3/3] examples/packet_ordering: move creation of reorder buffer Sergio Gonzalez Monroy
2015-02-24  2:04 ` [dpdk-dev] [PATCH 0/3] Misc fixes Thomas Monjalon
2015-02-24  8:46 ` Olivier MATZ

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).