From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id D23A895FD for ; Tue, 1 Mar 2016 07:10:41 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id bj10so36929664pad.2 for ; Mon, 29 Feb 2016 22:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=wSLw6SeeVIZYFT57gNE8Gxf33QZBE0fyg+vn0MpSTqk=; b=L28lUo2RVtqJ4j85PKEzRrDhzwYBdfmkBTaXFtZw9U0qichKYMXCQAemxML5QWhKk0 nC/JePqyLAChnFJS1YINGQuVc625DTA8Xh1B+BDOY0p2wAQA5qAB69A1P1FsRW12Zv2w 0Re+spYBoaTof+gZEpK6JNN8D/c7EsDgqfGfUWwd4/uLi/wm742m3/TCgHzPydlSqARL e59xPjVA058JlNCQJmG3MlZweKJ3X4p6/Zk0kKtRvLGsYTVaNxhIVPjr7VeRJr5EzXUZ Qfh17vl7azmXrRudtoODXTQCSXcR7AviP0h6q4yMUfYPFeMLp1k1P2mRKilbpA2qiZeA mrPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=wSLw6SeeVIZYFT57gNE8Gxf33QZBE0fyg+vn0MpSTqk=; b=eeGNBujyW0PLKCiNpYB2VU51S8vHwBkthRitFTTWLHgUShUkywkpr2H8pGNZbiM211 QrJcncTkgkB5yzR7luy7zRT0LX8FEp7t5n10KCZk4XILNkF5C3krnjgbdWsuVOTdM0iT qblzmgseeWkkKXNo3ErHli0VnvOZOEXxPY2X7KjyTXxrvAkLSyx93nQuMaIC8y8xtO1y nAVR8zIrWss3PwAwQ9dlzIOupxH+KXkfD1k6LYwEETBUZKRlJsYeevnWRTnWgKErHIsM I7dKCuOiwjF8Hc0K0JLt74GRozUaRSMu++KjbV+v/+49gDR8uJwfsJQOcwGcvWu8LpnI YWmw== X-Gm-Message-State: AD7BkJKkC93J+wfYdFU0ETDhbwUhFciypUdnzZyDZVCwHtWKKScQRpFwp8qbsPetyUQAnbXPD2Th1nP5Ao91XNNV MIME-Version: 1.0 X-Received: by 10.66.237.39 with SMTP id uz7mr15944707pac.141.1456812641263; Mon, 29 Feb 2016 22:10:41 -0800 (PST) Received: by 10.66.176.200 with HTTP; Mon, 29 Feb 2016 22:10:41 -0800 (PST) In-Reply-To: <20160301055508.GL14300@yliu-dev.sh.intel.com> References: <1456476662-23081-1-git-send-email-sshukla@mvista.com> <20160229042721.GJ14300@yliu-dev.sh.intel.com> <20160301055508.GL14300@yliu-dev.sh.intel.com> Date: Tue, 1 Mar 2016 11:40:41 +0530 Message-ID: From: Santosh Shukla To: Yuanhan Liu Content-Type: text/plain; charset=UTF-8 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 06:10:42 -0000 On Tue, Mar 1, 2016 at 11:25 AM, Yuanhan Liu wrote: > 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. > You misunderstood my comment, my arch specific meaning driver/net/virtio/virtio_vec_.h > 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. > Ok., > --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'