From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 36DCC11C5 for ; Tue, 1 Mar 2016 06:54:25 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 29 Feb 2016 21:54:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,522,1449561600"; d="scan'208";a="924010423" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga002.jf.intel.com with ESMTP; 29 Feb 2016 21:54:02 -0800 Date: Tue, 1 Mar 2016 13:55:08 +0800 From: Yuanhan Liu To: Santosh Shukla Message-ID: <20160301055508.GL14300@yliu-dev.sh.intel.com> References: <1456476662-23081-1-git-send-email-sshukla@mvista.com> <20160229042721.GJ14300@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dpdk Subject: Re: [dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2016 05:54:25 -0000 On Mon, Feb 29, 2016 at 06:01:38PM +0530, Santosh Shukla wrote: > On Mon, Feb 29, 2016 at 9:57 AM, Yuanhan Liu > wrote: > > 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? > > > > Better to refactor code and make arch specific. Current implementation > is temporary. I'm okay to refactor, if it's a clean one. But moving virtio __driver__ stuff to EAL, sorry, it still doesn't make too much sense to me. For this case, let's make it simple so far, and consider it when we have another vec implementation, or better refactor comes out. > > 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 > > > Tried this approach but end up with link error, If I try to fix below > link error then I will be ending up writing similar code, Sure you need the first part of your patch. Yes, it's similar code, but it has fewer "#ifdef " conditions, and more importantly, it leaves virtio_rxtx_simple.c alone. --yliu > linker error snap: > > /work/santosh/thunder/nfs/dpdk/arm64-thunderx-linuxapp-gcc/lib/librte_pmd_virtio.a(virtio_rxtx.o): > In function `virtio_dev_rxtx_start': > virtio_rxtx.c:(.text+0x168c): undefined reference to > `virtqueue_enqueue_recv_refill_simple' > /work/santosh/thunder/nfs/dpdk/arm64-thunderx-linuxapp-gcc/lib/librte_pmd_virtio.a(virtio_rxtx.o): > In function `virtio_dev_rx_queue_setup': > virtio_rxtx.c:(.text+0x2364): undefined reference to `virtio_rxq_vec_setup' > /work/santosh/thunder/nfs/dpdk/arm64-thunderx-linuxapp-gcc/lib/librte_pmd_virtio.a(virtio_rxtx.o): > In function `virtio_dev_tx_queue_setup': > virtio_rxtx.c:(.text+0x2460): undefined reference to `virtio_xmit_pkts_simple' > virtio_rxtx.c:(.text+0x2464): undefined reference to `virtio_recv_pkts_vec' > virtio_rxtx.c:(.text+0x2468): undefined reference to `virtio_xmit_pkts_simple' > virtio_rxtx.c:(.text+0x246c): undefined reference to `virtio_recv_pkts_vec'