From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m15-44.126.com (m15-44.126.com [220.181.15.44]) by dpdk.org (Postfix) with ESMTP id 6CC4B5A86 for ; Thu, 17 Dec 2015 05:18:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=fcPmi BKX4rlZTZRRkE5qs4gEz6NKBBryWxg2U7HFtIo=; b=g3ql576BlqjsYs3r1fuYI 2bnL8R6cMR8w//7D3KOAtBDAoTHNPJA8nstL4ES0erFmofH+ya1IxUeCQ8/ITC9F 4QE6gDtloXZatBikQxn4D7hJ8NDRMk94cUTxbEoaMa2UUP99nYmZoKR/8TwjUN5/ BIMC6ZsLDfXxVIhLBHSzgQ= Received: from zhangwqh$126.com ( [69.138.24.88, 54.241.20.62, 10.144.1.72] ) by ajax-webmail-wmsvr44 (Coremail) ; Thu, 17 Dec 2015 12:18:36 +0800 (CST) X-Originating-IP: [69.138.24.88, 54.241.20.62, 10.144.1.72] Date: Thu, 17 Dec 2015 12:18:36 +0800 (CST) From: =?GBK?B?1cXOsA==?= To: dev@dpdk.org X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20150911(74783.7961) Copyright (c) 2002-2015 www.mailtech.cn 126com X-CM-CTRLDATA: RunYZmZvb3Rlcl9odG09OTc5OTo1Ng== MIME-Version: 1.0 Message-ID: <44e6e2b3.65ad.151ae293aa7.Coremail.zhangwqh@126.com> X-CM-TRANSID: LMqowAD3_z+dN3JWeu4lAA--.6739W X-CM-SenderInfo: x2kd0wxztkqiyswou0bp/1tbiih3T6VXnHvS7ywAAsF X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] dpdk multi process increase the number of mbufs, throughput gets dropped 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, 17 Dec 2015 04:18:40 -0000 SGkgYWxsLCAKCgpXaGVuIHJ1bm5pbmcgdGhlIG11bHRpIHByb2Nlc3MgZXhhbXBsZSwgZG9lcyBh bnlib2R5IGtub3cgdGhhdCB3aHkgaW5jcmVhc2luZyB0aGUgbnVtYmVyIG9mIG1idWZzLCB0aGUg cGVyZm9ybWFuY2UgZ2V0cyBkcm9wcGVkLiAKCgpJbiBtdWx0aSBwcm9jZXNzIGV4YW1wbGUsIHRo ZXJlIGFyZSB0d28gbWFjcm9zIHdoaWNoIGFyZSByZWxhdGVkIHRvIHRoZSBudW1iZXIgb2YgbWJ1 ZnMKCgojZGVmaW5lTUJVRlNfUEVSX0NMSUVOVDE1MzYKfAp8ICNkZWZpbmVNQlVGU19QRVJfUE9S VDE1MzYgfAp8IHwKCgpJZiBpbmNyZWFzaW5nIHRoZXNlIHR3byBudW1iZXJzIGJ5IDggdGltZXMs IHRoZSBwZXJmb3JtYW5jZSBkcm9wcyBhYm91dCAxMCUuIERvZXMgYW55Ym9keSBrbm93IHdoeT8K CnwgY29uc3R1bnNpZ25lZCBudW1fbWJ1ZnMgPSAobnVtX2NsaWVudHMgKiBNQlVGU19QRVJfQ0xJ RU5UKSBcIHwKfCB8ICsgKHBvcnRzLT5udW1fcG9ydHMgKiBNQlVGU19QRVJfUE9SVCk7IHwKfCBw a3RtYnVmX3Bvb2wgPSBydGVfbWVtcG9vbF9jcmVhdGUoUEtUTUJVRl9QT09MX05BTUUsIG51bV9t YnVmcywgfAp8IHwgTUJVRl9TSVpFLCBNQlVGX0NBQ0hFX1NJWkUsIHwKfCB8IHNpemVvZihzdHJ1 Y3QgcnRlX3BrdG1idWZfcG9vbF9wcml2YXRlKSwgcnRlX3BrdG1idWZfcG9vbF9pbml0LCB8Cnwg fCBOVUxMLCBydGVfcGt0bWJ1Zl9pbml0LCBOVUxMLCBydGVfc29ja2V0X2lkKCksIE5PX0ZMQUdT ICk7IHw= >From huawei.xie@intel.com Thu Dec 17 05:48:04 2015 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EED4F5947 for ; Thu, 17 Dec 2015 05:48:03 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 16 Dec 2015 20:48:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,439,1444719600"; d="scan'208";a="873222007" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 16 Dec 2015 20:48:02 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 16 Dec 2015 20:48:02 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 16 Dec 2015 20:48:01 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.190]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.105]) with mapi id 14.03.0248.002; Thu, 17 Dec 2015 12:47:59 +0800 From: "Xie, Huawei" To: Tom Kiely , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix rx ring descriptor starvation Thread-Index: AdEnp1J61clOw+YwQ8y+r2GXRAF+4Q== Date: Thu, 17 Dec 2015 04:47:59 +0000 Message-ID: References: <1447407013-6986-1-git-send-email-tkiely@brocade.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 rx ring descriptor starvation 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, 17 Dec 2015 04:48:04 -0000 On 11/26/2015 1:33 AM, Xie, Huawei wrote:=0A= > On 11/13/2015 5:33 PM, Tom Kiely wrote:=0A= >> If all rx descriptors are processed while transient=0A= >> mbuf exhaustion is present, the rx ring ends up with=0A= >> no available descriptors. Thus no packets are received=0A= >> on that ring. Since descriptor refill is performed post=0A= >> rx descriptor processing, in this case no refill is=0A= >> ever subsequently performed resulting in permanent rx=0A= >> traffic drop.=0A= >>=0A= >> Signed-off-by: Tom Kiely =0A= >> ---=0A= >> drivers/net/virtio/virtio_rxtx.c | 6 ++++--=0A= >> 1 file changed, 4 insertions(+), 2 deletions(-)=0A= >>=0A= >> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virti= o_rxtx.c=0A= >> index 5770fa2..a95e234 100644=0A= >> --- a/drivers/net/virtio/virtio_rxtx.c=0A= >> +++ b/drivers/net/virtio/virtio_rxtx.c=0A= >> @@ -586,7 +586,8 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **r= x_pkts, uint16_t nb_pkts)=0A= >> if (likely(num > DESC_PER_CACHELINE))=0A= >> num =3D num - ((rxvq->vq_used_cons_idx + num) % DESC_PER_CACHELINE);= =0A= >> =0A= >> - if (num =3D=3D 0)=0A= >> + /* Refill free descriptors even if no pkts recvd */=0A= >> + if (num =3D=3D 0 && virtqueue_full(rxvq))=0A= > Should the return condition be that no used buffers and we have avail=0A= > descs in avail ring, i.e,=0A= > num =3D=3D 0 && rxvq->vq_free_cnt !=3D rxvq->vq_nentries=0A= >=0A= > rather than=0A= > num =3D=3D 0 && rxvq->vq_free_cnt =3D=3D 0=0A= > ?=0A= Tom:=0A= Any further progress?=0A= >> return 0;=0A= >> =0A= >> num =3D virtqueue_dequeue_burst_rx(rxvq, rcv_pkts, len, num);=0A= >> @@ -683,7 +684,8 @@ virtio_recv_mergeable_pkts(void *rx_queue,=0A= >> =0A= >> virtio_rmb();=0A= >> =0A= >> - if (nb_used =3D=3D 0)=0A= >> + /* Refill free descriptors even if no pkts recvd */=0A= >> + if (nb_used =3D=3D 0 && virtqueue_full(rxvq))=0A= >> return 0;=0A= >> =0A= >> PMD_RX_LOG(DEBUG, "used:%d\n", nb_used);=0A= >=0A= =0A=