Skip to contentSkip to conversation

net/virtio: fix 32-bit build with clang 6.0.0

PATCH Applied Marvin Liu 2 participants 3 messages May 6, 2020 – May 7, 2020 Network drivers

lore
Share & tools
lore

Marvin Liu

author
#0 lore raw

PATCH 1/1 net/virtio: fix 32-bit build with clang 6.0.0

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")
drivers/net/virtio/virtio_rxtx_packed_avx.c +10 -0
index d130d68bf..6a8214725 100644
@@ -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);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Marvin Liu

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.

Quoted 8 lines

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")

Thanks,
Maxime

#2 lore raw
In reply to Marvin Liu
Quoted 11 lines · Marvin Liu

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")

Applied to dpdk-next-virtio/master

Thanks,
Maxime