From patchwork Thu Jul 23 14:21:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Etelson X-Patchwork-Id: 74686 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D88AA0521; Thu, 23 Jul 2020 16:21:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7E27199BC; Thu, 23 Jul 2020 16:21:20 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60041.outbound.protection.outlook.com [40.107.6.41]) by dpdk.org (Postfix) with ESMTP id 06ACB2C6E for ; Thu, 23 Jul 2020 16:21:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCkDfVu1AOCFXJv5rUKBp+9OcBDPuO+WRQOgdHDBVKSaQZJSy/gqr732htanreYmzMOgEanv2itbpAVllNZ5pLRC3kSJuHY8XV9jtkW/O0VqvBj3LLwH4UxWlyiO49o3dzqC9TjDiKsarl26DLBFo3v4Awdly49ArGiXKcckcBMe7AGOaB6dinhEQ7KUWaZonf3qag7Ed0qLX2TXus5UZ3IW/wBf2Z1t2PPVnrJncbXa+MmUhImhQn5GA3YT0FW8et2RSkOzOlm9hnBfLmVbIKnCnln8FEVXUW0tYXxdc2k+pqc+i4Hbxi0vm7/qISpycqSBKweZoMPmBvLMPTgTTg== 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=pQ76LLaZqz1M4XvJaDUoYv8g8PYSZCqstoaLaxXCRzQ=; b=jnVDeZv92H5u2d1VCaKcpBcVNwnibMtTUIc6Zugwk39/Q0VWFBu+Qt6WNoZ+8HxnKLOxUjl4xS1Q4saZbJ57TlHbZnd9Kl548TuwYbfxo588+7KHWd3xljN0qkAqkGSg9/vCF2dPf7ZgTfEAokJyoTheRrA/PHROhXNPVjVtVv2JfGXAr1tOpiU6UCaBASMVeUlqAYKPFGPaubOGd7uYbenNgTmczZLIxrCRPU6wrw4aPfpfe+uwQx3o3h2TtUe2qEkuU0IMAH5tqJCWH+v8U8ndA2nBK69x9pK45UczOZbxkD18LOTbwS9iTG79J4jaN/+JVharhvb+PiLRUFSB9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pQ76LLaZqz1M4XvJaDUoYv8g8PYSZCqstoaLaxXCRzQ=; b=QTtWiAiY0mKflKjLDskWC52hdRX0NHWBg1ZQjyA5tfX1LBT0NXeHJ9jjm+fO5dg1wQdq0sc5BQnvzZZFcH9o2xh5uYx0SQ8hbck75UA1Z0pqnMyr+ndfCSujHWV8I2Sxdr3QoThEWUho2oa8Y3SKk3Ap4dP3QqvPl9ppVuRhG2Y= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from DB8PR05MB6761.eurprd05.prod.outlook.com (2603:10a6:10:139::21) by DB7PR05MB5001.eurprd05.prod.outlook.com (2603:10a6:10:22::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.24; Thu, 23 Jul 2020 14:21:18 +0000 Received: from DB8PR05MB6761.eurprd05.prod.outlook.com ([fe80::5895:a00:3355:eb9f]) by DB8PR05MB6761.eurprd05.prod.outlook.com ([fe80::5895:a00:3355:eb9f%7]) with mapi id 15.20.3216.024; Thu, 23 Jul 2020 14:21:18 +0000 From: Gregory Etelson To: dev@dpdk.org Cc: getelson@mellanox.com, matan@mellanox.com, rasland@mellanox.com, Viacheslav Ovsiienko , Shahaf Shuler Date: Thu, 23 Jul 2020 17:21:04 +0300 Message-Id: <20200723142106.2391-1-getelson@mellanox.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AM4PR07CA0020.eurprd07.prod.outlook.com (2603:10a6:205:1::33) To DB8PR05MB6761.eurprd05.prod.outlook.com (2603:10a6:10:139::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (176.230.224.223) by AM4PR07CA0020.eurprd07.prod.outlook.com (2603:10a6:205:1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.9 via Frontend Transport; Thu, 23 Jul 2020 14:21:17 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [176.230.224.223] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bf926495-a3fe-4d49-ced4-08d82f13aa84 X-MS-TrafficTypeDiagnostic: DB7PR05MB5001: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1nDPgcfBdf9mG1f1IB8wPQCvYAh7hQitzUtWn2NkmVuD21HNbF6k72CJ9/e2t8G1ZIH2ujfb7SxWO2EcihlxTp4nlgYr+QKiB7/8W0+jcrE4Xu3PbECxAaJ/4p2JKCrkjNkIQrdr6+TU+caO5ty51QW8/29X5Isj+6k6AB/x/qTxKZRAevC+y0TTMiEj+E+hx8+lqhFbGojU/jWEyo9+AOy+MvV4xSzR7o8PyqV+/i+3uq/jlgbDRnay6qpHOdKqJBEO8W2jJcDgEvoKkfoa/bw4jGX4JnFHI+VNajkJIfWZHjOA1AtSP5GzVr4alT/45JlZbG8kv+nJzdJ4CPqm8w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR05MB6761.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(366004)(39860400002)(136003)(396003)(83380400001)(86362001)(5660300002)(186003)(8886007)(26005)(4326008)(107886003)(2906002)(36756003)(54906003)(66946007)(66476007)(66556008)(316002)(8936002)(7696005)(52116002)(6916009)(478600001)(1076003)(16526019)(2616005)(6666004)(956004)(55016002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: w+j//xDWN9GVnPZZ+phGr+VNbCS4s540NhqoAbsljBCQkSb30nGqWQUP9uHbwICTqLz3IE0PMljWq2aEorrac+b/BqVsV1/q5igbc4qmQaMZeeEbhWCWASVZxTUDhiCKSEOmTz/cZqKCsUGVE8ySg7cMuzVI3Q3bVR4SoX8JLhMe4lTEI+cIq2N2uSFIKfz3By0iUqAWeRno4/orLVw5oVmldXMME1UD5dDCvtsqeY8gy9wE4WTZna7vJPEzzY776CKCU2AKGsd2XxWIVDQRL3bC0FBsj1bnU4Se9bI02DwZBXoOM7zFTprja3bmWLlXdixCtAVQACiGLOq7Y36nLGGITQaiRwpmGj1t/amN7bnUBJmt4LRNK5bz1dj3mit5MnycBf5uv8cQSmSGsyIJSFbqRoGmDkBVsSPo8aQQjWdQ7hIgrFjjBdb1hZp/soJ9HwiG9o8TGuAbsHv86V4UdrPmtzxzWB+zttNc0JhdTSuzF2TeKSIg/Uu3nmdRa0wu X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf926495-a3fe-4d49-ced4-08d82f13aa84 X-MS-Exchange-CrossTenant-AuthSource: DB8PR05MB6761.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2020 14:21:18.6307 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CM7aqquj/trFSznPcbEc94H9HVfPFbAdxrxY1FpMqP/N9QM0XdeBw/h7Xs8dxVKHWaI+/KyzIqYegYn+FE43qA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5001 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix dynamic inline hint handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" The ConnectX NICs can transfer data from the host memory with two approaches: provide the pointer to the data buffer, or do data inline - copy the data to the transmit descriptor (WQE) entirely or only the part of data. In some configurations the NIC hardware requires the minimal data to be inline in the descriptor to operate correctly. And there is the special dynamic flag to hint PMD not to inline the data (for example, if buffer is located on some other device - storage or GPU) on per packet basis. If there was a packet with length shorter than the minimal inline data length requested by the NIC hardware and the no-inline hint was set the PMD tried to inline the packet with minimal required length instead of actual packet's one. This patch adds the missed length check into no-inline hint handling branch. Fixes: cacb44a09962 ("net/mlx5: add no-inline Tx flag") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 3eb0243603..1b71e94221 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -4739,6 +4739,8 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, txq->inlen_mode) || (MLX5_TXOFF_CONFIG(MPW) && txq->inlen_mode)) { + if (inlen <= txq->inlen_send) + goto single_inline; /* * The hardware requires the * minimal inline data header. @@ -4755,6 +4757,7 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, } goto single_no_inline; } +single_inline: /* * Completely inlined packet data WQE: * - Control Segment, SEND opcode