From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 69E801B485 for ; Wed, 20 Jun 2018 10:27:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2018 01:27:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,246,1526367600"; d="scan'208";a="50429479" Received: from dpdk-test32.sh.intel.com (HELO [10.67.119.193]) ([10.67.119.193]) by orsmga007.jf.intel.com with ESMTP; 20 Jun 2018 01:27:36 -0700 Message-ID: <5B2A7D41.9050609@intel.com> Date: Thu, 21 Jun 2018 00:13:53 +0800 From: "Liu, Yong" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Tiwei Bie CC: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org References: <20180608090724.20855-1-yong.liu@intel.com> <20180608090724.20855-7-yong.liu@intel.com> <20180620074442.GB4686@debian> In-Reply-To: <20180620074442.GB4686@debian> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 6/7] net/virtio: add IN_ORDER Rx/Tx into selection 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: Wed, 20 Jun 2018 08:27:49 -0000 On 06/20/2018 03:44 PM, Tiwei Bie wrote: > On Fri, Jun 08, 2018 at 05:07:23PM +0800, Marvin Liu wrote: > [...] >> >> @@ -634,6 +634,24 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx) >> virtio_rxq_rearm_vec(rxvq); >> nbufs += RTE_VIRTIO_VPMD_RX_REARM_THRESH; >> } >> + } else if (hw->use_inorder_rx) { >> + if ((!virtqueue_full(vq))) { >> + uint16_t free_cnt = vq->vq_free_cnt; >> + struct rte_mbuf *pkts[free_cnt]; >> + >> + if (!rte_pktmbuf_alloc_bulk(rxvq->mpool, pkts, free_cnt)) { >> + error = virtqueue_enqueue_inorder_refill(vq, >> + pkts, >> + free_cnt); >> + if (unlikely(error)) { >> + for (i = 0; i < free_cnt; i++) >> + rte_pktmbuf_free(pkts[i]); >> + } >> + } >> + >> + nbufs += free_cnt; >> + vq_update_avail_idx(vq); > It looks a bit weird to introduce above code > in this patch. Tiwei, code involved here just due to flag "use_inorder_rx" defined in this patch. Will move changes in rx_queue_setup_finish and rxvq_flush function to other patch. Thanks, Marvin > >> + } >> } else { >> while (!virtqueue_full(vq)) { >> m = rte_mbuf_raw_alloc(rxvq->mpool); >> diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c >> index a7d0a9cbe..56a77cc71 100644 >> --- a/drivers/net/virtio/virtqueue.c >> +++ b/drivers/net/virtio/virtqueue.c >> @@ -74,6 +74,14 @@ virtqueue_rxvq_flush(struct virtqueue *vq) >> desc_idx = used_idx; >> rte_pktmbuf_free(vq->sw_ring[desc_idx]); >> vq->vq_free_cnt++; >> + } else if (hw->use_inorder_rx) { >> + desc_idx = (uint16_t)uep->id; >> + dxp = &vq->vq_descx[desc_idx]; >> + if (dxp->cookie != NULL) { >> + rte_pktmbuf_free(dxp->cookie); >> + dxp->cookie = NULL; >> + } > Ditto. > >> + vq_ring_free_inorder(vq, desc_idx, 1); >> } else { >> desc_idx = (uint16_t)uep->id; >> dxp = &vq->vq_descx[desc_idx]; >> -- >> 2.17.0 >>