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 817BCA00C5 for ; Wed, 20 Jul 2022 10:23:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78A9E41101; Wed, 20 Jul 2022 10:23:53 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2043.outbound.protection.outlook.com [40.107.92.43]) by mails.dpdk.org (Postfix) with ESMTP id E3D714003C for ; Wed, 20 Jul 2022 10:23:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cFpPvNsP309znbnAapm14o1vGC3j3eZYojNvQ49knKXWUbp94/VkhhlTRFi4UsTDYe1sDM6mOziAd/6H+1x7nYV6+aFEpYdC25qQPd+fNgfc4DM27jU6lbaXRya5nqM4siYYo7+ONrwCLg3DYG9AXqXVgd7gVQuOGStHYEV+Sf19cJ+tQqve6sp6KHt58xR6TbjDyzTsW2LNHtFkLtHjh8jw6D4tLn5wXpRH1sugkArYg2lPj7qFSIzt6EjWEHJSFVInszA9rzpkNdxZxg5NTiIgdpQ8ilTIlWNnf9GqzfUGI0OkGD5F8fRTXm7/YfS3bPPUL4+LcB3cZBdYCpZFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4HFORoCTbWYohDzcy7hIpTMW/ts9D/0ZHHizkHzx33c=; b=OT1yGlVRl1lKANXCCRcrLTQW0oKX4cadtuRX6E2mmc/K98uhcX5AZpWsd4vl2wasTfrn8hhfxccKzNa/+P7Xz0Lu5R+glm+HzUdONyjHM9QbEMh5BKDGwkg3lt7Du1o2O8MJZnky7/XD8NFL/uODCf3T9E8x1TV/F2H2o+F7gmlJAFkntE1YsN/zb2DuwDQyidH6iz/Os0jPcGiM4hlfj6owIKsNFLgO1Fvw+sTWQMCrZquk1/5cAwXisJbcz5IEK2IGSvOsGCh3cGjO2R8d9H4MqstSuXtN1xOS/3XRWsmYZepAHASSFfCSopRxOkeYQB4xkWu9dqt5t+qOPvj9nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4HFORoCTbWYohDzcy7hIpTMW/ts9D/0ZHHizkHzx33c=; b=PMMxlC4KXRCzZOgb3hJiiMHpp55uoGzMKiKTwyhDXhQugEQ9ovXOmPexfkgcWY22z3HAu4VZULVtHZbUCE3+O23DwQnIdvdgtbCTz/1zQNSPrTr6tJtxXGzNB4RzSAb/lnaBGER8qHa6EbO4JS0KBrQDqzqZ4tl/DUR/tMH0PaP3WwFOfjz1OpwBlXvNk+bt98OBZ2wnUh0Egohy8usLeD0uDOyr/PwiMVTFQ1TjhWcDq0KDpY8zPeBeKBpzORZRn7XV+PHnP985SEXzFOjxV7NKH+f+hYkyywQQprm1+3TVZj1ES4evHL8UGzb+KQL853cyL2K03nxMmOEoAX2fdQ== Received: from MW4PR04CA0279.namprd04.prod.outlook.com (2603:10b6:303:89::14) by DS7PR12MB5863.namprd12.prod.outlook.com (2603:10b6:8:7a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.22; Wed, 20 Jul 2022 08:23:51 +0000 Received: from CO1NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::8d) by MW4PR04CA0279.outlook.office365.com (2603:10b6:303:89::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18 via Frontend Transport; Wed, 20 Jul 2022 08:23:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT007.mail.protection.outlook.com (10.13.174.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:23:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:23:50 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 20 Jul 2022 01:23:48 -0700 From: Xueming Li To: Maxime Coquelin CC: , Chenbo Xia , dpdk stable Subject: patch 'vhost: fix missing enqueue pseudo-header calculation' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:51 +0300 Message-ID: <20220720082132.3954126-22-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02de68e1-961e-4667-9ac4-08da6a292d54 X-MS-TrafficTypeDiagnostic: DS7PR12MB5863:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ofH7tChaHzK7CbqImt1Es4NaQeZpHAul324wA6+unGWteLPBHwQgpCUJ1X3i?= =?us-ascii?Q?Cv5fyo5aiHBzhkJT2igwdcrRB8lYdtLWu9QUm5f1Y3Y6tH5W/V6zOI3eZ2kw?= =?us-ascii?Q?2iuf7mLYywh+MWF9OPIGfgbF8Klrw4s2XLw0tm2u8PnVtotRVUd64Ry13KSH?= =?us-ascii?Q?Ue2NZK9eY3g44S6eNRvEnntkGkgHjCjM/My6tLPMDViPyNxe0fvFOP51ILUr?= =?us-ascii?Q?+sRKFbz0TTbuk08aWuxhEe3F1SvXt2iU6Xwqzl4ihDhYHN+mtxV8N/akTT64?= =?us-ascii?Q?RQUT7kCH97U2KYP5wpwbtpbmRs9nsfzOgsn/FhnG7hHx06yHwbtNgwVhMO8J?= =?us-ascii?Q?OCmMUYLIs9CEjUi+6Swzowfc66CjpVgnxl/LkB4YAlQ8YKeiPU1UfZRFo+7Q?= =?us-ascii?Q?O6UYV9nH1TvPefDeUo96jf9jNUu3A/SD4WQCISMgn3MU0vUHDjFhVLSvr+dr?= =?us-ascii?Q?xXPK6c00NV8MSK128SMOqBtI+BgmrT/xvjy6nMsuZpm7iOgL1Sa+1IF9iiIv?= =?us-ascii?Q?N6sFKoOKeVV0/tOLPQCJxXxXa6hEQGgU0db6nixNMk7v4yWo0vPFOkWH6SQ8?= =?us-ascii?Q?zCPHCNz8nBmb0TEpZAzWJ3jsRiLUaAsYXZvfMixGlQaQ3/frBBam6rl5ufUv?= =?us-ascii?Q?TZG/jtjEmeVWKts9D4LPn5SgF0UC8iyM7ChiChDU9aslTXURc8MzPsdAEfU1?= =?us-ascii?Q?iHPhfhN0P/UXh2Dwuu11jN4cWa/ZTORm0cj9qjMZ4BvfQrFTjGlYMH2jJ5lJ?= =?us-ascii?Q?5kmXDL5PZ5e4pPyuhs8n5z+RrmrhSPzHRQB+CJlA3prgEjXNM8Mz3QhM7PPR?= =?us-ascii?Q?Swz95K0GrnfaQNF3/D5/R4pK/e/2Agcwwa12aDSWFoM2IuxsJALrZUYK/hZU?= =?us-ascii?Q?jzKRQmpmYhSKtuVXJ1P9k9FwLYyL8UGXOVyUea4/mRGX/boCObChBSaPNAku?= =?us-ascii?Q?EcPPPwsg4MuKFEWOD5z1vA=3D=3D?= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(396003)(39860400002)(376002)(36840700001)(40470700004)(46966006)(36860700001)(316002)(36756003)(6916009)(86362001)(81166007)(54906003)(6286002)(26005)(55016003)(82310400005)(82740400003)(40480700001)(8676002)(966005)(70586007)(41300700001)(40460700003)(2906002)(53546011)(5660300002)(356005)(8936002)(186003)(16526019)(2616005)(1076003)(7696005)(70206006)(336012)(6666004)(478600001)(426003)(47076005)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:23:51.1975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02de68e1-961e-4667-9ac4-08da6a292d54 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5863 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 20.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 07/22/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/338b9cbeb49b4e8ec6f576c99790b938141e7916 Thanks. Xueming Li --- >From 338b9cbeb49b4e8ec6f576c99790b938141e7916 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 Cc: Xueming Li [ 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index d4e9da308a..485a93e313 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -428,6 +428,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.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:00:59.797886762 +0800 +++ 0022-vhost-fix-missing-enqueue-pseudo-header-calculation.patch 2022-07-20 15:00:58.707667169 +0800 @@ -1 +1 @@ -From 7316b4fd610fe945a0bc20054ba5ab61b98bb155 Mon Sep 17 00:00:00 2001 +From 338b9cbeb49b4e8ec6f576c99790b938141e7916 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 7316b4fd610fe945a0bc20054ba5ab61b98bb155 ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ - lib/vhost/virtio_net.c | 10 ++++++++++ + lib/librte_vhost/virtio_net.c | 10 ++++++++++ @@ -27,6 +29,6 @@ -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 d4e9da308a..485a93e313 100644 +--- a/lib/librte_vhost/virtio_net.c ++++ b/lib/librte_vhost/virtio_net.c +@@ -428,6 +428,16 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) + csum_l4 |= PKT_TX_TCP_CKSUM;