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 4FD70A0093; Thu, 13 Jan 2022 15:32:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BFD84273A; Thu, 13 Jan 2022 15:32:55 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2084.outbound.protection.outlook.com [40.107.96.84]) by mails.dpdk.org (Postfix) with ESMTP id A8F4A42740; Thu, 13 Jan 2022 15:32:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CeOsAgcFLN9fiLyKbgd7ECW/0fahpqbLq/0XIrJoxl63rqmeFKhXPc3EsE7FM7prcv9XowS4k5HFej9n9gSIqPk4qN+6j1/HwQqIq5bDcFGPfhgCo9KnCQyEPh6vvcrjlMOkfYiO74Ft+22kmTiMc9yyj8f6Mx9Wij13XQaTKrvpD+BN8oXh+Rz1Py1zCVVbftLmelib/4HlwDUL4PXqD3Kjk2mptJUXEgsBV9GeyG//FYtH5rmWvPTVxX50AKaQLOHfX3xLk+ZOg35oc0s3+VsRQSsWPuZOsf+gjuDo08CZc7DAKPMuoP3xIKPsQkVI41lvija9GlFj866c3zyn1A== 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=eHq0mG60qPzIxzOaS8HIDtMlCzRzUR89n6NfgKrACNk=; b=F6bY+JCu4RrwUWm+v5Q6VuEy+cto2wdVqOg7ULHDLHAeyIGFEcIxDTXcwh4uk4Q2UMXn3Gxmg1SccuJaeQ9WHSVQh6zx+OOXjsQSAy3QPvzvqXyei/F5YQIjxf5mEYJ+m23AS9wFiAnsDqzVZ/OU0EoZ7iR7gQDK81YG5SlMquJu7U93vKXLNIeMenYFsyoAsVKo0FPhcjujBB13yQ+ConNgce5GoZXit1NrSFjCrWFBajHg6dFpws2d3KLYfsEu/AuZHOyBJkGn8CfLxoBM9js14m/rTKampyQZ/IHHL9slCmxRDX3bZXIA/FB5NPmvLp3pXfZTCnTE7d2JFyuRGQ== 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=eHq0mG60qPzIxzOaS8HIDtMlCzRzUR89n6NfgKrACNk=; b=CiNFPIA6EcqDX3N85WvtzrPq5YDexnyaRM9kzo/N6CvX3SU5xIUH4jy96iVBhCaM2NIA+68edRymjol1+gK6Ires/JLKo3qsrEpejvg0w22CW6Zqiud1bJXZN9C7ACSvRKk/tOHUVfvgk6RpAWh0ihPcaEnn9n+VGQJ1QDB1ZqGpse1oDagMfM6GWqRvFNeYcKhEMAPv2kl+u5jZLIMIgfa5uP1y8wBExiDnYy7+xgXnAVBNyQx3T4z9w+dY/CfeToxOZ3imbWqq1PStUH9SaZVRrA1fSA+BIkkp27wPQeacnOtEB4YoTgCbZWSIyEhJoKLpwOjLYlt1yT6FqRG3AQ== Received: from DM5PR19CA0020.namprd19.prod.outlook.com (2603:10b6:3:151::30) by MWHPR1201MB2508.namprd12.prod.outlook.com (2603:10b6:300:df::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.10; Thu, 13 Jan 2022 14:32:51 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:3:151:cafe::49) by DM5PR19CA0020.outlook.office365.com (2603:10b6:3:151::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 14:32: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; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 14:32: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.18; Thu, 13 Jan 2022 14:32:50 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Thu, 13 Jan 2022 06:32:48 -0800 From: Alexander Kozyrev To: CC: , , , Subject: [PATCH] net/mlx5: fix maximum packet headers size for TSO Date: Thu, 13 Jan 2022 16:32:29 +0200 Message-ID: <20220113143229.3530296-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6105383b-0460-41c8-b973-08d9d6a19426 X-MS-TrafficTypeDiagnostic: MWHPR1201MB2508:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jP/oJ6ATjlPKOyVWpL2zle5U0Qw2gOW0onjbsaxqKtB/FsAc8wI1Y9RBgjq9yqBO9Q//92vpLieP2llvI12nTFgX8YttT4JPkemDZBm0OJcOTOvlPS2ep42PzcFzYYxOsRrKUZl0oQx6oDAOPit6UyDG4US3x+2AfKBrq5Nmrb25dZdPZkVgT6d5Ty23EMlXW4dnzzTuZd1wxESmTsHgkBcrXJN35RT0iawgobPI4kyzhiHKB31XJxgl6EmcLaG6ukXqV+rLsGNKLWUSV9lf6P//f229LMlDMwSiM3LtHFbHFQuLzTtL6XdMxfuW9OpFRqB3pyqRn/zzb0NlN0aCOjpnEBjIvN+iT1teno+/q8mCHCl7ht2YPvvoldBLGnm4rDw67t5kEHCIpetoxS5mlbvtNTU0tHetuFs1wOqVh+n/EYxFDuykW/Eaf41Ul/qZdDu9ZKxzCd6Z4JKtGbPjim8A4v+DKmL4lgIUMM2dXXCfLfLcTt8m9rSsEOwkQz7JYXjDANIr9trcMHtEvh8r+uKfP0Td5oZHcylwX4OVe8VxWx8bBEy6pttcWCaDKAcYWcB2cqlFITgfn1l/h5grNPkRvgktowRaCxwtF4FTc+xaf1DWySlakhONzMtGpVn+C45BAb0JgKqdf5zv+NweGwKsSclwB/HmYYoAz1qH9IWlDN60ELdanqzWbTmK2LVxdB8M+TGJL0fBdNs4ZZb0ariBDEHDtnerW0J8PeKj4lllHqTBJ7+2LZtzMgkuJt/2ig8W8OTK0FgrGDAp+6yP+rGxKe4+tvLeUMdHTvUGrPk= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(4636009)(40470700002)(36840700001)(46966006)(6916009)(36860700001)(508600001)(70586007)(2906002)(2616005)(8936002)(70206006)(36756003)(16526019)(1076003)(86362001)(107886003)(6286002)(81166007)(4326008)(7696005)(5660300002)(54906003)(336012)(426003)(450100002)(82310400004)(8676002)(6666004)(26005)(83380400001)(186003)(55016003)(316002)(356005)(47076005)(40460700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 14:32:51.2186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6105383b-0460-41c8-b973-08d9d6a19426 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: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2508 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 The maximum packet headers size for TSO is calculated as a sum of Ethernet, VLAN, IPv6 and TCP headers (plus inner headers). The rationale behind choosing IPv6 and TCP is their headers are bigger than IPv4 and UDP respectively, giving us the maximum possible headers size. But it is not true for L3 headers. IPv4 header size (20 bytes) is smaller than IPv6 header size (40 bytes) only in the default case. There are up to 10 optional header fields called Options in case IHL > 5. This means that the maximum size of the IPv4 header is 60 bytes. Choosing the wrong maximum packets headers size causes inability to transmit multi-segment TSO packets with IPv4 Options present. PMD check that it is possible to inline all the packet headers and the packet headers size exceeds the expected maximum size. The maximum packet headers size was set to 192 bytes before, but its value has been reduced during Tx path refactor activity. Restore the proper maximum packet headers size for TSO. Fixes: 50724e1 ("net/mlx5: update Tx definitions") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h index 36b384fa08..2d48fde010 100644 --- a/drivers/net/mlx5/mlx5_defs.h +++ b/drivers/net/mlx5/mlx5_defs.h @@ -50,7 +50,7 @@ #define MLX5_MAX_XSTATS 32 /* Maximum Packet headers size (L2+L3+L4) for TSO. */ -#define MLX5_MAX_TSO_HEADER (128u + 34u) +#define MLX5_MAX_TSO_HEADER 192U /* Inline data size required by NICs. */ #define MLX5_INLINE_HSIZE_NONE 0 -- 2.18.2