From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3968CA0350; Wed, 6 May 2020 08:47:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 903E31D700; Wed, 6 May 2020 08:47:42 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3E7E11D6FF for ; Wed, 6 May 2020 08:47:41 +0200 (CEST) IronPort-SDR: fxxlji06XXiC8U6n09fye9dD8MEn6Basssb5fAoTU7fx00aLHOiO64kGi3+/ZF4VdkGEIeeRbO nZLHxjLLii0g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 23:47:40 -0700 IronPort-SDR: 3YBgR6fsrrkxHzIbI3uc/MSvM0Xm4crBkYQWDlsoALNK8ewefektyZ2mKeNnhy0ldosGaYjWDY 7fv2vGZP+O9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,358,1583222400"; d="scan'208";a="407129500" Received: from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.56]) by orsmga004.jf.intel.com with ESMTP; 05 May 2020 23:47:38 -0700 From: Marvin Liu To: maxime.coquelin@redhat.com, xiaolong.ye@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org, Marvin Liu Date: Wed, 6 May 2020 14:47:37 +0800 Message-Id: <20200506064737.80627-1-yong.liu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/virtio: fix 32-bit build with clang 6.0.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Clang 6.0.0 will undefine function _mm512_maskz_set1_epi64 on i686 target. Fix it by replacing the function with _mm512_set4_epi64 when doing 32-bit build. Warning messasge during build: ../drivers/net/virtio/virtio_rxtx_packed_avx.c:385:19: warning: implicit declaration of function '_mm512_maskz_set1_epi64' is invalid in C99 [-Wimplicit-function-declaration] Fixes: 8d35836e4a7c ("net/virtio: add vectorized packed ring Rx path") Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_rxtx_packed_avx.c b/drivers/net/virtio/virtio_rxtx_packed_avx.c index d130d68bf..6a8214725 100644 --- a/drivers/net/virtio/virtio_rxtx_packed_avx.c +++ b/drivers/net/virtio/virtio_rxtx_packed_avx.c @@ -365,7 +365,12 @@ virtqueue_dequeue_batch_packed_vec(struct virtnet_rx *rxvq, return -1; /* only care avail/used bits */ +#if defined(RTE_ARCH_I686) + __m512i v_mask = _mm512_set4_epi64(PACKED_FLAGS_MASK, 0x0, + PACKED_FLAGS_MASK, 0x0); +#else __m512i v_mask = _mm512_maskz_set1_epi64(0xaa, PACKED_FLAGS_MASK); +#endif desc_addr = &vq->vq_packed.ring.desc[id]; __m512i v_desc = _mm512_loadu_si512(desc_addr); @@ -373,7 +378,12 @@ virtqueue_dequeue_batch_packed_vec(struct virtnet_rx *rxvq, __m512i v_used_flag = _mm512_setzero_si512(); if (vq->vq_packed.used_wrap_counter) +#if defined(RTE_ARCH_I686) + v_used_flag = _mm512_set4_epi64(PACKED_FLAGS_MASK, 0x0, + PACKED_FLAGS_MASK, 0x0); +#else v_used_flag = _mm512_maskz_set1_epi64(0xaa, PACKED_FLAGS_MASK); +#endif /* Check all descs are used */ desc_stats = _mm512_cmpneq_epu64_mask(v_flag, v_used_flag); -- 2.17.1