From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8E0A99AB5 for ; Tue, 24 Mar 2015 08:14:50 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 24 Mar 2015 00:14:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,456,1422950400"; d="scan'208";a="471694507" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by FMSMGA003.fm.intel.com with ESMTP; 24 Mar 2015 00:14:48 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 24 Mar 2015 15:14:04 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.36]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.111]) with mapi id 14.03.0224.002; Tue, 24 Mar 2015 15:14:03 +0800 From: "Xie, Huawei" To: "Ouyang, Changchun" Thread-Topic: [PATCH v3] lib/librte_vhost: update used->idx when allocation of mbuf fails Thread-Index: AdBmAhrwIL6lbrObR7e9/9Pe7FJrCg== Date: Tue, 24 Mar 2015 07:14:02 +0000 Message-ID: References: <1426902420-21492-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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3] lib/librte_vhost: update used->idx when allocation of mbuf fails 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: Tue, 24 Mar 2015 07:14:51 -0000 On 3/22/2015 8:08 PM, Ouyang, Changchun wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: linhaifeng [mailto:haifeng.lin@huawei.com]=0A= >> Sent: Saturday, March 21, 2015 9:47 AM=0A= >> To: dev@dpdk.org=0A= >> Cc: Ouyang, Changchun; Xie, Huawei=0A= >> Subject: [PATCH v3] lib/librte_vhost: update used->idx when allocation o= f=0A= >> mbuf fails=0A= >>=0A= >> From: Linhaifeng =0A= >>=0A= >> When failed to malloc buffer from mempool we just update last_used_idx= =0A= >> but not used->idx so after many times vhost thought have handle all pack= ets=0A= >> but virtio_net thought vhost have not handle all packets and will not up= date=0A= >> avail->idx.=0A= >>=0A= >> Signed-off-by: Linhaifeng =0A= > Acked-by: Changchun Ouyang =0A= >=0A= >=0A= >=0A= Acked-by: Huawei Xie =0A= =0A= This patch fix the issue.=0A= Simple solution like other PMDs is before processing one descriptor,=0A= ensure allocation of new mbuf is successfull, and then immediately=0A= refill after receiving the packet from the descriptor.=0A= In future, we should consider optimized bulk allocation strategy with=0A= threshold.=0A= =0A= =0A= =0A= =0A=