From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH v3 7/7] virtio: pick simple rx/tx func 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "Xie, Huawei" , "dev@dpdk.org" 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) In-Reply-To: <1445355007-4613-8-git-send-email-huawei.xie@intel.com> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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