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 A7E78A0C5B; Fri, 19 Nov 2021 19:11:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B66740143; Fri, 19 Nov 2021 19:11:38 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2064.outbound.protection.outlook.com [40.107.237.64]) by mails.dpdk.org (Postfix) with ESMTP id 256EC40140; Fri, 19 Nov 2021 19:11:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QLMp1zCIorfvh7m50l1Re36T0Ndjn21iU7/DOxfekpq+7YT4zSjlfBagqeGtD7Xs26GCyVj9n/KuEf8YCvFS0ndTo4SnBW4Xp3L925tqS3hZUReYjD4P/wg3qBHBhnDtpiaUIfLlEnO3DuJOJYB8G2IogeTpkzjuZez11u+mm6B/vERPa49t+C2jn/x9sICgh0fwuYt57YRnOgx9PleF0ktXrkCIPgK/In3F/Z+lkJwdc+oD+f05U4kj/ZKQw7tgI2SP6i3iulig5Q4gxhjY2NOz/BK5tTD+CnDSQyR84/pimpF2kJudZ6wzfATPzfmcP9y1CAP4sq3qWbMAQikk3g== 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=AM2iPoqDEokINlBFvS026cUqZLwo6EALu8ghTnjeAz4=; b=b5aj+wcZ7TPNTT1UakLPj47KGHC/8RwjQv47ls+IIQNXhIPxWMPIALoYw9gfpVnBrMrW11+QGbZJGQDcrXpU5SrjY5pqDSjMF/hxbSETQ/73J/oYTTpYdaMKZZcyc38rUFb9L7+ovs6PfD02EfhuRdOsO0x1kr+yyrC/IvwXEavYOxPTq3RS3U9wxu2EF88R0JnMnDY+Fr3gNwbcOj0TkFfp8b19wbN74E0TnUFzJ1dqqMMc3w9YaotVJbF/NPqiQbrTc169voZ5TAcxWC08vBM1q4264VjbiIBUdO53w5MRWL6/zb0iFaY21cIAMEOq1eAPPK+5BTTzdlWf/B637w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=AM2iPoqDEokINlBFvS026cUqZLwo6EALu8ghTnjeAz4=; b=S77ubNzL6sgqIbTooMmExKGfxltt4/gZCYZX5D3xc6faMcwOvmaVQxR5HOLhCjzvoa/jQDvqGi5s44pIBCJs3VMlylHnN2fyU/lSyoxH+2KVzAC4Uf2ovtHmlgqTLd+EarTwsCjfvavbkaRfm7WC6Eln4gE9Tuttc5AIFgBoz88qst0DUvN+y6mPbEiNTd2QMis214u7PcjpcvNgH90Nwbs5u2BMNpUTqEbJRDShRnVP3ZwPqdnQG/BErw/lmIRJb2kWZn1JJgSO3res6PG6omtMKi/oZ7hGglTTvETtlzyePbbs3dJRHv7qQyKECnNPqV1uXR0O9W49xxyZxoyyRQ== Received: from CO2PR04CA0138.namprd04.prod.outlook.com (2603:10b6:104::16) by MN2PR12MB4318.namprd12.prod.outlook.com (2603:10b6:208:1d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21; Fri, 19 Nov 2021 18:11:35 +0000 Received: from CO1NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:104:0:cafe::66) by CO2PR04CA0138.outlook.office365.com (2603:10b6:104::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Fri, 19 Nov 2021 18:11:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.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 CO1NAM11FT060.mail.protection.outlook.com (10.13.175.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Fri, 19 Nov 2021 18:11:34 +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.18; Fri, 19 Nov 2021 18:11:33 +0000 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko CC: , Subject: [PATCH] net/mlx5: fix multi segment packet wraparound Date: Fri, 19 Nov 2021 20:11:09 +0200 Message-ID: <20211119181110.232000-1-dsosnowski@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: a6d178aa-ce52-475e-1354-08d9ab88059f X-MS-TrafficTypeDiagnostic: MN2PR12MB4318: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V2xZpJ6Ql7slW9kDbNt6SxBU1NpejAtyIhU9PKdjsPcZ5pMseRdRR9ehGXX+j6KimqFrsxEVyPKQOHrm40XjjYhKM7e8zn6mJQgYVOpu8tfuNQc7bJQrjbIg6/c3n8awL5cU8vy+qIiZzjfzw/xMQDeejDRTXjxiHgmTntFkSE9++iH3312ZfUQFZ/mdPtf2l1GaRni/Q6gb4RgSRcRZDdpw3HSC/yilE8LkwahAu5Y4mLURemx2XsMop0f2Booj2RmgzYT35jybfAejb086U5B/t5OFG9nmbmi3E72SVDvr5jfYPbwYExwcoeHTbuhGJxscwGZwAuj0xHWUJrAGKc3VocVTNpyASyqCwm7OPZNgeL7xwaDuvPCVsOKigwnPDCLzj0/0ONLgcShW+cG395RnGqdSRrGCJfhQbvepW9zj7WW2/F+qtW4/zstRpoB+x1D56xUztJgkAVshRR64QHUVY4QPW+d5wdg5pY6U+dOh1uFNdUL/67/QbGCdVt8x9Jo2jQsvpIVVWXi++9NiDUcirpJPPKlZWPLcSH6VP0uPBMzOVhmqf5JW2m1WsJRtaXU0hFB7iXHrb1S8J7AisWPRLDJpcEPBvOX2KgulnBWeln8TizyeCA4dzTLLvXUPXDHgC+O80DGSrUVTCUgj9miBL8E73pJTkmRs/WTIgbnpUnWsmtFO3b8t4zhYc2HEgZ29J/axK0MKez2wo7LuYg== 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)(36840700001)(46966006)(86362001)(36756003)(6286002)(8676002)(55016002)(2616005)(8936002)(356005)(26005)(83380400001)(2906002)(508600001)(316002)(47076005)(54906003)(110136005)(7696005)(7636003)(426003)(5660300002)(1076003)(6636002)(4326008)(82310400003)(336012)(186003)(16526019)(6666004)(450100002)(70206006)(70586007)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 18:11:34.6769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6d178aa-ce52-475e-1354-08d9ab88059f 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: CO1NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4318 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 This patch fixes the assertion failure triggered when the user configured minimum inline length requirements and the application transmitted multi segment packets. Failure was triggered when space left in TX queue was not enough to cover this requirement. This patch limits the length of data to be copied to the available space in TX queue. Fixes: cacb44a09962 ("net/mlx5: add no-inline Tx flag") Cc: viacheslavo@nvidia.com Cc: stable@dpdk.org Signed-off-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_tx.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h index bc629983fa..f3727351ca 100644 --- a/drivers/net/mlx5/mlx5_tx.h +++ b/drivers/net/mlx5/mlx5_tx.h @@ -1222,6 +1222,11 @@ mlx5_tx_eseg_mdat(struct mlx5_txq_data *__rte_restrict txq, */ copy = tso ? inlen : txq->inlen_mode; copy = tlen >= copy ? 0 : (copy - tlen); + /* + * Limit amount of data to be copied to the length of available + * WQE ring buffer space or packet data left to be copied. + */ + copy = RTE_MIN(part, copy); copy = mlx5_tx_mseg_memcpy(pdst, loc, part, copy, olx); tlen += copy; if (likely(inlen <= tlen) || copy < part) { -- 2.25.1