From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 31CCA8E6C for ; Sat, 12 Dec 2015 08:39:33 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 11 Dec 2015 23:39:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,417,1444719600"; d="scan'208";a="839702597" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 11 Dec 2015 23:39:32 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 11 Dec 2015 23:39:32 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 11 Dec 2015 23:39:31 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.28]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.190]) with mapi id 14.03.0248.002; Sat, 12 Dec 2015 15:39:30 +0800 From: "Tan, Jianfeng" To: "Huawei@dpdk.org" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix virtio_net_hdr desc pointing to the same buffer Thread-Index: AQHRNB9kJ3QtlfXbFkqAdOPBoMxZFJ7G8+6Q Date: Sat, 12 Dec 2015 07:39:30 +0000 Message-ID: References: <1449763652-86292-1-git-send-email-huawei.xie@intel.com> In-Reply-To: <1449763652-86292-1-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] virtio: fix virtio_net_hdr desc pointing to the same buffer 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: Sat, 12 Dec 2015 07:39:34 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei@dpdk.org > Sent: Friday, December 11, 2015 12:08 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] virtio: fix virtio_net_hdr desc pointing to t= he > same buffer >=20 > The virtio_net_hdr desc all pointed to the same buffer. It doesn't cause > issue because in the simple TX mode we don't use the header. This patch > makes the header desc point to different buffer. >=20 > Signed-off-by: Huawei Xie > --- > drivers/net/virtio/virtio_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio= _rxtx.c > index 74b39ef..6cfd315 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -352,7 +352,7 @@ virtio_dev_vring_start(struct virtqueue *vq, int > queue_type) > vq->vq_ring.desc[i + mid_idx].next =3D i; > vq->vq_ring.desc[i + mid_idx].addr =3D > vq->virtio_net_hdr_mem + > - mid_idx * vq->hw- > >vtnet_hdr_size; > + i * vq->hw->vtnet_hdr_size; > vq->vq_ring.desc[i + mid_idx].len =3D > vq->hw->vtnet_hdr_size; > vq->vq_ring.desc[i + mid_idx].flags =3D > -- > 1.8.1.4 So in the case when header is not used, shall the way of pointing to all he= ader bufs to one buf help improve the performance? At least, it saves some of cache lines. Thanks, Jianfeng