> 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?

Hi Ferruh,

As you said, we just support arm64 and x86_64. First we determine arm64 using 
"CONFIG_RTE_ARCH_ARM64" to define "__ARM64_NEON__" micro in Makefile.
If it has not defined "__ARM64_NEON__", it must be X86_64. This is our present 
situation.


I think we can use the same method to determine "X86_64" using 
"CONFIG_RTE_ARCH_X86_64".
If it is neither "ARM64" nor "X86_64", we can use "rte_be_to_cpu_32" and 
"rte_cpu_to_be_32".
How do you think about this?

Looking forward to your comments.

Thank you!

Best Regards,
Ziyang Xuan
  • ... Ziyang Xuan
  • ... Ziyang Xuan
    • ... Ferruh Yigit
  • ... Ziyang Xuan
    • ... Ferruh Yigit
  • ... Ziyang Xuan
  • ... Ziyang Xuan
  • ... Ziyang Xuan
  • ... Ziyang Xuan
    • ... Ferruh Yigit
      • ... Xuanziyang (William, Chip Application Design Logic and Hardware Development Dept IT_Products & Solutions)
        • ... Ferruh Yigit
  • ... Ferruh Yigit
  • ... Xuanziyang (William, Chip Application Design Logic and Hardware Development Dept IT_Products & Solutions)
    • ... Ferruh Yigit

Reply via email to