[dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Feb 29 05:27:21 CET 2016


On Fri, Feb 26, 2016 at 02:21:02PM +0530, Santosh Shukla wrote:
> Check cpuflag macro before using vectored api.
> -virtio_recv_pkts_vec() uses _sse3__ simd instruction for now so added cpuflag.
> - Also wrap other vectored freind api ie..
> 1) virtqueue_enqueue_recv_refill_simple
> 2) virtio_rxq_vec_setup
> 
...
> diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
> index 3a1de9d..be51d7c 100644
> --- a/drivers/net/virtio/virtio_rxtx_simple.c
> +++ b/drivers/net/virtio/virtio_rxtx_simple.c

Hmm, why not wrapping the whole file, instead of just few functions?

Or maybe better, do a compile time check at the Makefile, something
like:

    if has_CPUFLAG_xxx
        SRCS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio_rxtx_simple.c
    endif


	--yliu


More information about the dev mailing list