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 C7627914 for ; Sun, 24 Apr 2016 04:45:27 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 23 Apr 2016 19:45:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,525,1455004800"; d="scan'208";a="938892095" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2016 19:45:26 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 23 Apr 2016 19:45:25 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 23 Apr 2016 19:45:25 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.184]) with mapi id 14.03.0248.002; Sun, 24 Apr 2016 10:45:23 +0800 From: "Xie, Huawei" To: "dev@dpdk.org" CC: Stephen Hemminger , "ms >> Michael S. Tsirkin" , Tetsuya Mukawa , "Traynor, Kevin" , "Tan, Jianfeng" , "Yuanhan Liu" Thread-Topic: [RFC PATCH] avail idx update optimizations Thread-Index: AdGcnk4+ItYoYWyVTf2Hi+rA6pmHDg== Date: Sun, 24 Apr 2016 02:45:22 +0000 Message-ID: References: <1461259092-9309-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] [RFC PATCH] avail idx update optimizations 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: Sun, 24 Apr 2016 02:45:28 -0000 Forget to cc the mailing list.=0A= =0A= On 4/22/2016 9:53 PM, Xie, Huawei wrote:=0A= > Hi:=0A= >=0A= > This is a series of virtio/vhost idx/ring update optimizations for cache= =0A= > to cache transfer. Actually I don't expect many of them as virtio/vhost= =0A= > has already done quite right.=0A= >=0A= > For this patch, in a VM2VM test, i observed ~6% performance increase.=0A= > In VM1, run testpmd with txonly mode=0A= > In VM2, run testpmd with rxonly mode=0A= > In host, run testpmd(with two vhostpmds) with io forward=0A= >=0A= > Michael:=0A= > We have talked about this method when i tried the fixed ring.=0A= >=0A= >=0A= > On 4/22/2016 5:12 PM, Xie, Huawei wrote:=0A= >> eliminate unnecessary cache to cache transfer between virtio and vhost= =0A= >> core=0A= >>=0A= >> ---=0A= >> drivers/net/virtio/virtqueue.h | 3 ++-=0A= >> 1 file changed, 2 insertions(+), 1 deletion(-)=0A= >>=0A= >> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtque= ue.h=0A= >> index 4e9239e..8c46a83 100644=0A= >> --- a/drivers/net/virtio/virtqueue.h=0A= >> +++ b/drivers/net/virtio/virtqueue.h=0A= >> @@ -302,7 +302,8 @@ vq_update_avail_ring(struct virtqueue *vq, uint16_t = desc_idx)=0A= >> * descriptor.=0A= >> */=0A= >> avail_idx =3D (uint16_t)(vq->vq_avail_idx & (vq->vq_nentries - 1));=0A= >> - vq->vq_ring.avail->ring[avail_idx] =3D desc_idx;=0A= >> + if (unlikely(vq->vq_ring.avail->ring[avail_idx] !=3D desc_idx))=0A= >> + vq->vq_ring.avail->ring[avail_idx] =3D desc_idx;=0A= >> vq->vq_avail_idx++;=0A= >> }=0A= >> =0A= >=0A= =0A=