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 0DDE3A054F for ; Mon, 15 Feb 2021 14:29:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 021911606C6; Mon, 15 Feb 2021 14:29:05 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id C48641606E2 for ; Mon, 15 Feb 2021 14:29:03 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lBdvx-0003bz-Kr; Mon, 15 Feb 2021 13:29:01 +0000 From: Christian Ehrhardt To: Marvin Liu Cc: Maxime Coquelin , dpdk stable Date: Mon, 15 Feb 2021 14:28:54 +0100 Message-Id: <20210215132857.1855675-2-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210215132857.1855675-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> <20210215132857.1855675-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix packed ring dequeue offloading' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 stable release 19.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/17/21. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/581e235cf62e8336d8f21f611a0fce251caafda5 Thanks. Christian Ehrhardt --- >From 581e235cf62e8336d8f21f611a0fce251caafda5 Mon Sep 17 00:00:00 2001 From: Marvin Liu Date: Fri, 5 Feb 2021 15:47:58 +0800 Subject: [PATCH] vhost: fix packed ring dequeue offloading [ upstream commit 894028ace2c5af2506897898f407cbdf24cef0c5 ] When vhost is doing dequeue offloading, it parses ethernet and L3/L4 headers of the packet. Then vhost will set corresponding value in mbuf attributes. It means offloading action should be after packet data copy. Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue") Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index b8237f2eb4..f397e9a13a 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1810,7 +1810,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, { bool wrap = vq->avail_wrap_counter; struct vring_packed_desc *descs = vq->desc_packed; - struct virtio_net_hdr *hdr; uint64_t lens[PACKED_BATCH_SIZE]; uint64_t buf_lens[PACKED_BATCH_SIZE]; uint32_t buf_offset = dev->vhost_hlen; @@ -1867,13 +1866,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, ids[i] = descs[avail_idx + i].id; } - if (virtio_net_with_host_offload(dev)) { - vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { - hdr = (struct virtio_net_hdr *)(desc_addrs[i]); - vhost_dequeue_offload(hdr, pkts[i]); - } - } - return 0; free_buf: @@ -1891,6 +1883,7 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, { uint16_t avail_idx = vq->last_avail_idx; uint32_t buf_offset = dev->vhost_hlen; + struct virtio_net_hdr *hdr; uintptr_t desc_addrs[PACKED_BATCH_SIZE]; uint16_t ids[PACKED_BATCH_SIZE]; uint16_t i; @@ -1907,6 +1900,13 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, (void *)(uintptr_t)(desc_addrs[i] + buf_offset), pkts[i]->pkt_len); + if (virtio_net_with_host_offload(dev)) { + vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { + hdr = (struct virtio_net_hdr *)(desc_addrs[i]); + vhost_dequeue_offload(hdr, pkts[i]); + } + } + if (virtio_net_is_inorder(dev)) vhost_shadow_dequeue_batch_packed_inorder(vq, ids[PACKED_BATCH_SIZE - 1]); -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-15 14:24:49.416972864 +0100 +++ 0002-vhost-fix-packed-ring-dequeue-offloading.patch 2021-02-15 14:24:49.285482159 +0100 @@ -1 +1 @@ -From 894028ace2c5af2506897898f407cbdf24cef0c5 Mon Sep 17 00:00:00 2001 +From 581e235cf62e8336d8f21f611a0fce251caafda5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 894028ace2c5af2506897898f407cbdf24cef0c5 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 6580983c82..583bf379c6 100644 +index b8237f2eb4..f397e9a13a 100644 @@ -23 +24 @@ -@@ -2263,7 +2263,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, +@@ -1810,7 +1810,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, @@ -30,2 +31,2 @@ - uint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf); -@@ -2320,13 +2319,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, + uint32_t buf_offset = dev->vhost_hlen; +@@ -1867,13 +1866,6 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev, @@ -45 +46 @@ -@@ -2344,6 +2336,7 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, +@@ -1891,6 +1883,7 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, @@ -48 +49 @@ - uint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf); + uint32_t buf_offset = dev->vhost_hlen; @@ -53 +54 @@ -@@ -2360,6 +2353,13 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev, +@@ -1907,6 +1900,13 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev,