From patchwork Wed Apr 7 10:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 90803 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49F26A0579; Wed, 7 Apr 2021 12:19:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CC4E140F3A; Wed, 7 Apr 2021 12:19:24 +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 425B9140E54 for ; Wed, 7 Apr 2021 12:19:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617790761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhJv/Xil3bkzmVZqDJY9pV0gMx7BraBdAoOe6vkw5wA=; b=BzM1eTdKRN0IIrAfTBmGggUp4WxJNnE4OmctyjCD+xtNdtDpkBTpFaki/VcPKjdkw7ATNR AJdKsavFOW6ZfbODVoSRFYchj6B4uLJ/aK75SLqauCXDEkU78gRpwmyJIPUDjWoz/qYSgU AQyqy9w8Gpfv1IGHfxPX/Rl7Ycv2l5o= 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-246-CIiGCg0iNmm2hqZAH-YnGw-1; Wed, 07 Apr 2021 06:19:20 -0400 X-MC-Unique: CIiGCg0iNmm2hqZAH-YnGw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7551083DD21 for ; Wed, 7 Apr 2021 10:19:19 +0000 (UTC) Received: from bnemeth.users.ipa.redhat.com (ovpn-114-106.ams2.redhat.com [10.36.114.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97F985D9CA; Wed, 7 Apr 2021 10:19:16 +0000 (UTC) From: Balazs Nemeth To: bnemeth@redhat.com, dev@dpdk.org Date: Wed, 7 Apr 2021 12:17:21 +0200 Message-Id: <9e8da88efd007673c8c99b1b286be62484f892d2.1617790501.git.bnemeth@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bnemeth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2 4/4] vhost: remove unnecessary level of indirection 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" There is no need to pass a pointer to an mbuf pointer. Signed-off-by: Balazs Nemeth Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 2f0c97b91..1d3ad18fe 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -2390,7 +2390,7 @@ static __rte_always_inline int vhost_dequeue_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, - struct rte_mbuf **pkts, + struct rte_mbuf *pkts, uint16_t *buf_id, uint16_t *desc_count) { @@ -2408,7 +2408,7 @@ vhost_dequeue_single_packed(struct virtio_net *dev, return -1; - if (unlikely(virtio_dev_pktmbuf_prep(dev, *pkts, buf_len))) { + if (unlikely(virtio_dev_pktmbuf_prep(dev, pkts, buf_len))) { if (!allocerr_warned) { VHOST_LOG_DATA(ERR, "Failed mbuf alloc of size %d from %s on %s.\n", @@ -2418,7 +2418,7 @@ vhost_dequeue_single_packed(struct virtio_net *dev, return -1; } - err = copy_desc_to_mbuf(dev, vq, buf_vec, nr_vec, *pkts, + err = copy_desc_to_mbuf(dev, vq, buf_vec, nr_vec, pkts, mbuf_pool); if (unlikely(err)) { if (!allocerr_warned) { @@ -2437,7 +2437,7 @@ static __rte_always_inline int virtio_dev_tx_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, - struct rte_mbuf **pkts) + struct rte_mbuf *pkts) { uint16_t buf_id, desc_count = 0; @@ -2489,7 +2489,7 @@ virtio_dev_tx_packed(struct virtio_net *dev, } if (virtio_dev_tx_single_packed(dev, vq, mbuf_pool, - &pkts[pkt_idx])) { + pkts[pkt_idx])) { break; } pkt_idx++;