From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 02051A046B for ; Mon, 24 Jun 2019 17:26:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC2421BEB7; Mon, 24 Jun 2019 17:26:15 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 12B541BEB7 for ; Mon, 24 Jun 2019 17:26:14 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 849FB3082B02; Mon, 24 Jun 2019 15:26:13 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-250.ams2.redhat.com [10.36.116.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CDF219C6A; Mon, 24 Jun 2019 15:26:11 +0000 (UTC) From: Kevin Traynor To: Maxime Coquelin Cc: Yaroslav Brustinov , David Marchand , Tiwei Bie , dpdk stable Date: Mon, 24 Jun 2019 16:24:38 +0100 Message-Id: <20190624152525.19349-14-ktraynor@redhat.com> In-Reply-To: <20190624152525.19349-1-ktraynor@redhat.com> References: <20190624152525.19349-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 24 Jun 2019 15:26:13 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: fix in-order Rx with segmented packet' has been queued to LTS release 18.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/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. 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/52bc0e022a1fd76374d970f1e5d2b4a5237b450b Thanks. Kevin Traynor --- >From 52bc0e022a1fd76374d970f1e5d2b4a5237b450b Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Wed, 5 Jun 2019 12:00:36 +0200 Subject: [PATCH] net/virtio: fix in-order Rx with segmented packet [ upstream commit 61d0bec3ba28c11dbc2c53390ef9ed9d5807a788 ] After having dequeued a burst of descriptors, there may be a need to dequeue a few more if the last packet was segmented and not complete. When it happens, the extra segments were not properly attached to the mbuf chain, and so were lost. Also, head segment data_len field is wrongly summed with the length of all the segments of the chain. This patch fixes both the mbuf chaining and head segment's data_len field. Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx") Reported-by: Yaroslav Brustinov Reviewed-by: David Marchand Reviewed-by: Tiwei Bie Signed-off-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 98282dcff..f8311b6e2 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -985,5 +985,5 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, struct virtio_hw *hw = vq->hw; struct rte_mbuf *rxm; - struct rte_mbuf *prev; + struct rte_mbuf *prev = NULL; uint16_t nb_used, num, nb_rx; uint32_t len[VIRTIO_MBUF_BURST_SZ]; @@ -1073,5 +1073,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]); - rx_pkts[nb_rx]->data_len += (uint16_t)(len[i]); if (prev) @@ -1093,5 +1092,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, VIRTIO_MBUF_BURST_SZ); - prev = rcv_pkts[nb_rx]; if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { virtio_rmb(); @@ -1110,5 +1108,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, prev = rxm; rx_pkts[nb_rx]->pkt_len += len[extra_idx]; - rx_pkts[nb_rx]->data_len += len[extra_idx]; extra_idx += 1; }; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-06-24 16:18:55.822490456 +0100 +++ 0014-net-virtio-fix-in-order-Rx-with-segmented-packet.patch 2019-06-24 16:18:54.986432286 +0100 @@ -1 +1 @@ -From 61d0bec3ba28c11dbc2c53390ef9ed9d5807a788 Mon Sep 17 00:00:00 2001 +From 52bc0e022a1fd76374d970f1e5d2b4a5237b450b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 61d0bec3ba28c11dbc2c53390ef9ed9d5807a788 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 4333c10a9..62d5a4174 100644 +index 98282dcff..f8311b6e2 100644 @@ -32 +33 @@ -@@ -1420,5 +1420,5 @@ virtio_recv_pkts_inorder(void *rx_queue, +@@ -985,5 +985,5 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, @@ -39 +40 @@ -@@ -1512,5 +1512,4 @@ virtio_recv_pkts_inorder(void *rx_queue, +@@ -1073,5 +1073,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, @@ -45 +46 @@ -@@ -1532,5 +1531,4 @@ virtio_recv_pkts_inorder(void *rx_queue, +@@ -1093,5 +1092,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, @@ -50,2 +51,2 @@ - virtio_rmb(hw->weak_barriers); -@@ -1549,5 +1547,4 @@ virtio_recv_pkts_inorder(void *rx_queue, + virtio_rmb(); +@@ -1110,5 +1108,4 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue,