DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Santosh Shukla <sshukla@mvista.com>
Cc: dpdk <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api
Date: Tue, 1 Mar 2016 13:55:08 +0800	[thread overview]
Message-ID: <20160301055508.GL14300@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <CAAyOgsZcug46hyS331W81Hj7gHxMU2xwCqhYWzgYY99cPYc=0Q@mail.gmail.com>

On Mon, Feb 29, 2016 at 06:01:38PM +0530, Santosh Shukla wrote:
> On Mon, Feb 29, 2016 at 9:57 AM, Yuanhan Liu
> <yuanhan.liu@linux.intel.com> 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'

  reply	other threads:[~2016-03-01  5:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  8:51 Santosh Shukla
2016-02-29  4:27 ` Yuanhan Liu
2016-02-29  5:33   ` Xie, Huawei
2016-02-29 12:31   ` Santosh Shukla
2016-03-01  5:55     ` Yuanhan Liu [this message]
2016-03-01  6:10       ` Santosh Shukla
2016-03-01  6:22         ` Yuanhan Liu
2016-02-29 12:58 ` [dpdk-dev] [PATCH v2] " Santosh Shukla
2016-03-01  5:59   ` Yuanhan Liu
2016-03-01  6:08     ` Santosh Shukla
2016-03-01  6:32       ` Yuanhan Liu
2016-03-01 10:07         ` Santosh Shukla
2016-03-01 10:02   ` [dpdk-dev] [PATCH v1 0/3] virtio vector and misc Santosh Shukla
2016-03-01 10:02     ` [dpdk-dev] [PATCH v1 1/3] virtio: use vector rx/tx for ssse cpuflag only Santosh Shukla
2016-03-01 10:02     ` [dpdk-dev] [PATCH v1 2/3] config: enable virtio for armv7/v8 Santosh Shukla
2016-03-01 10:02     ` [dpdk-dev] [PATCH v1 3/3] guide/release: add virtio for arm feature info Santosh Shukla
2016-03-02  8:32     ` [dpdk-dev] [PATCH v1 0/3] virtio vector and misc Yuanhan Liu
2016-03-02  8:41       ` Santosh Shukla
2016-03-03 13:26         ` Thomas Monjalon
2016-03-03 13:50           ` Santosh Shukla
2016-03-01  9:11 ` [dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api Qiu, Michael
2016-03-01  9:45   ` Santosh Shukla
2016-03-02  2:10     ` Qiu, Michael
2016-03-02  2:49       ` Yuanhan Liu
2016-03-04  6:36         ` Qiu, Michael

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160301055508.GL14300@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=sshukla@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).