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 4E0B7A0A0C; Sun, 13 Jun 2021 14:52:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 879B74014F; Sun, 13 Jun 2021 14:52:06 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2043.outbound.protection.outlook.com [40.107.243.43]) by mails.dpdk.org (Postfix) with ESMTP id E8B344003E; Sun, 13 Jun 2021 14:52:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FtWtJMkTno5ieJ8YQaHranbxi2OpW7WDDEPGpMj1tFwb+T14FIvNM43uj1Igkb7eGJQbgwGVr+MBDmBux0LBWcA0IQj8umDOpKkEEyPwfoeCketmdzcReobSp8AZCvTnDBd0LyUUSdIiDTiQg2UmO3S8R2VXjOHIrLpBF3pP+Hm6urkFkmvKx9/x6H1NVJDUx4WGCdu6ZZDIOAfelIxQptHqD+D5i7yLQJ7ZRDZctMGC3RS9XM/vQHzEF+QVOHiNYWXJVpPoYjynYmwAY8audTZfW5McXEm1IspYgynFifL0/azjw/5UhKTs4/u/D89GR511K4oLSCIZI0CZlaGchQ== 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-SenderADCheck; bh=untqXqnSfTwmpEQRuQbvN8CWFJeRsc2stG1L/OE+cWY=; b=oaX2Jg56Yvy6+3jNCJlBJZxBlIhIJGPNKfOvErEd1Ug4AFMgdArQWt0akj1MaLm3I4KPDkIxzaUsb3rMII82QCPNSHdmfIz4b4vNo+Xg9TQTT2/CCGQqT/CPwWjfU/YPyuoMpg0waTkDwJkb+h7nTnWH6QTPXxmsjuiH1lZb4EY/IytX/lFvCXjYIcW8EgmD9grpf2SB3nOw5j70OeBbK59KktJUN86NidIYMAyWq5KZhyJBGVX3typPKe6CX1oFuGF3zKIrv4/woWplwvf69IpyuGSR0oWCEHyz5v33jIySccgNDSERIsxPdMXQQQggN74fHw/jqfCrhkAh9v+ddg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=untqXqnSfTwmpEQRuQbvN8CWFJeRsc2stG1L/OE+cWY=; b=UX2oFjVxRZvWeJaWn8Iwz2kKTlrxE6hHOE+FXP+g8u5rNs0ni8v4uzZ3CXZFNbTzCE2uhw8lSeYu8yvJvLW99XjqCPzrja0Bw4y6vGN2Wra40HdcsGzmZvgnQtxvqGQUxtrSITXLtvRpMBL8KtX9ZHfUIenpCwJYmVBO/XIlHafhA2CDfUwl5UTnHLT5hCK3iM35akhac4lTnOQwYdXQGiwxcJd+B7WAlq0owP2zVDGEHQ/5EIFPwCDH/EJgR31+p5k1dQDfDzwEzvCSCeBLhRIcDQmvdv4CXT9BsPH4WebSiLwTxfc4SiX+ss5emPU7J+7Nm6Kp0gKXGHCFEmSK4g== Received: from DM6PR06CA0091.namprd06.prod.outlook.com (2603:10b6:5:336::24) by DM6PR12MB3337.namprd12.prod.outlook.com (2603:10b6:5:118::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.25; Sun, 13 Jun 2021 12:52:02 +0000 Received: from DM6NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::9e) by DM6PR06CA0091.outlook.office365.com (2603:10b6:5:336::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Sun, 13 Jun 2021 12:52:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT052.mail.protection.outlook.com (10.13.172.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Sun, 13 Jun 2021 12:52:02 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 13 Jun 2021 12:52:00 +0000 From: Xueming Li To: CC: , , , , Viacheslav Ovsiienko , "Maxime Coquelin" Date: Sun, 13 Jun 2021 20:51:39 +0800 Message-ID: <20210613125139.17998-1-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77395910-e18c-4e9e-c801-08d92e6a0a75 X-MS-TrafficTypeDiagnostic: DM6PR12MB3337: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7QQZ7ucmhpRB/7yk/+JHO4xYFc1at7L92+RghbFxnJKe8S/kbKFK5H2AWKTZvT3Vg2kivqZrVeLUlIgnc6CKhlauPcfJt2jNSW6D/hKYOu4UP30wwomyCrpcdcwFJ7Z0cd0eqVClp1e5R6JzM0ERr26QoQuRE3QdeIT2wva1ynmXBrCJaJfO7YRUQTYRx292h6i27exRQWKxFlgKlTexfoYD72+RS+CdtnxzjxPt4NcoeO2GCdEHih/oCjjNLSPYoiVFhpfSMqOF2E/kGPo8pkyMRzZhuCyY87UG7QNAPjVnt4k2Ufm6mLjZxDd4y66/fpOzEg492MdL0LxyZubrPXJRFvYzEDglNDwnbO3wG2I+HEuiaDphuCzruujmnRIuxjyePxV2Qdb8qbGYQ+u389PXn3HNezoZxW3CjZKOLiTcICiBZ6Un1bI+ubIgzsdTwwO6tmf3NCGFZNbeXhRQIH2TIcq7nnyv0rgwZ+9BeaHHGkLfdhtT37E+4Pmef2YITUa9k0k0zrOF6TdMA9A7LKujR7E/A7SDQeFkvwyb0SC+RYhintXGHy/mUFD/NXNPAIQmPt6tOt1x8348HvyQmQP4gwwej27n18Slugm+MXj1estpz5VhV04P3d/fG8RpHnr2ECUGwGEvcB7NASzoBqV5zYNK4oa1vUV10ZJfsSM= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(136003)(346002)(396003)(39860400002)(36840700001)(46966006)(54906003)(82310400003)(26005)(7696005)(36906005)(16526019)(336012)(82740400003)(186003)(55016002)(1076003)(2616005)(356005)(83380400001)(109986005)(6666004)(426003)(5660300002)(7636003)(316002)(36756003)(47076005)(4326008)(70586007)(70206006)(8676002)(478600001)(86362001)(6286002)(36860700001)(8936002)(2906002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2021 12:52:02.5448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77395910-e18c-4e9e-c801-08d92e6a0a75 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3337 Subject: [dpdk-dev] [PATCH] vdpa/mlx5: fix TSO offload without CSUM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Packet was corrupted when TSO requested without CSUM update. Enables CSUM automatically if only TSO requested. Fixes: 2aa8444b0084 ("vdpa/mlx5: support stateless offloads") Cc: matan@nvidia.com Cc: stable@dpdk.org Signed-off-by: Xueming Li --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index 024c5c4180..f530646058 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -442,6 +442,13 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv) DRV_LOG(ERR, "Failed to configure negotiated features."); return -1; } + if ((priv->features & (1ULL << VIRTIO_NET_F_CSUM)) == 0 && + ((priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO4)) > 0 || + (priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO6)) > 0)) { + /* Packet may be corrupted if TSO is enabled without CSUM. */ + DRV_LOG(INFO, "TSO is enabled without CSUM, force CSUM."); + priv->features |= (1ULL << VIRTIO_NET_F_CSUM); + } if (nr_vring > priv->caps.max_num_virtio_queues * 2) { DRV_LOG(ERR, "Do not support more than %d virtqs(%d).", (int)priv->caps.max_num_virtio_queues * 2, -- 2.25.1