From patchwork Tue Apr 6 15:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 90743 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 D55E0A0546; Tue, 6 Apr 2021 17:45:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4B28141230; Tue, 6 Apr 2021 17:45:06 +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 B7797141230 for ; Tue, 6 Apr 2021 17:45:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617723903; 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=tGDeH2Q7mkwXxHkz+JHMPXvF28xjdCHfpdcX91Jw2AM=; b=ShVx4bkzaVtYSkHPdo4zzQRY8FRgNPDxhHQGg1eL9+6self0GrfmINKsxkqHBOVp+aFgDD NPCFuFSBcqJo5u2M00GK3MWemHzAQvdKMyO+2mP3P9wNX7R++sfJzX4/7CdXbGR4BZsFPr iUoMyUFzzDvMahFj9hnVWi/OKIS9NbY= 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-65-C3nreuPdPq6pONjLTAvalA-1; Tue, 06 Apr 2021 11:45:02 -0400 X-MC-Unique: C3nreuPdPq6pONjLTAvalA-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 9298D81746E for ; Tue, 6 Apr 2021 15:45:01 +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 9FDEB60875; Tue, 6 Apr 2021 15:45:00 +0000 (UTC) From: Balazs Nemeth To: bnemeth@redhat.com, dev@dpdk.org Date: Tue, 6 Apr 2021 17:44:43 +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 Subject: [dpdk-dev] [PATCH 1/4] vhost: move allocation of mbuf outside of packet enqueue 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" In preparation for subsequent patches, move mbuf allocation out and rename virtio_dev_pktmbuf_alloc to virtio_dev_pktmbuf_prep. This function now receives an already allocated mbuf pointer. Signed-off-by: Balazs Nemeth --- lib/librte_vhost/virtio_net.c | 54 ++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 7f621fb6d..666e7fdb8 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -2166,6 +2166,23 @@ virtio_dev_pktmbuf_alloc(struct virtio_net *dev, struct rte_mempool *mp, return NULL; } +static __rte_always_inline int +virtio_dev_pktmbuf_prep(struct virtio_net *dev, struct rte_mbuf *pkt, + uint32_t data_len) +{ + if (rte_pktmbuf_tailroom(pkt) >= data_len) + return 0; + + /* attach an external buffer if supported */ + if (dev->extbuf && !virtio_dev_extbuf_alloc(pkt, data_len)) + return 0; + + /* check if chained buffers are allowed */ + if (!dev->linearbuf) + return 0; + return 1; +} + static __rte_noinline uint16_t virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count) @@ -2259,7 +2276,6 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq, static __rte_always_inline int vhost_reserve_avail_batch_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, - struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t avail_idx, uintptr_t *desc_addrs, @@ -2304,8 +2320,7 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, } vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { - pkts[i] = virtio_dev_pktmbuf_alloc(dev, mbuf_pool, lens[i]); - if (!pkts[i]) + if (virtio_dev_pktmbuf_prep(dev, pkts[i], lens[i])) goto free_buf; } @@ -2326,16 +2341,12 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, return 0; free_buf: - for (i = 0; i < PACKED_BATCH_SIZE; i++) - rte_pktmbuf_free(pkts[i]); - return -1; } static __rte_always_inline int virtio_dev_tx_batch_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, - struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts) { uint16_t avail_idx = vq->last_avail_idx; @@ -2345,8 +2356,8 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, uint16_t ids[PACKED_BATCH_SIZE]; uint16_t i; - if (vhost_reserve_avail_batch_packed(dev, vq, mbuf_pool, pkts, - avail_idx, desc_addrs, ids)) + if (vhost_reserve_avail_batch_packed(dev, vq, pkts, avail_idx, + desc_addrs, ids)) return -1; vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) @@ -2396,8 +2407,8 @@ vhost_dequeue_single_packed(struct virtio_net *dev, VHOST_ACCESS_RO) < 0)) return -1; - *pkts = virtio_dev_pktmbuf_alloc(dev, mbuf_pool, buf_len); - if (unlikely(*pkts == NULL)) { + + 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", @@ -2416,7 +2427,6 @@ vhost_dequeue_single_packed(struct virtio_net *dev, dev->ifname); allocerr_warned = true; } - rte_pktmbuf_free(*pkts); return -1; } @@ -2459,22 +2469,38 @@ virtio_dev_tx_packed(struct virtio_net *dev, { uint32_t pkt_idx = 0; uint32_t remained = count; + uint16_t i; do { rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]); if (remained >= PACKED_BATCH_SIZE) { - if (!virtio_dev_tx_batch_packed(dev, vq, mbuf_pool, + vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { + pkts[pkt_idx + i] = + rte_pktmbuf_alloc(mbuf_pool); + } + + if (!virtio_dev_tx_batch_packed(dev, vq, &pkts[pkt_idx])) { pkt_idx += PACKED_BATCH_SIZE; remained -= PACKED_BATCH_SIZE; + continue; + } else { + vhost_for_each_try_unroll(i, 0, + PACKED_BATCH_SIZE) { + rte_pktmbuf_free(pkts[pkt_idx + i]); + } } } + pkts[pkt_idx] = rte_pktmbuf_alloc(mbuf_pool); + if (virtio_dev_tx_single_packed(dev, vq, mbuf_pool, - &pkts[pkt_idx])) + &pkts[pkt_idx])) { + rte_pktmbuf_free(pkts[pkt_idx]); break; + } pkt_idx++; remained--; From patchwork Tue Apr 6 15:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 90744 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 C0749A0546; Tue, 6 Apr 2021 17:45:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECEAB141237; Tue, 6 Apr 2021 17:45:07 +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 313F514120A for ; Tue, 6 Apr 2021 17:45:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617723904; 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=4nUXP11oEMOcpk+t781Q7YYUq6F92oSdll/5NsleqPw=; b=hUcFQv1xn7pGW9lwcK4PB6FhnuF2YeQ5tybgABfn+tsCBZZpQy1HhXj4u87/bJMdzem5l/ TgWcOUrK6dppr86ntqzFVEoX7jksgvIgNqJa6SrOrekIMqB/NJxcUqs/8/ap6rcRQbYk21 uWjJF5fbqr/Ov7tZAfmA2ceWRqZPmDc= 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-354-WshP2FszMGGhm3NJecri8A-1; Tue, 06 Apr 2021 11:45:03 -0400 X-MC-Unique: WshP2FszMGGhm3NJecri8A-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 B1D2081744F for ; Tue, 6 Apr 2021 15:45:02 +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 EA38060875; Tue, 6 Apr 2021 15:45:01 +0000 (UTC) From: Balazs Nemeth To: bnemeth@redhat.com, dev@dpdk.org Date: Tue, 6 Apr 2021 17:44:44 +0200 Message-Id: <589dabc3c3a22a8e297e09cb554810aa811bc9a7.1617723339.git.bnemeth@redhat.com> 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 Subject: [dpdk-dev] [PATCH 2/4] vhost: perform all mbuf allocations in one loop 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" Move allocation out further and perform all allocation in one loop. The same goes for freeing packets. This is to prepare for use of bulk versions of these functions. Signed-off-by: Balazs Nemeth --- lib/librte_vhost/virtio_net.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 666e7fdb8..496f750e3 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -2471,14 +2471,13 @@ virtio_dev_tx_packed(struct virtio_net *dev, uint32_t remained = count; uint16_t i; + for (i = 0; i < count; ++i) + pkts[i] = rte_pktmbuf_alloc(mbuf_pool); + do { rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]); if (remained >= PACKED_BATCH_SIZE) { - vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { - pkts[pkt_idx + i] = - rte_pktmbuf_alloc(mbuf_pool); - } if (!virtio_dev_tx_batch_packed(dev, vq, &pkts[pkt_idx])) { @@ -2486,19 +2485,11 @@ virtio_dev_tx_packed(struct virtio_net *dev, remained -= PACKED_BATCH_SIZE; continue; - } else { - vhost_for_each_try_unroll(i, 0, - PACKED_BATCH_SIZE) { - rte_pktmbuf_free(pkts[pkt_idx + i]); - } } } - pkts[pkt_idx] = rte_pktmbuf_alloc(mbuf_pool); - if (virtio_dev_tx_single_packed(dev, vq, mbuf_pool, &pkts[pkt_idx])) { - rte_pktmbuf_free(pkts[pkt_idx]); break; } pkt_idx++; @@ -2506,6 +2497,9 @@ virtio_dev_tx_packed(struct virtio_net *dev, } while (remained); + for (i = pkt_idx; i < count; ++i) + rte_pktmbuf_free(pkts[i]); + if (vq->shadow_used_idx) { do_data_copy_dequeue(vq); From patchwork Tue Apr 6 15:44:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 90745 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 030ECA0546; Tue, 6 Apr 2021 17:45:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BA6D14123F; Tue, 6 Apr 2021 17:45:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 10CBF14123F for ; Tue, 6 Apr 2021 17:45:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617723909; 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=bNMkQSDM37iQgeXBsO03T/H5kNmjktBosWEsQfowfr4=; b=dIKuLnDQ7iz/kN/JXaMNoANH6QieAAhbGGqwydw/czdbvXFQqBTv+1Sh52Exods0UdjYBa LeO+BCAQQgWafTrLDxF9Ydszh+xA/MdehtOFHzUftgsCmIB8cvrI5e8elYENI15dHWTaSE 0euJ137OOWeX2khP5IixO4Vj5eJYZ6c= 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-506-esBT-yVSMnGE-8OzQLWC2Q-1; Tue, 06 Apr 2021 11:45:08 -0400 X-MC-Unique: esBT-yVSMnGE-8OzQLWC2Q-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 A55CF81746A for ; Tue, 6 Apr 2021 15:45:06 +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 D9E1E6A03B; Tue, 6 Apr 2021 15:45:02 +0000 (UTC) From: Balazs Nemeth To: bnemeth@redhat.com, dev@dpdk.org Date: Tue, 6 Apr 2021 17:44:45 +0200 Message-Id: <431a22e899c4491e6af747714ff4cc6fb9ed2c28.1617723339.git.bnemeth@redhat.com> 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 Subject: [dpdk-dev] [PATCH 3/4] vhost: allocate and free packets in bulk 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" Now that all allocation and freeing has been moved together, use the faster bulk versions instead of handling packets one by one. Signed-off-by: Balazs Nemeth --- lib/librte_vhost/virtio_net.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 496f750e3..e1696c0c0 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -2471,8 +2471,9 @@ virtio_dev_tx_packed(struct virtio_net *dev, uint32_t remained = count; uint16_t i; - for (i = 0; i < count; ++i) - pkts[i] = rte_pktmbuf_alloc(mbuf_pool); + if (rte_pktmbuf_alloc_bulk(mbuf_pool, pkts, count)) { + return 0; + } do { rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]); @@ -2497,8 +2498,9 @@ virtio_dev_tx_packed(struct virtio_net *dev, } while (remained); - for (i = pkt_idx; i < count; ++i) - rte_pktmbuf_free(pkts[i]); + if (pkt_idx != count) { + rte_pktmbuf_free_bulk(&pkts[pkt_idx], count - pkt_idx); + } if (vq->shadow_used_idx) { do_data_copy_dequeue(vq); From patchwork Tue Apr 6 15:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 90746 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 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 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++;