From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CDA44C3B8 for ; Tue, 2 Jun 2015 10:51:21 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Jun 2015 01:51:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,538,1427785200"; d="scan'208";a="703807544" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 02 Jun 2015 01:51:20 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t528pIJY007984; Tue, 2 Jun 2015 16:51:18 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t528pFpV002834; Tue, 2 Jun 2015 16:51:17 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t528pFQC002830; Tue, 2 Jun 2015 16:51:15 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Tue, 2 Jun 2015 16:51:04 +0800 Message-Id: <1433235064-2773-5-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1433235064-2773-1-git-send-email-changchun.ouyang@intel.com> References: <1433147149-31645-1-git-send-email-changchun.ouyang@intel.com> <1433235064-2773-1-git-send-email-changchun.ouyang@intel.com> Subject: [dpdk-dev] [PATCH v4 4/4] lib_vhost: Remove unnecessary vring descriptor length updating 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: Tue, 02 Jun 2015 08:51:22 -0000 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 e08609c..6ec3d5f 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -136,7 +136,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); @@ -290,7 +289,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) { @@ -374,7 +372,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) { @@ -409,26 +406,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