From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <huawei.xie@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id A22417EC4
 for <dev@dpdk.org>; Wed,  5 Nov 2014 17:42:21 +0100 (CET)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga101.fm.intel.com with ESMTP; 05 Nov 2014 08:49:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.07,320,1413270000"; d="scan'208";a="627086968"
Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82])
 by fmsmga002.fm.intel.com with ESMTP; 05 Nov 2014 08:48:02 -0800
Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by
 PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS)
 id 14.3.195.1; Thu, 6 Nov 2014 00:47:00 +0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.202]) by
 SHSMSX103.ccr.corp.intel.com ([169.254.4.207]) with mapi id 14.03.0195.001;
 Thu, 6 Nov 2014 00:46:59 +0800
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
Thread-Topic: [PATCH v4 1/3] vhost: Fix packet length issue
Thread-Index: AQHP+Mepl3+Djk8L6U6NsGNU/9cjOJxSPj5A
Date: Wed, 5 Nov 2014 16:46:59 +0000
Message-ID: <C37D651A908B024F974696C65296B57B0F2E211F@SHSMSX101.ccr.corp.intel.com>
References: <1415084708-8192-1-git-send-email-changchun.ouyang@intel.com>
 <1415171435-24252-1-git-send-email-changchun.ouyang@intel.com>
 <1415171435-24252-2-git-send-email-changchun.ouyang@intel.com>
In-Reply-To: <1415171435-24252-2-git-send-email-changchun.ouyang@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 v4 1/3] vhost: Fix packet length issue
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Nov 2014 16:42:22 -0000

> -----Original Message-----
> From: Ouyang, Changchun
> Sent: Wednesday, November 05, 2014 12:11 AM
> To: dev@dpdk.org
> Cc: Xie, Huawei; Ananyev, Konstantin; Cao, Waterman; Ouyang, Changchun
> Subject: [PATCH v4 1/3] vhost: Fix packet length issue
>=20
> As HW vlan strip will reduce the packet length by minus length of vlan ta=
g,
> so it need restore the packet length by plus it.
>=20
> Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
> ---
>  examples/vhost/main.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>=20
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 57ef464..5ca8dce 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -1078,7 +1078,13 @@ virtio_tx_route(struct vhost_dev *vdev, struct
> rte_mbuf *m, uint16_t vlan_tag)
>  					rte_pktmbuf_free(m);
>  					return;
>  				}
> -				offset =3D 4;
> +
> +				/*
> +				 * HW vlan strip will reduce the packet length
> +				 * by minus length of vlan tag, so need restore
> +				 * the packet length by plus it.
> +				 */
> +				offset =3D VLAN_HLEN;
>  				vlan_tag =3D
>  				(uint16_t)
>  				vlan_tags[(uint16_t)dev_ll->vdev->dev-
> >device_fh];
> @@ -1102,8 +1108,10 @@ virtio_tx_route(struct vhost_dev *vdev, struct
> rte_mbuf *m, uint16_t vlan_tag)
>  	len =3D tx_q->len;
>=20
>  	m->ol_flags =3D PKT_TX_VLAN_PKT;
> -	/*FIXME: offset*/
> +
>  	m->data_len +=3D offset;
> +	m->pkt_len +=3D offset;
> +
>  	m->vlan_tci =3D vlan_tag;
>=20
>  	tx_q->m_table[len] =3D m;
> --
> 1.8.4.2
Only one thing, I feel "by minus/plus" has grammar problem. :).
Acked-by: Huawei Xie <huawei.xie@intel.com>.