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 E7AE4A0032 for ; Fri, 24 Jun 2022 17:02:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E297C400EF; Fri, 24 Jun 2022 17:02:52 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D1C7C4281A for ; Fri, 24 Jun 2022 17:02:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656082970; 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=hqV9+MkPsq9apmWSz4dz7FdS/EAJ4sOGGyWqDx43LdA=; b=NaKgl8VMPZmuuGE6oXXF2BxizCfOeG+5WO00zVOnSnGBbx+FfcFPzxvu63lc2prx3itOJm D+GWPK/WLku+Un38T4ZNgREsWnZWlRxA18nc6Luz7DZkw+ojb0RIv8SxcvQ3dyHr1GrBc/ mGstpmRUizQFIa4KPev7HBij/B1bMIY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-399-S0XYoO3YMtiXvcO0yHtNHw-1; Fri, 24 Jun 2022 11:02:49 -0400 X-MC-Unique: S0XYoO3YMtiXvcO0yHtNHw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 236C889C5E2; Fri, 24 Jun 2022 15:02:48 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 339201730C; Fri, 24 Jun 2022 15:02:47 +0000 (UTC) From: Kevin Traynor To: Maxime Coquelin Cc: Chenbo Xia , dpdk stable Subject: patch 'vhost: fix missing enqueue pseudo-header calculation' has been queued to stable release 21.11.2 Date: Fri, 24 Jun 2022 16:01:45 +0100 Message-Id: <20220624150148.1855580-37-ktraynor@redhat.com> In-Reply-To: <20220624150148.1855580-1-ktraynor@redhat.com> References: <20220624150148.1855580-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.2 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/22. 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 This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/361723acefa59e547588bca60d00bd4cebc6ad10 Thanks. Kevin --- >From 361723acefa59e547588bca60d00bd4cebc6ad10 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Wed, 8 Jun 2022 14:49:42 +0200 Subject: [PATCH] vhost: fix missing enqueue pseudo-header calculation [ upstream commit 7316b4fd610fe945a0bc20054ba5ab61b98bb155 ] The Virtio specification requires that in case of checksum offloading, the pseudo-header checksum must be set in the L4 header. When received from another Vhost-user port, the packet checksum might already contain the pseudo-header checksum but we have no way to know it. So we have no other choice than doing the pseudo-header checksum systematically. This patch handles this using the rte_net_intel_cksum_prepare() helper. Fixes: 859b480d5afd ("vhost: add guest offload setting") Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/vhost/virtio_net.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 568d6538ed..eed43658cf 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -416,4 +416,14 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) if (csum_l4) { + /* + * Pseudo-header checksum must be set as per Virtio spec. + * + * Note: We don't propagate rte_net_intel_cksum_prepare() + * errors, as it would have an impact on performance, and an + * error would mean the packet is dropped by the guest instead + * of being dropped here. + */ + rte_net_intel_cksum_prepare(m_buf); + net_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; net_hdr->csum_start = m_buf->l2_len + m_buf->l3_len; -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-24 15:51:10.026626330 +0100 +++ 0042-vhost-fix-missing-enqueue-pseudo-header-calculation.patch 2022-06-24 15:51:08.932984246 +0100 @@ -1 +1 @@ -From 7316b4fd610fe945a0bc20054ba5ab61b98bb155 Mon Sep 17 00:00:00 2001 +From 361723acefa59e547588bca60d00bd4cebc6ad10 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7316b4fd610fe945a0bc20054ba5ab61b98bb155 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index 68a26eb17d..ce22e3ac79 100644 +index 568d6538ed..eed43658cf 100644 @@ -31 +32 @@ -@@ -597,4 +597,14 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) +@@ -416,4 +416,14 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)