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 D6AF3200 for ; Sat, 30 Dec 2017 05:02:38 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Dec 2017 20:02:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,478,1508828400"; d="scan'208";a="16563435" Received: from debian-xvivbkq.sh.intel.com ([10.67.104.226]) by fmsmga004.fm.intel.com with ESMTP; 29 Dec 2017 20:02:36 -0800 Date: Sat, 30 Dec 2017 12:02:09 +0800 From: Tiwei Bie To: =?utf-8?B?546L5b+X5YWL?= Cc: "dev@dpdk.org" , bluca@debian.org, yliu@fridaylinux.org Message-ID: <20171230040209.b73z42ymlh4emjxe@debian-xvivbkq.sh.intel.com> References: <6DAF063A35010343823807B082E5681F41D839EF@mbx05.360buyAD.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6DAF063A35010343823807B082E5681F41D839EF@mbx05.360buyAD.local> User-Agent: NeoMutt/20170609 (1.8.3) Subject: Re: [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 04:02:39 -0000 Hi Zhike, On Fri, Dec 29, 2017 at 01:02:04PM +0000, 王志克 wrote: > Hi tiwei, > > Can you please provide a patch for 16.11.4? Thanks. > Normally, most commits in the stable tree are backported from the commits in the mainline tree which contains below Cc line: Cc: stable@dpdk.org This patch also contains such line. So after this patch is applied to the mainline tree, it will be backported. If you need the fix right now, you can download the latest patch (which has been applied to dpdk-next-virtio tree) from here: https://dpdk.org/dev/patchwork/patch/32061/ It can be applied to DPDK 16.11.4 with the patch command. After the patching, one small change is needed to get it work: diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c index 7fd8604..0e24194 100644 --- a/drivers/net/virtio/virtqueue.c +++ b/drivers/net/virtio/virtqueue.c @@ -88,7 +88,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq) for (i = 0; i < nb_used; i++) { used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1); uep = &vq->vq_ring.used->ring[used_idx]; - if (hw->use_simple_rx) { + if (hw->use_simple_rxtx) { desc_idx = used_idx; rte_pktmbuf_free(vq->sw_ring[desc_idx]); vq->vq_free_cnt++; @@ -104,7 +104,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq) vq->vq_used_cons_idx++; } - if (hw->use_simple_rx) { + if (hw->use_simple_rxtx) { while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { virtio_rxq_rearm_vec(rxq); if (virtqueue_kick_prepare(vq)) Besides, I'm not sure whether you are aware of this or not. But just FYI, when you want to use the vector Rx of virtio PMD, you need to be aware of the fact that the current implementation of vector Rx doesn't really follow the virtio spec. You can find more details in below link: http://dpdk.org/ml/archives/dev/2017-December/084101.html Best regards, Tiwei Bie