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 D5566A0548 for ; Mon, 16 Aug 2021 18:30:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CEC024115A; Mon, 16 Aug 2021 18:30:23 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by mails.dpdk.org (Postfix) with ESMTP id BBA644115A for ; Mon, 16 Aug 2021 18:30:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M12zAiC3U54olan5Ml6U7M2fRDRorEE5AK3tGg/aiH9HEkNBPd1hKZNQ2lcSgjjOAjyDY90X/nd+Cp2azSvgMqRBbQZkfBNdM8ZyvoccIldGKU7ydpdj3/TgORtTdMAR0PZPa+0OyzOnasLd5McHOu2/XcjnrWw/09p1ejElybPF6kpGngs4IYbKjwuDS7FDWzLX4jqlDktqh0yhPoywPuA48Ln2sLX0uRbek5x+8pI2RAmSYM7p5oq6TQYlFk4PdLsmyjszeJAV7kAO25VT0tFSdVxZQNTOuKcwPSTiU7e8KBgasq/cledXIriJiebV2DcxNi/n1YIPei5pheopMQ== 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=uLRzNj0kn193LoD33XtefUU6yaQqAgTVcJeoPtt01G0=; b=KWyzsDoHFsKr852z6I59D9DkxB4jBzpF1SyJx69MAFwe+N1l5AHfGFbw/M/il5HHbmpKgOC/ix+V7rO/e7TF0taa9jzUBEJOIkN5KnbFIXq47TE2ahwVOwqpXa1xlx/HCNhngg2YWIck/VFlQa7pSbVE6si0hnlB2nzwMawMfZpEDD37qu5DqP+n+dNbZpbS3RjxDrANqr2aXyjEjLqll6ArnUX00aenTg8tGXTWiAWZ/xGI7kLBg9tA246UrhUcaQjJCLYqDpkSaleb7nZnKysq420nhwkt7wSZ0F9l3I7e2/qlvlCG2XUoAjTZoTo/EfhEAi2mV+NIlFdak7LWsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine 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=uLRzNj0kn193LoD33XtefUU6yaQqAgTVcJeoPtt01G0=; b=rM3fGbsufQCh6iIqdv8/IQ3idM4eIevcSgBJj0kob7+OaCfYNKhcakmwytY6AxTPXYayBPiKIlJX+wYKfio7wRpTPJXXuhLpHVkVJ2ipqHKsvLI5Ockx2PXQiG03MgnMfSTSBqtM6MsmYUvwsB7n5l/33tyAQFjvBDph4WJyREAa/dDFZkVgrOvhv/NeznAMBSPWazhBsQ53mUUuDy0FOdM/W5GHqjWTsK1gfPGuTCKIg5kGKv0WXlYKUgD+DSdzNZL4wSr1KGPHibw8zLVpvCUoRDF2fb1++AilqnsGDBcJeYHp/yIHoMDHNGqUTwasCC5h6YZ4txaos6diL07sug== Received: from BN6PR1101CA0002.namprd11.prod.outlook.com (2603:10b6:405:4a::12) by MWHPR1201MB2557.namprd12.prod.outlook.com (2603:10b6:300:e4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.19; Mon, 16 Aug 2021 16:30:21 +0000 Received: from BN8NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::f9) by BN6PR1101CA0002.outlook.office365.com (2603:10b6:405:4a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Mon, 16 Aug 2021 16:30:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT003.mail.protection.outlook.com (10.13.177.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.14 via Frontend Transport; Mon, 16 Aug 2021 16:30:20 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Aug 2021 09:30:19 -0700 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Aug 2021 16:30:18 +0000 From: Bing Zhao To: , CC: , Date: Mon, 16 Aug 2021 19:29:52 +0300 Message-ID: <20210816162952.1931473-7-bingz@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210816162952.1931473-1-bingz@nvidia.com> References: <20210816162952.1931473-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40d88ec2-af54-4ccb-3c8c-08d960d323e9 X-MS-TrafficTypeDiagnostic: MWHPR1201MB2557: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nxI1SYm2hRcA0Q/WdkRv2xd3zQMeE4/ufAvpf0Idp6IAN2Nt5vSVtCFbp3ckeZW7hs6qHbq9CVrLHebSjXwUnW7Ueqmq4LELD+5bQYoSG5uy0tTCras8p68zu/a54lYkM3rqlzcC+n9LxQwWgkc397FoV7iY9l4Krp1T6XNPCk4YdnhWi91wxZgGhq7xegsM3JHRl+OeO/IZCC9ByDFBp1k2yAC2AwfmR2YZNve1DD09EqIwP7YSQ9/Tj4ReIZVb8ZyFr9jb7uI24iR8m/wEsUGcTyYE2ivQFQdziYLGls/FdnFAF6zEmsTdE9hF8PavT6RRoWK7jdkQW+pJYPaOthYY8RMRdbRNGoxgjMyBCtlxPd8fNf+ehbYcZ9UL3sb2gSslWZiiu+j8c9H93cE/qNKKKduBYsKTnYaGz6YkTGKRu12KIbrGD89J50n6PSejieBPZPORrWLNO3ErOWM1rKG3d1xofy2uddYb1OENZifVckaKJHj4fmb9Ie7YKY0Rekn31AbqTuah9lqv8zZ4NIyFJPbEEtzY61sjI7qxp4Le9XUpeTgWNvZITpo4g7sISuVuKuRHHFgJAgRiYf8S0SA8+nFEPmxLO7iTPb/rE45LRmoG/RRqwxErFsS6dCLC+q85XfDRi5iqLyCwOGsCQcFP4IU8oeF4D3qIyD8a+4qHRWl46zL2yOSOMU8x8gzw+hbnxiqa0QmsYrIvgN9Jgw== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(136003)(346002)(376002)(39860400002)(46966006)(36840700001)(1076003)(86362001)(8676002)(36860700001)(8936002)(316002)(110136005)(426003)(336012)(2906002)(82740400003)(54906003)(82310400003)(107886003)(47076005)(4326008)(7696005)(26005)(70586007)(83380400001)(7636003)(2616005)(70206006)(55016002)(16526019)(5660300002)(186003)(6666004)(356005)(36756003)(6286002)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2021 16:30:20.4760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40d88ec2-af54-4ccb-3c8c-08d960d323e9 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.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2557 Subject: [dpdk-stable] [PATCH 19.11 6/6] 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") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Signed-off-by: Bing Zhao --- drivers/net/mlx5/mlx5_rxtx.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 73dbf68d2b..094e359e55 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -3336,6 +3336,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *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 @@ -3345,27 +3347,23 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *restrict txq, assert(txq->inlen_mode >= MLX5_ESEG_MIN_INLINE_SIZE); assert(txq->inlen_mode <= txq->inlen_send); inlen = txq->inlen_mode; - } 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. - */ - return mlx5_tx_packet_multi_send - (txq, loc, olx); - } + } else if (vlan && !txq->vlan_en) { + /* + * VLAN insertion is requested and hardware does not + * support the offload, will do with software inline. + */ 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) { @@ -3387,6 +3385,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *restrict txq, goto do_align; } } +do_first: do { inlen = nxlen; mbuf = NEXT(mbuf); -- 2.21.0