From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9F3F3936C for ; Thu, 22 Oct 2015 04:51:13 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 21 Oct 2015 19:51:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,180,1444719600"; d="scan'208";a="816655297" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 21 Oct 2015 19:51:11 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Oct 2015 19:51:09 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Oct 2015 19:51:09 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.204]) by shsmsx102.ccr.corp.intel.com ([169.254.2.253]) with mapi id 14.03.0248.002; Thu, 22 Oct 2015 10:50:37 +0800 From: "Tan, Jianfeng" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func Thread-Index: AQHRC0yJvEuWK5brfUigwdbccHoSXJ520OLw Date: Thu, 22 Oct 2015 02:50:36 +0000 Message-ID: References: <1443537953-23917-1-git-send-email-huawei.xie@intel.com> <1445355007-4613-1-git-send-email-huawei.xie@intel.com> <1445355007-4613-8-git-send-email-huawei.xie@intel.com> In-Reply-To: <1445355007-4613-8-git-send-email-huawei.xie@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 Subject: Re: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func 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: Thu, 22 Oct 2015 02:51:14 -0000 On 10/22/2015 10:45 AM, Jianfeng wrote: > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie > Sent: Tuesday, October 20, 2015 11:30 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func >=20 > simple rx/tx func is enabled when user specifies single segment and no > offload support. > merge-able should be disabled to use simple rxtx. >=20 > Signed-off-by: Huawei Xie > --- > drivers/net/virtio/virtio_rxtx.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio= _rxtx.c > index 947fc46..71f8cd4 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -62,6 +62,10 @@ > #define VIRTIO_DUMP_PACKET(m, len) do { } while (0) #endif >=20 > + > +#define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS > | \ > + ETH_TXQ_FLAGS_NOOFFLOADS) > + > static int use_simple_rxtx; >=20 > static void > @@ -471,6 +475,14 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev > *dev, > return -EINVAL; > } >=20 > + /* Use simple rx/tx func if single segment and no offloads */ > + if ((tx_conf->txq_flags & VIRTIO_SIMPLE_FLAGS) =3D=3D > VIRTIO_SIMPLE_FLAGS) { > + PMD_INIT_LOG(INFO, "Using simple rx/tx path"); > + dev->tx_pkt_burst =3D virtio_xmit_pkts_simple; > + dev->rx_pkt_burst =3D virtio_recv_pkts_vec; Whether recv side mergeable is supported is controlled by virtio_negotiate_= feature(). So "dev->rx_pkt_burst =3D virtio_recv_pkts_vec" should be restricted by=20 hw->guest_features & VIRTIO_NET_F_MRG_RXBUF, right? > + use_simple_rxtx =3D 1; > + } > + > ret =3D virtio_dev_queue_setup(dev, VTNET_TQ, queue_idx, > vtpci_queue_idx, > nb_desc, socket_id, &vq); > if (ret < 0) { > -- > 1.8.1.4