From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26D78A0C43; Mon, 18 Oct 2021 15:04:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21A6A41123; Mon, 18 Oct 2021 15:03:59 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E34E141109 for ; Mon, 18 Oct 2021 15:03:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634562237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xvejkVjPXKUm/4sEHk+Ul6AHf7CX74VtirVioP89gyk=; b=HVNA1T2dYX/jaepYD4nFq0M6B2IZ+kpiLG8QcSveChK3YJ+cahVj+VIZxpgkZx9nlrkMc1 x5hd0GZPjLWKY0JOLeGmsDd1BehUjRXykHltgv7V5LmUtJuuu/wpzh3C8uQxnfXS8y73Gr /Qdw8nd474SvkJoiKFacXFUngslDW1s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-vEVXpRBdPOKEPpGjBPEKkw-1; Mon, 18 Oct 2021 09:03:54 -0400 X-MC-Unique: vEVXpRBdPOKEPpGjBPEKkw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 183138735D0; Mon, 18 Oct 2021 13:03:53 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 296C61980E; Mon, 18 Oct 2021 13:03:51 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, jiayu.hu@intel.com, yuanx.wang@intel.com, wenwux.ma@intel.com, bruce.richardson@intel.com, john.mcnamara@intel.com, david.marchand@redhat.com Cc: Maxime Coquelin Date: Mon, 18 Oct 2021 15:02:22 +0200 Message-Id: <20211018130229.308694-8-maxime.coquelin@redhat.com> In-Reply-To: <20211018130229.308694-1-maxime.coquelin@redhat.com> References: <20211018130229.308694-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH v1 07/14] vhost: remove useless fields in async iterator struct X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Offset and count fields are unused and so can be removed. The offset field was actually in the Vhost example, but in a way that does not make sense. Signed-off-by: Maxime Coquelin --- examples/vhost/ioat.c | 6 ++---- lib/vhost/rte_vhost_async.h | 4 ---- lib/vhost/virtio_net.c | 19 ++++--------------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c index dcbcf65e4e..a8c588deff 100644 --- a/examples/vhost/ioat.c +++ b/examples/vhost/ioat.c @@ -142,10 +142,8 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id, break; while (i_seg < iter->nr_segs) { rte_ioat_enqueue_copy(dev_id, - (uintptr_t)(iter->iov[i_seg].src_addr) - + iter->offset, - (uintptr_t)(iter->iov[i_seg].dst_addr) - + iter->offset, + (uintptr_t)(iter->iov[i_seg].src_addr), + (uintptr_t)(iter->iov[i_seg].dst_addr), iter->iov[i_seg].len, 0, 0); diff --git a/lib/vhost/rte_vhost_async.h b/lib/vhost/rte_vhost_async.h index d7bb77bf90..4ea5cfab10 100644 --- a/lib/vhost/rte_vhost_async.h +++ b/lib/vhost/rte_vhost_async.h @@ -20,10 +20,6 @@ struct rte_vhost_iovec { * iovec iterator */ struct rte_vhost_iov_iter { - /** offset to the first byte of interesting data */ - size_t offset; - /** total bytes of data in this iterator */ - size_t count; /** pointer to the iovec array */ struct rte_vhost_iovec *iov; /** number of iovec in this iterator */ diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 7b1c52ea7d..ae7dded979 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -933,19 +933,10 @@ async_fill_vec(struct rte_vhost_iovec *v, void *src, void *dst, size_t len) } static __rte_always_inline void -async_fill_iter(struct rte_vhost_iov_iter *it, size_t count, - struct rte_vhost_iovec *vec, unsigned long nr_seg) +async_fill_iter(struct rte_vhost_iov_iter *it, struct rte_vhost_iovec *vec, unsigned long nr_seg) { - it->offset = 0; - it->count = count; - - if (count) { - it->iov = vec; - it->nr_segs = nr_seg; - } else { - it->iov = 0; - it->nr_segs = 0; - } + it->iov = vec; + it->nr_segs = nr_seg; } static __rte_always_inline void @@ -971,7 +962,6 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, uint32_t cpy_len, buf_len; int error = 0; - uint32_t tlen = 0; int tvec_idx = 0; void *hpa; @@ -1076,7 +1066,6 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, (void *)(uintptr_t)rte_pktmbuf_iova_offset(m, mbuf_offset), hpa, (size_t)mapped_len); - tlen += (uint32_t)mapped_len; cpy_len -= (uint32_t)mapped_len; mbuf_avail -= (uint32_t)mapped_len; mbuf_offset += (uint32_t)mapped_len; @@ -1086,7 +1075,7 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, } } - async_fill_iter(iter, tlen, iovec, tvec_idx); + async_fill_iter(iter, iovec, tvec_idx); out: return error; } -- 2.31.1