From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 69214AD8C for ; Wed, 2 Mar 2016 03:10:39 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 01 Mar 2016 18:10:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,524,1449561600"; d="scan'208";a="927550709" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 01 Mar 2016 18:10:38 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 1 Mar 2016 18:10:38 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 1 Mar 2016 18:10:38 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.42]) with mapi id 14.03.0248.002; Wed, 2 Mar 2016 10:10:15 +0800 From: "Qiu, Michael" To: Santosh Shukla Thread-Topic: [dpdk-dev] [PATCH v1] virtio: Use cpuflag for vector api Thread-Index: AQHRcHMbS07T/1MCB0imsZVttktoXg== Date: Wed, 2 Mar 2016 02:10:14 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F5AC3E@SHSMSX101.ccr.corp.intel.com> References: <1456476662-23081-1-git-send-email-sshukla@mvista.com> <533710CFB86FA344BFBF2D6802E6028622F5A41C@SHSMSX101.ccr.corp.intel.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 Cc: "dev@dpdk.org" 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: Wed, 02 Mar 2016 02:10:40 -0000 On 3/1/2016 5:46 PM, Santosh Shukla wrote:=0A= > On Tue, Mar 1, 2016 at 2:41 PM, Qiu, Michael wrot= e:=0A= >> 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 = cpuflag.=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/virt= io_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= >> 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= > I guess, above approach wont work for non-x86 arch, ad those func are=0A= > dummy, right? also code wont build for arm/non-86 arch because=0A= > tx/rx_pkt_burst callback will be using x86 specific virtio vec rx/tx=0A= > api.=0A= =0A= You may right, but you really need to reduce the #ifdef in *.c files.=0A= =0A= Thanks,=0A= Michael=0A= =0A= >> Thanks,=0A= >> Michael=0A= =0A=