[dpdk-dev,1/2] 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 of _mm_prefetch should be "const char *" and
need convert "struct rte_mbuf *" to "const void *".
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
examples/distributor/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
Hi Michael,
Thank you very much for working on compilation issues.
Please could you try to insert a "Fixes:" line in your logs?
2015-11-26 09:35, Michael Qiu:
> 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 of _mm_prefetch should be "const char *" and
> need convert "struct rte_mbuf *" to "const void *".
[...]
> - _mm_prefetch(bufs[0], 0);
> - _mm_prefetch(bufs[1], 0);
> - _mm_prefetch(bufs[2], 0);
> + _mm_prefetch((const void *)bufs[0], 0);
> + _mm_prefetch((const void *)bufs[1], 0);
> + _mm_prefetch((const void *)bufs[2], 0);
With clang:
error: cast from 'const void *' to 'void *' drops const qualifier
@@ -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((const void *)bufs[0], 0);
+ _mm_prefetch((const void *)bufs[1], 0);
+ _mm_prefetch((const 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((const void *)bufs[i + 3], 0);
/*
* workers should update in_port to hold the
* output port value