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 96511432F3; Fri, 10 Nov 2023 10:50:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7887B40291; Fri, 10 Nov 2023 10:50:18 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2069.outbound.protection.outlook.com [40.107.237.69]) by mails.dpdk.org (Postfix) with ESMTP id C39F440268; Fri, 10 Nov 2023 10:50:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hsaOegk1VmQ4R1xgzoWJpo/MQOxMWMLZjEGq/2KnDUX2D12Hf6XzPLT9l/A4VcWF/dcJTbFMDDZrgalpwz9VnYN9swY/lc4bwhe3teSVy6f8dxOoOAwDa71KjEySaVJVLZJKV/wpkl5Ne7gjH1iskMJ034Jnj/DaMguQt5Us46EHxGDghI95IF0rMQ6amr+N84Qf0ZT6/yEFOR1OQEM6OHZE2JHJZEIdPopq4DPuBoIZjmapWg75L+DM+dOQAw1tmqI0jddmEp9p4hh02KBu9nhEoHFUYGZNnniT3N7dkWVh0XC9X41w2EzRpwsd99dLm9+B8mfUqnU924O75x376g== 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=gbIC/0J8V17YSVs9N7eJdmkn5yriyPJeFBGsf9sG4do=; b=JEZZVq25+ZrZ76aX0LfXLBKzXQHUmFC7iDqLCVx3sAP/FS99G/Y8geAzmwjG5SN6p2uGepNqDmtuz36Mk/b2bhwuA6Dc3EslC1vIJOnyYgqGDyUXuNdf2qmOhkjnuX4lo68YjoqaepUaAjAl5chNa2yfg7HiMlMXiqKFr/VRo5aWLuB4t78OZHL35boBPa+H60CXX8hkGQgCIvhDy8SP6vK/rE/gADjSWgywIun0FIV2tvYxK2/sWDZPWVqNqnCYkB+TuARZC5QsqH/aRMsWom5YB4JnvHudyBWSQCO1i5TmiWXJtDiwBhg+OiefelWokmUa+xvmniH5W61bD98dtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (0) 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=gbIC/0J8V17YSVs9N7eJdmkn5yriyPJeFBGsf9sG4do=; b=YcLdLKNgmOIW5xEd+FcO45JCMWVbsuDaMUC5TAezVL2ud4nL9jKUyuEZvEMAUpBb6wQbJPTsQ6e8CqyuU8oGsk3phyMvx7gUIZZG9ib/EeOKSo5GKnT0nQvzPbGdGngxrwZvfswxOwBH/8iHmwF/9WWXKgwErIphN9Ivm9djD0ai4H6a4tAX+mlEDw245FE8iDdI8o8k5jRh/Tlfm8DBBdFKf2I9wZbs6qSOz0J+qaCCZGO+xk1YoRubqqRGHO2537SMoK8rsHgddlyHnyJhg9G1EJ/lcxrvZ0jR4T+mqr+KU/lvy8wxCB3tzhXv+eM9hDwvcBDyD4emOZw62gz49w== Received: from CH0PR03CA0021.namprd03.prod.outlook.com (2603:10b6:610:b0::26) by CH3PR12MB8511.namprd12.prod.outlook.com (2603:10b6:610:15c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19; Fri, 10 Nov 2023 09:50:15 +0000 Received: from DS2PEPF0000343C.namprd02.prod.outlook.com (2603:10b6:610:b0:cafe::d7) by CH0PR03CA0021.outlook.office365.com (2603:10b6:610:b0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Fri, 10 Nov 2023 09:50:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS2PEPF0000343C.mail.protection.outlook.com (10.167.18.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Fri, 10 Nov 2023 09:50:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 10 Nov 2023 01:50:04 -0800 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.41; Fri, 10 Nov 2023 01:50:02 -0800 From: Viacheslav Ovsiienko To: CC: , , , Subject: [PATCH 1/1] net/mlx5: fix inline data length for multisegment packets Date: Fri, 10 Nov 2023 11:49:38 +0200 Message-ID: <20231110094938.21171-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343C:EE_|CH3PR12MB8511:EE_ X-MS-Office365-Filtering-Correlation-Id: b6d5cb7f-db18-44de-0be2-08dbe1d270f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8pLOtN5t8IrPWjaJLV4jeJQalbSYmkaklZ3Ex3Ff9xnjhKo1X0XdNz+S7ihI7rv9GrLB/y+/nDDwjr87RPOK73Gnvr1L9UbOpRDnEZkEZOsjaukEXS6Dvsa7D3kOWPHDLTAsbZSRpyeA/om5uaNoeYKzdcKdTVpZL/sRzXr9w6R4LJH2MXAT3UUkBx641pMcoCjyLgPN2LZ0POyzlWq/iA/x3IMjQ1LfvXdgR/pHP8sZrKWw/n283c7z5OiaNxBS+RIUMxjchTI9m9+KqxXiskEFtlQwQA73jUlqiyV5acFXWwbg0NudKHe+u0jJ1q64ZJ/5S0IXmNUjiIKGs5RDjgvg3DiVF6YvtuQJneIDZxyu9LZkYWEh5L5anRZpdVKeCwPjiwrYBAYFm0rA187QiBPBDAdPCN7zGf/QbPZa9VvuYFxWGoD98wQkAyZZWOyaEcgNk0Gu5MU9bdmL0bLJgajWt0iC8zQqLrU9Ao6HQNqP5W2oeNekSbUXZ36vMIN/HnMF1NX33fwYqWm0tyFguK0fBi7qEFikIVKSHEG98CJ81EgBkNNzB4M86xgfEoePcS0VbbUItuFfAUdG93g5wNd/48sC9DwqN9WcBXEGocGuBTZAvwGaHys4XmXltTfr2GJ+pJEsER1vqpOOpuscGtP68KvsCdOQgs6+xmd3tPkljIwEqRrSN7XF/QgLkiDtzvF1qgLHS8cy1Go+tB3J00wwZ1pPA/dbVkVGLsRkcRCtDfed8YlPB9Eu7r/6D806 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(39860400002)(346002)(376002)(230922051799003)(451199024)(1800799009)(82310400011)(186009)(64100799003)(40470700004)(46966006)(36840700001)(2906002)(47076005)(36860700001)(40460700003)(82740400003)(7636003)(356005)(478600001)(6916009)(41300700001)(8676002)(450100002)(7696005)(4326008)(54906003)(6666004)(316002)(70586007)(70206006)(8936002)(426003)(336012)(5660300002)(6286002)(26005)(16526019)(2616005)(1076003)(83380400001)(86362001)(36756003)(40480700001)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2023 09:50:15.6115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6d5cb7f-db18-44de-0be2-08dbe1d270f7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8511 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 If packet data length exceeds the configured limit for packet to be inlined in the queue descriptor the driver checks if hardware requires to do minimal data inline or the VLAN insertion offload is requested and not supported in hardware (that means we have to do VLAN insertion in software with inline data). Then driver scans the mbuf chain to find the minimal segment amount to satisfy the data needed for minimal inline. There was incorrect first segment inline data length calculation with missing VLAN header being inserted, that could lead to the segmentation fault in the mbuf chain scanning, for example for the packets: packet: mbuf0 pkt_len = 288, data_len = 156 mbuf1 pkt_len = 132, data_len = 132 txq->inlen_send = 290 The driver was trying to reach the inlen_send inline data length with missing VLAN header length added and was running out of the mbuf chain (there were just not enough data in the packet to satisfy the criteria). Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Fixes: ec837ad0fc7c ("net/mlx5: fix multi-segment inline for the first segments") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Suanming Mou with '#' will be ignored, and an empty message aborts the commit. # # Date: Fri Nov 10 11:12:14 2023 +0200 # # On branch tx_fix_firstseg --- drivers/net/mlx5/mlx5_tx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h index 264cc192dc..e59ce37667 100644 --- a/drivers/net/mlx5/mlx5_tx.h +++ b/drivers/net/mlx5/mlx5_tx.h @@ -2046,7 +2046,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, uintptr_t start; mbuf = loc->mbuf; - nxlen = rte_pktmbuf_data_len(mbuf); + nxlen = rte_pktmbuf_data_len(mbuf) + vlan; /* * Packet length exceeds the allowed inline data length, * check whether the minimal inlining is required. -- 2.18.1