From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C57FEA04F3 for ; Thu, 19 Dec 2019 15:36:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BABD4330; Thu, 19 Dec 2019 15:36:16 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 910781BF75 for ; Thu, 19 Dec 2019 15:36:15 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id b6so6249418wrq.0 for ; Thu, 19 Dec 2019 06:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I2wyUHvfMOJ+8oaKUBrDikykNGSa9Z2Vbx3bKejYoWE=; b=vUSnmeU2Dj677CWLj4WGSrcoi3biXuGBFo93sVW/pOFNlgHVtUcS55jPMxFObvwPxJ Y/RHy6q+D0oQAlvLJLqnXFU4h0TuhdZ/K1xqTr56qLo9rSW1AC/k0tvhToCD9ubXzHyg wQY2Xe6C4nJAEH6z4JbQnXOnXDZIUbv6J2+iXDN2OSs0FQbca/MviDHgAk5saOphFsQ+ vMz0vdrQiA7e1s4i9oWWqrL8jNCmWBjiS/3A49DH9ryh9NcgPPuzYSZT8sF6AJtrwCJo uzMPuZ66cigAECx6uSi67cB7DoffgzTf+YKBJUu1rJm2g4VAFtb3AyBuShAIjDvVN0Cy YgEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I2wyUHvfMOJ+8oaKUBrDikykNGSa9Z2Vbx3bKejYoWE=; b=rqxgO+4XwFFe6mg3Vevv3M7SSYLepbtUs0UZq6oZ2QuACxFW3K0qm4ddr0FEVAH2+y KAC/hO4JY7AdAW/35WmJ4gM5d7uPi6MXpJvjPFRHCTo3eaZJVHPvMV0hs5mbn7rqWH1x ncF/zbwkkdcIOVQYACFcfLNX1b4trFdGR9e1dFO2ecOOgGEa6CYUNguvLKCcRZv1ctC1 6yeed2TWO9bwSPKtrT//XQjmorvGt9ClnWPUIVzYeXVGkAkMzJYtTnsHGXIemM9dyLUH i6K26lELvi6p6dK1zmMvLqlQBsVAfr0rIv1NX8STqcYRe1vBa4VqiTlqDkm07Uaa01Z0 kgOg== X-Gm-Message-State: APjAAAXkw2nWvTS8PP3eTPOpAeWcEtVprs5FvNlZA/yKJEwvvieRFDHH rVoOCH8A3za7+HbVYFC/iq8= X-Google-Smtp-Source: APXvYqwyaNxf5qCTBr7P/87D2tL3e7WXBheivpXkcG0b9a25ukGMiCErDlS7vxKzi1mCW6mxUNPjWA== X-Received: by 2002:a5d:6b47:: with SMTP id x7mr9812817wrw.277.1576766175304; Thu, 19 Dec 2019 06:36:15 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j2sm6437627wmk.23.2019.12.19.06.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:36:14 -0800 (PST) From: luca.boccassi@gmail.com To: Thibaut Collet Cc: Maxime Coquelin , dpdk stable Date: Thu, 19 Dec 2019 14:33:01 +0000 Message-Id: <20191219143447.21506-34-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/virtio: get all pending Rx packets in vectorized paths' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 4f1d3abf7e61ffec7374266c1801c15d02dcd91e Mon Sep 17 00:00:00 2001 From: Thibaut Collet Date: Wed, 11 Sep 2019 18:04:09 +0200 Subject: [PATCH] net/virtio: get all pending Rx packets in vectorized paths [ upstream commit 016f56b5bc503be2f2286d2c7f5e5eb4200ffb6d ] The loop to read packets does not take all packets as the number of available packets (nb_used) is decremented in the loop. Take all available packets provides a performance improvement of 3%. Fixes: fc3d66212fed ("virtio: add vector Rx") Signed-off-by: Thibaut Collet Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx_simple_neon.c | 5 +++-- drivers/net/virtio/virtio_rxtx_simple_sse.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c index b8b93551f0..a9d5cb6955 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c @@ -72,7 +72,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; - uint16_t nb_used; + uint16_t nb_used, nb_total; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; @@ -135,8 +135,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, virtqueue_notify(vq); } + nb_total = nb_used; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { uint64x2_t desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; uint64x2_t mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; uint64x2_t pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c index 94f65143bb..74ca28d79d 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c @@ -74,7 +74,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; - uint16_t nb_used; + uint16_t nb_used, nb_total; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; @@ -138,8 +138,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, virtqueue_notify(vq); } + nb_total = nb_used; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { __m128i desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; __m128i mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; __m128i pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:27.698475902 +0000 +++ 0034-net-virtio-get-all-pending-Rx-packets-in-vectorized-.patch 2019-12-19 14:32:25.809291956 +0000 @@ -1,14 +1,15 @@ -From 016f56b5bc503be2f2286d2c7f5e5eb4200ffb6d Mon Sep 17 00:00:00 2001 +From 4f1d3abf7e61ffec7374266c1801c15d02dcd91e Mon Sep 17 00:00:00 2001 From: Thibaut Collet Date: Wed, 11 Sep 2019 18:04:09 +0200 Subject: [PATCH] net/virtio: get all pending Rx packets in vectorized paths +[ upstream commit 016f56b5bc503be2f2286d2c7f5e5eb4200ffb6d ] + The loop to read packets does not take all packets as the number of available packets (nb_used) is decremented in the loop. Take all available packets provides a performance improvement of 3%. Fixes: fc3d66212fed ("virtio: add vector Rx") -Cc: stable@dpdk.org Signed-off-by: Thibaut Collet Reviewed-by: Maxime Coquelin @@ -18,10 +19,10 @@ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c -index 70e89fc428..992e71f010 100644 +index b8b93551f0..a9d5cb6955 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c -@@ -42,7 +42,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -72,7 +72,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; @@ -30,12 +31,11 @@ uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; -@@ -106,9 +106,10 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -135,8 +135,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, virtqueue_notify(vq); } + nb_total = nb_used; - ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { @@ -43,10 +43,10 @@ uint64x2_t mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; uint64x2_t pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c -index cb1610e715..f9ec4ae699 100644 +index 94f65143bb..74ca28d79d 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c -@@ -43,7 +43,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -74,7 +74,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; @@ -55,12 +55,11 @@ uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; -@@ -108,9 +108,10 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -138,8 +138,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, virtqueue_notify(vq); } + nb_total = nb_used; - ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) {