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 B55CFA0C4C for ; Mon, 12 Jul 2021 13:42:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A727C40685; Mon, 12 Jul 2021 13:42:12 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 48D8440685 for ; Mon, 12 Jul 2021 13:42:11 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.12; Mon, 12 Jul 2021 04:42:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mV3b4XObxQdMtYxZqrA9E/dFpQARDeQxrtyqYysDB7q+JRJ0fkZOr2lXJRGASXI3P9TT/DW6FdEAws1e5RDH4r4aZmwy++o8O0g1O62mPjPaQX9FdCkVhzJfwlQgH9jrngMN3zmJ7/X6AV9O1vS/3j1MayLWt9timCng06g7v892Cf1gVPNswHHL4BYid6QCzFZp6f8rmMyJfHk+lEIYSc6OJTXJ7gYFfhbZsrWLaE+/ulFeXgIPJxmbftBMpKL/SooqS9jcFOtkYBcfSq/SbJa0a/2M7MF7W0CYPU9/8fENoZ4czd91RaHX5H2/n6+rjrrEMeDvrq3dq5MJ62/ErQ== 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=0j8JP5vq9+SkiUgSqwMGngD2znrxinE8eM3/0MPIsWk=; b=WHk1ht/gABr40kI+HU6CirOs69GQzweUY3ZXrF7QfXoPHHRgz2a2aLnLMsZzSB9ORdsnGkMZiQoFAXllWLp8DRmqDnXMsYnsP7KEOXwXUPw4p9njOgkHt/PFMceQsORBto0buTSPs5JqJkDWnpT6h4thF8HBBeZUbC+OU+QmXkr8nVEOEPBQQ5xrH8QLKQ/XmIfxn3bDwJEBBTDCiXcCQ10jHgx5lSTWQGEj57hjH+zFizc8mPBXMrvC/gCvKuitQqPv4f8b2yL46pPdG7XwlA9qIIUTqfAqjDIRx/moDSV/KlzWi+Yq6UboH2hmcT4ke75kqqh7CLOhiOvnXauFgA== 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=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=0j8JP5vq9+SkiUgSqwMGngD2znrxinE8eM3/0MPIsWk=; b=ZKEje8vv//d4XKizlXhd4e9/kTode/suQ+fsiFgOCH6P0TQk9nIA7J81R+kfglFOwCZO5LdnjkqZVJO8EQ2z5TNvXn7u+Eoxslj0Z0NnQBSMe7pZ+b/ktb77ppfoekCUP/vdyQ9crs7NFvpWpPHBGRdxMjyQMf79GbmEBy4sUKLVHq7ikwDxgbv3l8FtBdwhjNp8m9SeSxq895lqpTGJ3CCRAreIOqkW3bB3bRD2VZLm2k97uPD7crfc1mrHgVCf0Iro2ijlT+zdy3coadGBEscE3P7ftQ33MtP75HOfe8G8YWgp2lTOnHa0bzWWLyC8fOb7cX/BhdDRZ620bM9DiQ== Received: from BN6PR13CA0014.namprd13.prod.outlook.com (2603:10b6:404:10a::24) by CY4PR12MB1174.namprd12.prod.outlook.com (2603:10b6:903:36::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.25; Mon, 12 Jul 2021 11:42:09 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:404:10a:cafe::a3) by BN6PR13CA0014.outlook.office365.com (2603:10b6:404:10a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.12 via Frontend Transport; Mon, 12 Jul 2021 11:42:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 11:42:08 +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; Mon, 12 Jul 2021 11:42:06 +0000 From: Ali Alnubani To: CC: Viacheslav Ovsiienko Date: Mon, 12 Jul 2021 14:41:35 +0300 Message-ID: <20210712114135.424311-2-alialnu@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712114135.424311-1-alialnu@nvidia.com> References: <20210712114135.424311-1-alialnu@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3b51968-17db-43fb-f609-08d9452a14db X-MS-TrafficTypeDiagnostic: CY4PR12MB1174: 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: pv9xgHm4m1+LzJocmdoHs5aDoY0I5NshdMwy5pkTzoKWbf5L2pP9Omq+ROuB9Y9Mu2u6C9CMHIOB3vSeqJCpqpl8hE/GXpGW7j/LzbYlzv7TDOmpJVXZoZ/GGZWRcZlaDv1v6TfUqhPlXpIVmIabev8I5tYTW2MiR9VgBjjfvTB6j246fIhKN7GNyWJxN2XkSkkBrvfeZzMli9uHFCqeT1YuIVDT7gJkNTDgBvSvqr8HnvNW9OCY+oaFRb+TFn5pd/J3hAjlSKiOp3dI4yvBoAVjYknA4qGBLx0AwGt+bW4b/Kp6F761DIozQtneuFRsCH58vsN/Uh+KgkP+8U1AnL1BA0EU9SXGkW6mrxCH0AOWvafuHx5t++zy+QB2pJ7t8zcwmNXBISIa6Hz6/op/YB7wDBSDNrY2VxtX6LvK9AGx8RdhRVAdzI4+RmmFyPSeWagbRx8o7t0wqIzby0N6WYNKpYonHO3kMuLAqv8z8MyLbpTCa0CVIUOtA4a2xEJaAX3X29aCrF3foaz00vhzgkZkm27QJ2c1CgUrP9KsWFp32APWLY5ubjwzvaFHRJSiJxTYRPKvhv43AscPduTxmWMa0rS+IrXowv+bNK4IHSMpR7k+tZhU/4ZQmmi3SiMgb5YXq1L0xuYeFb8IV9IzJqOb9PXEW0dnFsCsflPSUTFu7tRRIuJOVOjprcPrFn3X3GMvHKBkAalwcy/dekeHHZ4yAWRDuK4T68mhs0vATSw= 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)(136003)(39860400002)(396003)(376002)(346002)(46966006)(36840700001)(1076003)(7696005)(356005)(47076005)(6286002)(316002)(7636003)(36756003)(34020700004)(86362001)(82310400003)(6916009)(4326008)(26005)(107886003)(36906005)(83380400001)(8676002)(16526019)(70206006)(6666004)(2906002)(186003)(82740400003)(36860700001)(426003)(55016002)(70586007)(2616005)(478600001)(336012)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 11:42:08.8719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3b51968-17db-43fb-f609-08d9452a14db 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: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1174 Subject: [dpdk-stable] [PATCH 20.11 2/2] net/mlx5: fix multi-segment inline for the first segments X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Viacheslav Ovsiienko [ upstream commit ec837ad0fc7c6df4912cc2706b9cd54b225f4a34 ] Before 19.08 release the Tx burst routines of mlx5 PMD provided data inline for the first short segments of the multi-segment packets. In the release 19.08 mlx5 Tx datapath was refactored and this behavior was broken, affecting the performance. For example, the T-Rex traffic generator might use small leading segments to handle packet headers and performance degradation was noticed. If the first segments of the multi-segment packet are short and the overall length is below the inline threshold it should be inline into the WQE to fix the performance. Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Signed-off-by: Viacheslav Ovsiienko Signed-off-by: Ali Alnubani --- drivers/net/mlx5/mlx5_rxtx.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 752357e342..d562afde1f 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -3457,6 +3457,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, unsigned int nxlen; uintptr_t start; + mbuf = loc->mbuf; + nxlen = rte_pktmbuf_data_len(mbuf); /* * Packet length exceeds the allowed inline * data length, check whether the minimal @@ -3467,28 +3469,23 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, MLX5_ESEG_MIN_INLINE_SIZE); MLX5_ASSERT(txq->inlen_mode <= txq->inlen_send); inlen = txq->inlen_mode; - } else { - if (loc->mbuf->ol_flags & PKT_TX_DYNF_NOINLINE || - !vlan || txq->vlan_en) { + } else if (vlan && !txq->vlan_en) { /* - * VLAN insertion will be done inside by HW. - * It is not utmost effective - VLAN flag is - * checked twice, but we should proceed the - * inlining length correctly and take into - * account the VLAN header being inserted. + * VLAN insertion is requested and hardware does not + * support the offload, will do with software inline. */ - return mlx5_tx_packet_multi_send - (txq, loc, olx); - } inlen = MLX5_ESEG_MIN_INLINE_SIZE; + } else if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE || + nxlen > txq->inlen_send) { + return mlx5_tx_packet_multi_send(txq, loc, olx); + } else { + goto do_first; } /* * Now we know the minimal amount of data is requested * to inline. Check whether we should inline the buffers * from the chain beginning to eliminate some mbufs. */ - mbuf = loc->mbuf; - nxlen = rte_pktmbuf_data_len(mbuf); if (unlikely(nxlen <= txq->inlen_send)) { /* We can inline first mbuf at least. */ if (nxlen < inlen) { @@ -3510,6 +3507,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, goto do_align; } } +do_first: do { inlen = nxlen; mbuf = NEXT(mbuf); -- 2.25.1