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 185B9A04B5 for ; Tue, 3 Dec 2019 19:27:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0EEF737AF; Tue, 3 Dec 2019 19:27:58 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 0AEDA37AF for ; Tue, 3 Dec 2019 19:27:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397676; 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=NYIEiKzPgDaoiU5Zs33u/+uUU5MOTaKANTMa1EVXgjM=; b=PDix5tGmGfl1ZBBJGi9qUryBq1dPPracJZCYMagRBTNih1rzA0yu6gkMXZ7W80a/ORAM78 St9Ui2/jC80cO8H0zlim+dH6gcuEZTfSWf4GxBnUc2DyurAtFFwiCCmKavsHl6Ejt1ji3H isWPw5mu+HSX1C6zz9WM4AnUzXgTEfE= 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-321-RyeLMYN1OlqYnoF4lYX0GQ-1; Tue, 03 Dec 2019 13:27:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AC268017CC; Tue, 3 Dec 2019 18:27:52 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 928E85C240; Tue, 3 Dec 2019 18:27:46 +0000 (UTC) From: Kevin Traynor To: Thibaut Collet Cc: Maxime Coquelin , dpdk stable Date: Tue, 3 Dec 2019 18:26:20 +0000 Message-Id: <20191203182714.17297-11-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: RyeLMYN1OlqYnoF4lYX0GQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/virtio: fix Rx stats with vectorized functions' has been queued to LTS release 18.11.6 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 18.11.6 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/10/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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/413c5a7ef116d842dc= 122a4d7595a73ec3d6377c Thanks. Kevin. --- >From 413c5a7ef116d842dc122a4d7595a73ec3d6377c Mon Sep 17 00:00:00 2001 From: Thibaut Collet Date: Wed, 11 Sep 2019 18:04:08 +0200 Subject: [PATCH] net/virtio: fix Rx stats with vectorized functions [ upstream commit 6958e40dbc189ccd287983ea91e257d5ccf26810 ] With vectorized functions, only the rx stats for number of packets is incremented. Update also the other statistics. Performance impact is about 2% Fixes: fc3d66212fed ("virtio: add vector Rx") Signed-off-by: Thibaut Collet Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx.c | 2 +- drivers/net/virtio/virtio_rxtx.h | 2 ++ drivers/net/virtio/virtio_rxtx_simple_neon.c | 5 +++++ drivers/net/virtio/virtio_rxtx_simple_sse.c | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_r= xtx.c index a02e1207f..0fface207 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -756,5 +756,5 @@ virtio_discard_rxbuf_inorder(struct virtqueue *vq, stru= ct rte_mbuf *m) } =20 -static void +void virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *m= buf) { diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_r= xtx.h index 685cc4f81..1eb8dae22 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -60,4 +60,6 @@ struct virtnet_ctl { =20 int virtio_rxq_vec_setup(struct virtnet_rx *rxvq); +void virtio_update_packet_stats(struct virtnet_stats *stats, +=09=09=09=09struct rte_mbuf *mbuf); =20 #endif /* _VIRTIO_RXTX_H_ */ diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/vir= tio/virtio_rxtx_simple_neon.c index d6207d7bb..9200db7ff 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c @@ -48,4 +48,5 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx= _pkts, =09struct rte_mbuf **sw_ring; =09struct rte_mbuf **sw_ring_end; +=09struct rte_mbuf **ref_rx_pkts; =09uint16_t nb_pkts_received =3D 0; =20 @@ -106,4 +107,5 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **= rx_pkts, =09} =20 +=09ref_rx_pkts =3D rx_pkts; =09for (nb_pkts_received =3D 0; =09=09nb_pkts_received < nb_used;) { @@ -205,4 +207,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **= rx_pkts, =09vq->vq_free_cnt +=3D nb_pkts_received; =09rxvq->stats.packets +=3D nb_pkts_received; +=09for (nb_used =3D 0; nb_used < nb_pkts_received; nb_used++) +=09=09virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); + =09return nb_pkts_received; } diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virt= io/virtio_rxtx_simple_sse.c index d768d0757..d6194a33f 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c @@ -49,4 +49,5 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx= _pkts, =09struct rte_mbuf **sw_ring; =09struct rte_mbuf **sw_ring_end; +=09struct rte_mbuf **ref_rx_pkts; =09uint16_t nb_pkts_received =3D 0; =09__m128i shuf_msk1, shuf_msk2, len_adjust; @@ -108,4 +109,5 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **= rx_pkts, =09} =20 +=09ref_rx_pkts =3D rx_pkts; =09for (nb_pkts_received =3D 0; =09=09nb_pkts_received < nb_used;) { @@ -191,4 +193,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **= rx_pkts, =09vq->vq_free_cnt +=3D nb_pkts_received; =09rxvq->stats.packets +=3D nb_pkts_received; +=09for (nb_used =3D 0; nb_used < nb_pkts_received; nb_used++) +=09=09virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); + =09return nb_pkts_received; } --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:52.453267982 +0000 +++ 0011-net-virtio-fix-Rx-stats-with-vectorized-functions.patch=092019-12-= 03 17:29:51.707750848 +0000 @@ -1 +1 @@ -From 6958e40dbc189ccd287983ea91e257d5ccf26810 Mon Sep 17 00:00:00 2001 +From 413c5a7ef116d842dc122a4d7595a73ec3d6377c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6958e40dbc189ccd287983ea91e257d5ccf26810 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index e1c0e28b8..42f2beb40 100644 +index a02e1207f..0fface207 100644 @@ -27 +28 @@ -@@ -107,5 +107,5 @@ vq_ring_free_id_packed(struct virtqueue *vq, uint16_t = id) +@@ -756,5 +756,5 @@ virtio_discard_rxbuf_inorder(struct virtqueue *vq, str= uct rte_mbuf *m) @@ -30 +31 @@ --static inline void +-static void @@ -46 +47 @@ -index cdc2a4d28..70e89fc42 100644 +index d6207d7bb..9200db7ff 100644 @@ -70 +71 @@ -index af76708d6..cb1610e71 100644 +index d768d0757..d6194a33f 100644