From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ouyang Changchun Subject: [PATCH v2 4/5] lib_vhost: Remove unnecessary vring descriptor length updating Date: Thu, 28 May 2015 23:16:46 +0800 Message-ID: <1432826207-8428-5-git-send-email-changchun.ouyang@intel.com> References: <1430720780-27525-1-git-send-email-changchun.ouyang@intel.com> <1432826207-8428-1-git-send-email-changchun.ouyang@intel.com> To: dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CF9F9C350 for ; Thu, 28 May 2015 17:17:04 +0200 (CEST) In-Reply-To: <1432826207-8428-1-git-send-email-changchun.ouyang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove these unnecessary vring descriptor length updating, vhost should not change them. virtio in front end should assign value to desc.len for both rx and tx. Signed-off-by: Changchun Ouyang --- lib/librte_vhost/vhost_rxtx.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 24de6f4..bb56ae1 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -135,7 +135,6 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, * placed in separate buffers. */ if (desc->flags & VRING_DESC_F_NEXT) { - desc->len = vq->vhost_hlen; desc = &vq->desc[desc->next]; /* Buffer address translation. */ buff_addr = gpa_to_vva(dev, desc->addr); @@ -273,7 +272,6 @@ copy_from_mbuf_to_vring(struct virtio_net *dev, uint16_t res_base_idx, if (vb_avail == 0) { uint32_t desc_idx = vq->buf_vec[vec_idx].desc_idx; - vq->desc[desc_idx].len = vq->vhost_hlen; if ((vq->desc[desc_idx].flags & VRING_DESC_F_NEXT) == 0) { @@ -357,7 +355,6 @@ copy_from_mbuf_to_vring(struct virtio_net *dev, uint16_t res_base_idx, */ uint32_t desc_idx = vq->buf_vec[vec_idx].desc_idx; - vq->desc[desc_idx].len = vb_offset; if ((vq->desc[desc_idx].flags & VRING_DESC_F_NEXT) == 0) { @@ -392,26 +389,13 @@ copy_from_mbuf_to_vring(struct virtio_net *dev, uint16_t res_base_idx, /* * This whole packet completes. */ - uint32_t desc_idx = - vq->buf_vec[vec_idx].desc_idx; - vq->desc[desc_idx].len = vb_offset; - - while (vq->desc[desc_idx].flags & - VRING_DESC_F_NEXT) { - desc_idx = vq->desc[desc_idx].next; - vq->desc[desc_idx].len = 0; - } - /* Update used ring with desc information */ vq->used->ring[cur_idx & (vq->size - 1)].id = vq->buf_vec[vec_idx].desc_idx; vq->used->ring[cur_idx & (vq->size - 1)].len = entry_len; - entry_len = 0; - cur_idx++; entry_success++; - seg_avail = 0; - cpy_len = RTE_MIN(vb_avail, seg_avail); + break; } } } -- 1.8.4.2