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 8B90358CB for ; Thu, 29 Jan 2015 11:40:13 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 29 Jan 2015 02:39:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="446941422" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jan 2015 02:26:03 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 29 Jan 2015 18:39:51 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.192]) with mapi id 14.03.0195.001; Thu, 29 Jan 2015 18:39:49 +0800 From: "Xie, Huawei" To: linhaifeng , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer Thread-Index: AQHQO67GgUqVMnSI5EeHUDiC/owWhZzW5y3g Date: Thu, 29 Jan 2015 10:39:49 +0000 Message-ID: References: <1422527404-12424-1-git-send-email-haifeng.lin@huawei.com> In-Reply-To: <1422527404-12424-1-git-send-email-haifeng.lin@huawei.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] vhost: notify guest to fill buffer when there is no 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: Thu, 29 Jan 2015 10:40:13 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of linhaifeng > Sent: Thursday, January 29, 2015 6:30 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there= is no > buffer >=20 > From: Linhaifeng >=20 > If we found there is no buffer we should notify virtio_net to > fill buffers. >=20 > We use mz send buffers from VM to VM,found that the other VM > stop to receive data after many hours. >=20 > Signed-off-by: Linhaifeng > --- > lib/librte_vhost/vhost_rxtx.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.= c > index ccfd82f..013c526 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -87,9 +87,14 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_i= d, > /*check that we have enough buffers*/ > if (unlikely(count > free_entries)) > count =3D free_entries; > - > - if (count =3D=3D 0) > + /* If there is no buffers we should notify guest to fill. > + * This is need when guest use virtio_net driver(not pmd). > + */ > + if (count =3D=3D 0) { > + if (!(vq->avail->flags & > VRING_AVAIL_F_NO_INTERRUPT)) > + eventfd_write((int)vq->kickfd, 1); > return 0; > + } Haifeng: Is it the root cause and is it protocol required? Could you give a detailed description for that scenario? >=20 > res_end_idx =3D res_base_idx + count; > /* vq->last_used_idx_res is atomically updated. */ > -- > 1.9.0 >=20