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 4AFFCA0548 for ; Tue, 17 Aug 2021 15:54:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23D494014E; Tue, 17 Aug 2021 15:54:41 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by mails.dpdk.org (Postfix) with ESMTP id 7A31C4014E for ; Tue, 17 Aug 2021 15:54:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lKWH555Xx98W5we8DYAbMI9H9wHGZ58dpO4tIBA4Z1tXN2oO3wbejiNDbeMRLOpD6MwjtUNdmxNOmKfPl/1lEn17ndz3FX2QG18WcKAIW3mGD5A3w+Jva6KtXjQwfVAchDxG/10dtq1SALzhk9f6gzQ62geEYF0WXvriOmJ+GVZyQZ4lxVIjPmhcir9pXIS53/r+qXQZ3wkPtzWNzA52RenFScsu3dL5u0EfVyPBLVCku5z4YZH+ZEARli984bryAXhuZ+uz0pWioJF3SDnemZYbQXpZOwyEPYv/lQt4O2D7HDSxo0uj3dFFvwfY/PKPUiM+tQUkfnu4h86ySrWBzQ== 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=9lGOCqvRUjtLeSjBSBWRpn9c/b7Z/9ONktmqsghtKrE=; b=Nl+rSNOQ4Cmpu+MhXznIDOxnB1KKpsaGMX/zA0MqrwllCKNBClHhXu7jO9Wat0/8wN44qAjcDaTEoi1nxZQuspEEQrRKEcodB1f/niPes+TdYZ5LQIeRnTThkztq9KKXKPKbe+MCXxE+I22tqu3d8r3ye1gQVu6IvH7UudOLOz4E93qFAqoImGJqCVLRyfTslh/pV/S0SsRMPrR5ozL8f18CI/IW8hmEXjhs67AW+l1pc/Jw2+ILq+kvxRdXpGYeJojl2aQiL7EGi+1cxbe4O58gPPjnW2rmgJGHZG/tJZbeYNT0vY1lR/AEadrCfen8kLkiCwJKNRRhIrYrVTGNkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) 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=9lGOCqvRUjtLeSjBSBWRpn9c/b7Z/9ONktmqsghtKrE=; b=tZB7g4JCh9CyM7WnRg11b8dW5cnOz4yEMlAQasvvErVm72igLeoi/ECAqmUxeDmvDKTWclgLYjH9bihH5pAReFRN0QVTspp7G6ShXap3j4Vwp7E33ZeNB5XFCDWhLecfxRA9gBjL4Y1v6KH1sMvbF4PIpvjvg1YjzZOlbuojYMxwHgfRd3HxSos4Fehy9Z6Up00YvdWQT15vtUU1EjPyTpRmrHdCdSdiPGjyNqU3kkmAvfJHXfWmHNTDzePLamOqsOn6hIn9Krmv6j3Xian+NnBA+CQNBzis7Y/c+j1s5Y/myHSr1mq96ZYwf/sqeAt+U/ijazA0WodFlYK3zLZ4uA== Received: from DM5PR07CA0164.namprd07.prod.outlook.com (2603:10b6:3:ee::30) by DM6PR12MB4138.namprd12.prod.outlook.com (2603:10b6:5:220::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.22; Tue, 17 Aug 2021 13:54:38 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ee:cafe::e6) by DM5PR07CA0164.outlook.office365.com (2603:10b6:3:ee::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Tue, 17 Aug 2021 13:54:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) 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.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.14 via Frontend Transport; Tue, 17 Aug 2021 13:54:38 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Aug 2021 13:54:37 +0000 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; Tue, 17 Aug 2021 13:54:35 +0000 From: Bing Zhao To: , CC: , Date: Tue, 17 Aug 2021 16:54:21 +0300 Message-ID: <20210817135421.1967100-1-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: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3209d7d-8812-44cb-0753-08d961868dd2 X-MS-TrafficTypeDiagnostic: DM6PR12MB4138: 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: lyWZoqBmIdbKwhvynrGTgGh5nqNS/a5l2hJZzSRDEWgkMAGEktEkKn0zyuxEEt6V81cgjDBLWlTNnUD81a8hBEVC7mYQkHzHOLKKRQ+itZXEX/LSScuuq7OnjYBd9VUTAv/3Cef0LwUkoj2np1T5cTrZy3eF4574DfnIIHVu5I51aw6CHkekqWOqtory82P00a5fqiNJ48bUiIWZpALO9fm4NzvlTTdJVpzUez5wAHo78IdEtywZ3yVDUQTqlWqrJApIVsV41EaM81tSKnOaS1UZKw1PV3pOsgWyqMIQhxlvcdLbF1wKa5yq0DFEXDKLcfUDI12MAiG1k4e2Oj/ySMlI1bpyIH5zfLa8i2xw3/Zs/73IKdrNWmgWdNdLNFjfKemX0Bi/21eVJDefcqOxg0up3PbkmWgPllvSmrOJNmVoe3c+XtsAPFLJL2Wk9PEs22BlY4eyxZ45zIcPHm2/lehHO2wWy+yEJIAAljZj2ledN0o0fNoQCUeLpbag9z6tcbMv05wKgtbnd8wHfglqxQzM1sH9NRVvvu6Z3Lni4JduqoKuA3mMYNafk4m5CKxGhFK0AWhSPdqmvgCawSLxIbnqOV8IaMS03+kIvcVndabn9t8MXPVmc6iWGJ6ep/xK2IosMb6w+VRw04zXQJZejM/oWaADB1f9ZWFMK+ZfL06BLp9dxrX0CNHa3xL7yqJyxnLbB/tw4ZczeM7YkhaNsA== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(39860400002)(136003)(396003)(346002)(46966006)(36840700001)(316002)(47076005)(86362001)(8676002)(54906003)(336012)(110136005)(4326008)(83380400001)(426003)(70206006)(70586007)(8936002)(6666004)(478600001)(7636003)(16526019)(1076003)(2906002)(26005)(55016002)(82310400003)(356005)(2616005)(186003)(36756003)(6286002)(5660300002)(36860700001)(107886003)(7696005)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2021 13:54:38.1360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3209d7d-8812-44cb-0753-08d961868dd2 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4138 Subject: [dpdk-stable] [PATCH 19.11 v2] 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 | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 73dbf68d2b..8a6162ebd6 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,22 @@ 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 (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 +3384,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *restrict txq, goto do_align; } } +do_first: do { inlen = nxlen; mbuf = NEXT(mbuf); -- 2.25.1