From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 601F593F4 for ; Thu, 22 Oct 2015 13:40:41 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2015 04:40:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,181,1444719600"; d="scan'208";a="832510792" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 22 Oct 2015 04:40:32 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 04:40:32 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 04:40:31 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.194]) with mapi id 14.03.0248.002; Thu, 22 Oct 2015 19:40:30 +0800 From: "Xie, Huawei" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func Thread-Index: AdEMvnNqdr/jV9fORBSZzRJUGrHfYg== Date: Thu, 22 Oct 2015 11:40:29 +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> 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 11:40:41 -0000 On 10/22/2015 10:50 AM, Tan, Jianfeng wrote:=0A= > On 10/22/2015 10:45 AM, Jianfeng wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie=0A= >> Sent: Tuesday, October 20, 2015 11:30 PM=0A= >> To: dev@dpdk.org=0A= >> Subject: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func=0A= >>=0A= >> simple rx/tx func is enabled when user specifies single segment and no= =0A= >> offload support.=0A= >> merge-able should be disabled to use simple rxtx.=0A= >>=0A= >> Signed-off-by: Huawei Xie =0A= >> ---=0A= >> drivers/net/virtio/virtio_rxtx.c | 12 ++++++++++++=0A= >> 1 file changed, 12 insertions(+)=0A= >>=0A= >> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virti= o_rxtx.c=0A= >> index 947fc46..71f8cd4 100644=0A= >> --- a/drivers/net/virtio/virtio_rxtx.c=0A= >> +++ b/drivers/net/virtio/virtio_rxtx.c=0A= >> @@ -62,6 +62,10 @@=0A= >> #define VIRTIO_DUMP_PACKET(m, len) do { } while (0) #endif=0A= >>=0A= >> +=0A= >> +#define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS=0A= >> | \=0A= >> + ETH_TXQ_FLAGS_NOOFFLOADS)=0A= >> +=0A= >> static int use_simple_rxtx;=0A= >>=0A= >> static void=0A= >> @@ -471,6 +475,14 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev=0A= >> *dev,=0A= >> return -EINVAL;=0A= >> }=0A= >>=0A= >> + /* Use simple rx/tx func if single segment and no offloads */=0A= >> + if ((tx_conf->txq_flags & VIRTIO_SIMPLE_FLAGS) =3D=3D=0A= >> VIRTIO_SIMPLE_FLAGS) {=0A= >> + PMD_INIT_LOG(INFO, "Using simple rx/tx path");=0A= >> + dev->tx_pkt_burst =3D virtio_xmit_pkts_simple;=0A= >> + dev->rx_pkt_burst =3D virtio_recv_pkts_vec;=0A= > Whether recv side mergeable is supported is controlled by virtio_negotiat= e_feature().=0A= > So "dev->rx_pkt_burst =3D virtio_recv_pkts_vec" should be restricted by = =0A= > hw->guest_features & VIRTIO_NET_F_MRG_RXBUF, right?=0A= Add this check in next version. However it will still be put here as we=0A= want to leave us a chance to dynamically choose normal/simple rx function.= =0A= >=0A= >> + use_simple_rxtx =3D 1;=0A= >> + }=0A= >> +=0A= >> ret =3D virtio_dev_queue_setup(dev, VTNET_TQ, queue_idx,=0A= >> vtpci_queue_idx,=0A= >> nb_desc, socket_id, &vq);=0A= >> if (ret < 0) {=0A= >> --=0A= >> 1.8.1.4=0A= >=0A= =0A=