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 88EB5A0546; Tue, 6 Apr 2021 17:45:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A028B141248; Tue, 6 Apr 2021 17:45:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id D9C9B14120A for ; Tue, 6 Apr 2021 17:45:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617723915; 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=BKa18OMDinYuDL+G9flLb9V9oGTO5IFdF5wOcjIiNX4=; b=KywYU9KNW/Mze1IqTaKjZk3TQtVAyI1VPGya2DOemhgQGbwTqhFrZ86kQ+bwzTG375LnW6 xFxVpZKpviTh4IQUpRztPkoQRUXVb7O49MYEdDTpXmhxn4j3sTzZmmFohQUb9naIMmY6DX M1g0sHXVwZHvy3LicfP5pS/HBATdg1U= 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-181-r5sma7CnP-Cgdc1WmQ1qLQ-1; Tue, 06 Apr 2021 11:45:13 -0400 X-MC-Unique: r5sma7CnP-Cgdc1WmQ1qLQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF3478030C4 for ; Tue, 6 Apr 2021 15:45:12 +0000 (UTC) Received: from bnemeth.users.ipa.redhat.com (ovpn-112-176.ams2.redhat.com [10.36.112.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CF4F60875; Tue, 6 Apr 2021 15:45:06 +0000 (UTC) From: Balazs Nemeth To: bnemeth@redhat.com, dev@dpdk.org Date: Tue, 6 Apr 2021 17:44:46 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH 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 --- 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 e1696c0c0..179c57b46 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; @@ -2490,7 +2490,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++; -- 2.30.2