On 6/19/2019 5:20 PM, Ziyang Xuan wrote: > This patch add package sending and receiving function codes. > > Signed-off-by: Ziyang Xuan <xuanziya...@huawei.com>
<...> > @@ -543,6 +728,113 @@ void hinic_free_all_rx_skbs(struct hinic_rxq *rxq) > } > } > > +static inline void hinic_rq_cqe_be_to_cpu32(void *dst_le32, > + volatile void *src_be32) > +{ > +#ifndef __ARM64_NEON__ > + volatile __m128i *wqe_be = (volatile __m128i *)src_be32; > + __m128i *wqe_le = (__m128i *)dst_le32; > + __m128i shuf_mask = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, > + 11, 4, 5, 6, 7, 0, 1, 2, 3); > + > + /* l2nic just use first 128 bits */ > + wqe_le[0] = _mm_shuffle_epi8(wqe_be[0], shuf_mask); > +#else > + volatile uint8x16_t *wqe_be = (volatile uint8x16_t *)src_be32; > + uint8x16_t *wqe_le = (uint8x16_t *)dst_le32; > + const uint8x16_t shuf_mask = {3, 2, 1, 0, 7, 6, 5, 4, 11, 10, > + 9, 8, 15, 14, 13, 12}; > + > + /* l2nic just use first 128 bits */ > + wqe_le[0] = vqtbl1q_u8(wqe_be[0], shuf_mask); > +#endif > +} I am aware documentation says only arm64 and x86_64 are supported and default config files default values implemented that way, still I believe it is safer to not just assume it is either one or other. What do you think explicitly check X86_64 too, as done for ARM64?