From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v2] net/virtio: fix build error with clang Date: Fri, 23 Sep 2016 12:05:14 +0530 Message-ID: <20160923063513.GA4321@localhost.localdomain> References: <1471938058-12385-1-git-send-email-yuanhan.liu@linux.intel.com> <1474611309-20325-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: To: Yuanhan Liu Return-path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0084.outbound.protection.outlook.com [104.47.37.84]) by dpdk.org (Postfix) with ESMTP id B4BA958C3 for ; Fri, 23 Sep 2016 08:35:36 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1474611309-20325-1-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Sep 23, 2016 at 02:15:09PM +0800, Yuanhan Liu wrote: Hi Yuanhan, Thanks for this patch. > Interestingly, clang and gcc has different prototype for _mm_prefetch(). > For gcc, we have > > _mm_prefetch (const void *__P, enum _mm_hint __I) > > While for clang, it's > > #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel))) > > That how the following error comes with clang: > > error: cast from 'const void *' to 'void *' drops const qualifier > [-Werror,-Wcast-qual] > _mm_prefetch((const void *)rused, _MM_HINT_T0); > /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58: > note: expanded from macro '_mm_prefetch' > #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), > 0, (sel))) > > What's weird is that the build was actaully Okay before. I met it while > apply Jerin's vector support for ARM patch set: he just move this peiece > of code to another file, nothing else changed. > > This patch fix the issue when Jerin's patchset is applied. Thus, I think > it's still needed. The info notes can be moved under the "---" marker line to make git log clean. This patch review is holding the virtio arm NEON support. Appreciate any help in reviewing this patch. http://dpdk.org/dev/patchwork/patch/14567/ > > Fixes: fc3d66212fed ("virtio: add vector Rx") > > Cc: Jerin Jacob > Signed-off-by: Yuanhan Liu > --- > v2: replace _mm_prefetch with rte_prefetch0 to make icc happy > --- > drivers/net/virtio/virtio_rxtx_simple.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c > index 6517aa8..d8dd17c 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple.c > +++ b/drivers/net/virtio/virtio_rxtx_simple.c > @@ -200,7 +200,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > sw_ring = &vq->sw_ring[desc_idx]; > sw_ring_end = &vq->sw_ring[vq->vq_nentries]; > > - _mm_prefetch((const void *)rused, _MM_HINT_T0); > + rte_prefetch0(rused); > > if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { > virtio_rxq_rearm_vec(rxvq); > -- > 1.9.0 >