From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 7B1C3568F for ; Sat, 21 Mar 2015 09:41:24 +0100 (CET) Received: from 172.24.2.119 (EHLO szxeml431-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BDL07191; Sat, 21 Mar 2015 16:41:22 +0800 (CST) Received: from [127.0.0.1] (10.177.19.115) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.158.1; Sat, 21 Mar 2015 16:41:12 +0800 Message-ID: <550D2EA7.9080506@huawei.com> Date: Sat, 21 Mar 2015 16:41:11 +0800 From: Linhaifeng User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: References: <1426902420-21492-1-git-send-email-haifeng.lin@huawei.com> In-Reply-To: <1426902420-21492-1-git-send-email-haifeng.lin@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.115] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.550D2EB2.006D, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 534ccb825afde8950773edca2b9f5186 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: Sat, 21 Mar 2015 08:41:25 -0000 cc changchun.ouyang@intel.com cc huawei.xie@intel.com On 2015/3/21 9:47, linhaifeng wrote: > From: Linhaifeng > > When failed to malloc buffer from mempool we just update last_used_idx but > not used->idx so after many times vhost thought have handle all packets > but virtio_net thought vhost have not handle all packets and will not > update avail->idx. > > Signed-off-by: Linhaifeng > --- > lib/librte_vhost/vhost_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c > index 535c7a1..510ffe8 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -609,7 +609,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > if (unlikely(m == NULL)) { > RTE_LOG(ERR, VHOST_DATA, > "Failed to allocate memory for mbuf.\n"); > - return entry_success; > + break; > } > seg_offset = 0; > seg_avail = m->buf_len - RTE_PKTMBUF_HEADROOM; > -- Regards, Haifeng