From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6F7A95939 for ; Fri, 23 Sep 2016 08:11:28 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP; 22 Sep 2016 23:11:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,380,1470726000"; d="scan'208";a="12356131" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 22 Sep 2016 23:11:27 -0700 Date: Fri, 23 Sep 2016 14:11:55 +0800 From: Yuanhan Liu To: dev@dpdk.org Cc: Jerin Jacob Message-ID: <20160923061155.GS23158@yliu-dev.sh.intel.com> References: <1471938058-12385-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471938058-12385-1-git-send-email-yuanhan.liu@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix build error with clang X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 06:11:28 -0000 On Tue, Aug 23, 2016 at 03:40:58PM +0800, Yuanhan Liu wrote: > 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. Unfortunately, it makes the icc build fail. I will submit another patch to simply change _mm_prefetch to rte_prefetch0. --yliu > > Fixes: fc3d66212fed ("virtio: add vector Rx") > > Cc: Jerin Jacob > Signed-off-by: Yuanhan Liu > --- > 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..56195e5 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); > + _mm_prefetch(rused, _MM_HINT_T0); > > if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { > virtio_rxq_rearm_vec(rxvq); > -- > 1.9.0