[dpdk-dev,1/2,v2] examples/distributor: Fix compile issue
Commit Message
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
> -----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>
> > 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
@@ -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