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 668FF4A63 for ; Thu, 28 May 2015 15:33:00 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 28 May 2015 06:33:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,513,1427785200"; d="scan'208";a="701566760" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga001.jf.intel.com with ESMTP; 28 May 2015 06:32:57 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 28 May 2015 21:32:54 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX101.ccr.corp.intel.com ([10.239.4.153]) with mapi id 14.03.0224.002; Thu, 28 May 2015 21:32:52 +0800 From: "Ouyang, Changchun" To: Wei li , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: tcp pkt with virtio header in one desc Thread-Index: AQHQmR8mdLksdYy5H0uYczowTfzJwJ2RYhjQ Date: Thu, 28 May 2015 13:32:51 +0000 Message-ID: References: <8975cbf4-0f4d-4da4-8e45-6b75629072e1@liw0310-PC.local> In-Reply-To: <8975cbf4-0f4d-4da4-8e45-6b75629072e1@liw0310-PC.local> Accept-Language: zh-CN, 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] vhost: tcp pkt with virtio header in one desc 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, 28 May 2015 13:33:00 -0000 I have sent out another patch which has already included such fix, That patch also fix other issue in rx path, and it is in reworking, I will send out the v2 version soon. Accordingly, this patch is a duplicated one. Thanks Changchun =20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei li > Sent: Thursday, May 28, 2015 4:20 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] vhost: tcp pkt with virtio header in one desc >=20 > Signed-off-by: Wei li > --- > lib/librte_vhost/vhost_rxtx.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.= c > index 4809d32..2d3ea92 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -588,8 +588,19 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, > uint16_t queue_id, >=20 > desc =3D &vq->desc[head[entry_success]]; >=20 > - /* Discard first buffer as it is the virtio header */ > - desc =3D &vq->desc[desc->next]; > + if (desc->flags & VRING_DESC_F_NEXT) > + { > + /* Discard first buffer as it is the virtio header */ > + desc =3D &vq->desc[desc->next]; > + vb_offset =3D 0; > + vb_avail =3D desc->len; > + } > + else /* virtio header in one desc with real pkt */ > + { > + /* strip the virtio header */ > + vb_offset =3D vq->vhost_hlen; > + vb_avail =3D desc->len - vq->vhost_hlen; > + } >=20 > /* Buffer address translation. */ > vb_addr =3D gpa_to_vva(dev, desc->addr); @@ -608,8 +619,6 > @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > vq->used->ring[used_idx].id =3D head[entry_success]; > vq->used->ring[used_idx].len =3D 0; >=20 > - vb_offset =3D 0; > - vb_avail =3D desc->len; > /* Allocate an mbuf and populate the structure. */ > m =3D rte_pktmbuf_alloc(mbuf_pool); > if (unlikely(m =3D=3D NULL)) { > -- > 1.9.5.msysgit.1 >=20