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 99683A0540 for ; Thu, 7 Jul 2022 09:58:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 944FE406B4; Thu, 7 Jul 2022 09:58:49 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 549B7406B4 for ; Thu, 7 Jul 2022 09:58:48 +0200 (CEST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 1C1253F1FD for ; Thu, 7 Jul 2022 07:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657180728; bh=WrKzaI1uldBWtuR5gAm/0AqasaIEG6pXrnxtlJoDyuI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AXbxhRAuYU7Ws58ichABmy+KOPWJSJznndnDTtS0ea4KgnfkN297zEAFnsBNiLTYB g1e70FaRnXIOwDNLk5WJ6Oi29mv0HPnSvJue5uEh4jgMvznXiHM01df7LoTxdWWmdk yxQMT+7VMGFjsV3q5m9QO7bdx244L548VfBdJiqNKkeVjcfMDJS6+JBOnH8PQiGz16 6DqgOLg9JlLOm3iKBdo9CS5xCdSKpQak6FgD6sKnzl8TpY8SVkkoZW2mBRH0Q8VbQz SQGHb1+uHz2Tz0t1woAZ03njN0WCYXI8Y5XJwSAR0Dwdifowjnbn56KqOcKfv6iCuU ak3b7yOAasUxg== Received: by mail-ed1-f72.google.com with SMTP id b7-20020a056402350700b00435bd1c4523so13367696edd.5 for ; Thu, 07 Jul 2022 00:58:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WrKzaI1uldBWtuR5gAm/0AqasaIEG6pXrnxtlJoDyuI=; b=egKvJg81Iqvm7lExdTplIJTwLcgb/bDVLlcEmdRtmfA+ck3QvAflaMRBr9fkub0O2h xI3jx+UN0LZjpVnFYe+zZJOFbbt0UlWgwtO5WVuqjJpbgTNeaCmouIMFMhfW6nOC9wcA STQ/7NRG1PCCSObRKifIxejd+wem5tL89vaRc9Pty+RHZmbVEbG8ApjFaPfvTUPQZqgY XsNTErFSG0Bl20JMivxHYBVR8JFvBiOwkXcp8hlOoDCbljFTNI9gJoRpp+L8yd8Te0Z4 wKxnD7Lvw4D5f33Gxj4Uf48r5VbrIp9xvQtqVeckDUnZvgF4oW6V62nbcXPqReQWL3rC E7ZQ== X-Gm-Message-State: AJIora8JcFPBPot8PmBfn7ACdtzb+MRtAF1f3Jw4FHUPjluJfDZaDRry MYbT0Xdb56eoICY0DDAsI9QNQyNljq8Tquk4geeEerpdEb6xKqzwj0XSxMou/krvW6pdkj37pEi 24VL2d19WrFejKs7sX4DFZYcj X-Received: by 2002:a05:6402:390b:b0:43a:281e:48fc with SMTP id fe11-20020a056402390b00b0043a281e48fcmr31313051edb.214.1657180727872; Thu, 07 Jul 2022 00:58:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vOIvPkfUw1Sc/lapm2fUlm10jq/wUMCsxCsnbPzcEDxEcSv+2fHLy7/VdrARzR4udnKjIIEQ== X-Received: by 2002:a05:6402:390b:b0:43a:281e:48fc with SMTP id fe11-20020a056402390b00b0043a281e48fcmr31313040edb.214.1657180727690; Thu, 07 Jul 2022 00:58:47 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2a02:6d40:3a4f:7b00:c19b:938e:7c97:afe2]) by smtp.gmail.com with ESMTPSA id t12-20020a50d70c000000b0043590660f16sm28173064edi.35.2022.07.07.00.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 00:58:47 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Maxime Coquelin Cc: Chenbo Xia , dpdk stable Subject: patch 'vhost: fix missing enqueue pseudo-header calculation' has been queued to stable release 19.11.13 Date: Thu, 7 Jul 2022 09:55:01 +0200 Message-Id: <20220707075522.194223-66-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220707075522.194223-1-christian.ehrhardt@canonical.com> References: <20220707075522.194223-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 19.11.13 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/09/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/bf77b580a98ac6975ea69b7878e0bf8ac6e421a6 Thanks. Christian Ehrhardt --- >From bf77b580a98ac6975ea69b7878e0bf8ac6e421a6 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/librte_vhost/virtio_net.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 62b7bbda96..ae4e54a442 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -402,6 +403,16 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) csum_l4 |= PKT_TX_TCP_CKSUM; 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.37.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-07 09:54:13.896445577 +0200 +++ 0066-vhost-fix-missing-enqueue-pseudo-header-calculation.patch 2022-07-07 09:54:10.977824691 +0200 @@ -1 +1 @@ -From 7316b4fd610fe945a0bc20054ba5ab61b98bb155 Mon Sep 17 00:00:00 2001 +From bf77b580a98ac6975ea69b7878e0bf8ac6e421a6 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7316b4fd610fe945a0bc20054ba5ab61b98bb155 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -24,2 +25,2 @@ - lib/vhost/virtio_net.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) + lib/librte_vhost/virtio_net.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) @@ -27,6 +28,14 @@ -diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c -index 68a26eb17d..ce22e3ac79 100644 ---- a/lib/vhost/virtio_net.c -+++ b/lib/vhost/virtio_net.c -@@ -596,6 +596,16 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) - csum_l4 |= RTE_MBUF_F_TX_TCP_CKSUM; +diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c +index 62b7bbda96..ae4e54a442 100644 +--- a/lib/librte_vhost/virtio_net.c ++++ b/lib/librte_vhost/virtio_net.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -402,6 +403,16 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) + csum_l4 |= PKT_TX_TCP_CKSUM;