From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id CC4049AB5 for ; Tue, 1 Mar 2016 10:45:46 +0100 (CET) Received: by mail-pf0-f173.google.com with SMTP id w128so65098494pfb.2 for ; Tue, 01 Mar 2016 01:45:46 -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=NMR4KVk+HHQWEa9dPCEB86WIvUWck5/kORmhVn6nuRI=; b=Zjm9BtVIwEDLn25ut7PLI2cLkDDnau5DhCm3REDmrGzsg4Ci564IJQZecJmbdD9AtO zaYOr5fzBoKhPIjssa2BKZjUk0oSH+2Lg06UIU2Y6Ra61lNwhpmvQNJTVndm8yb5NUdL D7eTyZG09Ac9NOvYIEAaZbXJFeQZDfscOzt6HwzSbFf6+xAszD4Oi75FoSpSLYHYfrPd TUA7aDloEMV/pvDp2quGPKXLYKbvGBd5sds8YShLeR9iRkmujmyMKbIyLFDXbgO4NQ5V tqM+JJcPJBOCXiT7AYX+Qz1JP1sxdpik+8jDxXSwwCLmDJIQxV94nElUlEVhS7TbvEDe 3FCw== 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=NMR4KVk+HHQWEa9dPCEB86WIvUWck5/kORmhVn6nuRI=; b=cFRP0cSsnuH8BCCiNGfzNsGcFIbCt2N7QXJe2cC7EEhVjUH0t503xS82sds86cPXCe o6EYCxpCjLIAD4bXMJtmVYCJGkct2MTT4iaxqm9WxDGh0tgdp5Alj5SWJL1LaYtx8bho aPcoiqrDxippQhkEq6QsdWTqqA4mD13frSpMx5prf+Gy9H2QX6EdqftCtD0IamRMFqOg WoAp8kPe7tX9/3WcgFkFqGX9M1xm/VbvpwwW6hOqba+7Rm45rdlX+MwB+Z7KyD61PtW7 ki+GzRpdQajHs+wn52q0X+6d8tLnNo97LI4e43lC+Renc4Cx/fI3FTmZrolhWBDvRxtI jm5A== X-Gm-Message-State: AD7BkJKDpxzbVyUrA4F0krTVTRh1SnTdoOWK7Pg34qTZ0pFTYFaSNLabnb4+GS3C0VFRIQlgp5MsUk0Ht+6FC7UB MIME-Version: 1.0 X-Received: by 10.98.34.205 with SMTP id p74mr5521403pfj.93.1456825546122; Tue, 01 Mar 2016 01:45:46 -0800 (PST) Received: by 10.66.176.200 with HTTP; Tue, 1 Mar 2016 01:45:46 -0800 (PST) In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622F5A41C@SHSMSX101.ccr.corp.intel.com> References: <1456476662-23081-1-git-send-email-sshukla@mvista.com> <533710CFB86FA344BFBF2D6802E6028622F5A41C@SHSMSX101.ccr.corp.intel.com> Date: Tue, 1 Mar 2016 15:15:46 +0530 Message-ID: From: Santosh Shukla To: "Qiu, Michael" Content-Type: text/plain; charset=UTF-8 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: Tue, 01 Mar 2016 09:45:47 -0000 On Tue, Mar 1, 2016 at 2:41 PM, Qiu, Michael wrote: > On 2/26/2016 4:53 PM, 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 >> >> todo: >> 1) Move virtio_recv_pkts_vec() implementation to >> drivers/virtio/virtio_vec_.h file. >> 2) Remove use_simple_rxtx flag, so that virtio/virtio_vec_.h >> files to provide vectored/non-vectored rx/tx apis. >> >> Signed-off-by: Santosh Shukla >> --- >> - v1: This is a rework of patch [1]. >> Note: This patch will let non-x86 arch to use virtio pmd. >> >> [1] http://dpdk.org/dev/patchwork/patch/10429/ >> >> drivers/net/virtio/virtio_rxtx.c | 16 +++++++++++++++- >> drivers/net/virtio/virtio_rxtx.h | 2 ++ >> drivers/net/virtio/virtio_rxtx_simple.c | 11 ++++++++++- >> 3 files changed, 27 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c >> index 41a1366..ec0b8de 100644 >> --- a/drivers/net/virtio/virtio_rxtx.c >> +++ b/drivers/net/virtio/virtio_rxtx.c >> @@ -67,7 +67,9 @@ >> #define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \ >> ETH_TXQ_FLAGS_NOOFFLOADS) >> >> +#ifdef RTE_MACHINE_CPUFLAG_SSSE3 >> static int use_simple_rxtx; >> +#endif >> >> > > I don't think so much #ifdef ... #endif in *.c file is a good choice. > Would you consider let it only in header file like: > > in drivers/net/virtio/virtio_rxtx.h > > [...] > > #ifdef RTE_MACHINE_CPUFLAG_SSSE3 > int virtio_rxq_vec_setup(struct virtqueue *rxq); > > int virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq, > struct rte_mbuf *m); > #else > int virtio_rxq_vec_setup(__rte_unused struct virtqueue *rxq) {return -1;} > int virtqueue_enqueue_recv_refill_simple(__rte_unused struct virtqueue *vq, > __rte_unused struct rte_mbuf *m) { > return -1; > } > #endif > > and remove most #ifdef ... #endif in *.c file. > I guess, above approach wont work for non-x86 arch, ad those func are dummy, right? also code wont build for arm/non-86 arch because tx/rx_pkt_burst callback will be using x86 specific virtio vec rx/tx api. > Thanks, > Michael