From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id BF9139AB5 for ; Tue, 1 Mar 2016 10:11:32 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 01 Mar 2016 01:11:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,522,1449561600"; d="scan'208";a="755847951" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2016 01:11:05 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 1 Mar 2016 01:11:03 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 1 Mar 2016 01:11:03 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by shsmsx102.ccr.corp.intel.com ([169.254.2.232]) with mapi id 14.03.0248.002; Tue, 1 Mar 2016 17:11:01 +0800 From: "Qiu, Michael" To: Santosh Shukla , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api Thread-Index: AQHRcHMbS07T/1MCB0imsZVttktoXg== Date: Tue, 1 Mar 2016 09:11:01 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F5A41C@SHSMSX101.ccr.corp.intel.com> References: <1456476662-23081-1-git-send-email-sshukla@mvista.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 09:11:33 -0000 On 2/26/2016 4:53 PM, Santosh Shukla wrote:=0A= > Check cpuflag macro before using vectored api.=0A= > -virtio_recv_pkts_vec() uses _sse3__ simd instruction for now so added cp= uflag.=0A= > - Also wrap other vectored freind api ie..=0A= > 1) virtqueue_enqueue_recv_refill_simple=0A= > 2) virtio_rxq_vec_setup=0A= >=0A= > todo:=0A= > 1) Move virtio_recv_pkts_vec() implementation to=0A= > drivers/virtio/virtio_vec_.h file.=0A= > 2) Remove use_simple_rxtx flag, so that virtio/virtio_vec_.h=0A= > files to provide vectored/non-vectored rx/tx apis.=0A= >=0A= > Signed-off-by: Santosh Shukla =0A= > ---=0A= > - v1: This is a rework of patch [1].=0A= > Note: This patch will let non-x86 arch to use virtio pmd.=0A= >=0A= > [1] http://dpdk.org/dev/patchwork/patch/10429/=0A= >=0A= > drivers/net/virtio/virtio_rxtx.c | 16 +++++++++++++++-=0A= > drivers/net/virtio/virtio_rxtx.h | 2 ++=0A= > drivers/net/virtio/virtio_rxtx_simple.c | 11 ++++++++++-=0A= > 3 files changed, 27 insertions(+), 2 deletions(-)=0A= >=0A= > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio= _rxtx.c=0A= > index 41a1366..ec0b8de 100644=0A= > --- a/drivers/net/virtio/virtio_rxtx.c=0A= > +++ b/drivers/net/virtio/virtio_rxtx.c=0A= > @@ -67,7 +67,9 @@=0A= > #define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \=0A= > ETH_TXQ_FLAGS_NOOFFLOADS)=0A= > =0A= > +#ifdef RTE_MACHINE_CPUFLAG_SSSE3=0A= > static int use_simple_rxtx;=0A= > +#endif=0A= > =0A= >=0A= =0A= I don't think so much #ifdef ... #endif in *.c file is a good choice.=0A= Would you consider let it only in header file like:=0A= =0A= in drivers/net/virtio/virtio_rxtx.h=0A= =0A= [...]=0A= =0A= #ifdef RTE_MACHINE_CPUFLAG_SSSE3=0A= int virtio_rxq_vec_setup(struct virtqueue *rxq);=0A= =0A= int virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,=0A= struct rte_mbuf *m);=0A= #else=0A= int virtio_rxq_vec_setup(__rte_unused struct virtqueue *rxq) {return -1;}= =0A= int virtqueue_enqueue_recv_refill_simple(__rte_unused struct virtqueue *vq,= =0A= __rte_unused struct rte_mbuf *m) {=0A= return -1;=0A= }=0A= #endif=0A= =0A= and remove most #ifdef ... #endif in *.c file.=0A= =0A= Thanks,=0A= Michael=0A=