[dpdk-dev,1/2,v2] examples/distributor: Fix compile issue

Message ID 1448595365-12699-1-git-send-email-michael.qiu@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Michael Qiu Nov. 27, 2015, 3:36 a.m. UTC
  examples/distributor/main.c(338): error #167:
argument of type "struct rte_mbuf *"
is incompatible with parameter of type "const char *"
  			_mm_prefetch(bufs[0], 0);

The first param pass to _mm_prefetch is wrong,
need convert "struct rte_mbuf *" to "void *".

Fixes: 07db4a975094 ("examples/distributor: new sample app")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
v2 --> v1:
	convert "const void *" to "void *" to avoid CLANG issue.
	add "Fixes" line in commit log
 examples/distributor/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

De Lara Guarch, Pablo Nov. 27, 2015, 12:21 p.m. UTC | #1
> -----Original Message-----
> From: Qiu, Michael
> Sent: Friday, November 27, 2015 3:36 AM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo; thomas.monjalon@6wind.com; Qiu, Michael
> Subject: [PATCH 1/2 v2] examples/distributor: Fix compile issue
> 
> examples/distributor/main.c(338): error #167:
> argument of type "struct rte_mbuf *"
> is incompatible with parameter of type "const char *"
>   			_mm_prefetch(bufs[0], 0);
> 
> The first param pass to _mm_prefetch is wrong,
> need convert "struct rte_mbuf *" to "void *".
> 
> Fixes: 07db4a975094 ("examples/distributor: new sample app")
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon Nov. 27, 2015, 8:49 p.m. UTC | #2
> > examples/distributor/main.c(338): error #167:
> > argument of type "struct rte_mbuf *"
> > is incompatible with parameter of type "const char *"
> >   			_mm_prefetch(bufs[0], 0);
> > 
> > The first param pass to _mm_prefetch is wrong,
> > need convert "struct rte_mbuf *" to "void *".
> > 
> > Fixes: 07db4a975094 ("examples/distributor: new sample app")
> > 
> > Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

As described by Pablo, it is seen with ICC 2015.

Series applied, thanks
  

Patch

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 972bddb..a4d8e34 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -335,13 +335,13 @@  lcore_tx(struct rte_ring *in_r)
 
 			/* for traffic we receive, queue it up for transmit */
 			uint16_t i;
-			_mm_prefetch(bufs[0], 0);
-			_mm_prefetch(bufs[1], 0);
-			_mm_prefetch(bufs[2], 0);
+			_mm_prefetch((void *)bufs[0], 0);
+			_mm_prefetch((void *)bufs[1], 0);
+			_mm_prefetch((void *)bufs[2], 0);
 			for (i = 0; i < nb_rx; i++) {
 				struct output_buffer *outbuf;
 				uint8_t outp;
-				_mm_prefetch(bufs[i + 3], 0);
+				_mm_prefetch((void *)bufs[i + 3], 0);
 				/*
 				 * workers should update in_port to hold the
 				 * output port value