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 81FC0A0548; Wed, 15 Jun 2022 15:09:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B740C42B71; Wed, 15 Jun 2022 15:09:07 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2052.outbound.protection.outlook.com [40.107.212.52]) by mails.dpdk.org (Postfix) with ESMTP id 3AB1441148 for ; Wed, 15 Jun 2022 15:09:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMhYQv1/F/9GJGeNVrozlDl661QGzK0t+CcbwOx3BkfcBJgkHVT40pPw84c7Q7iqS4uBM6AWSIhv9YzeqLGhPTttTbvBVmnt/CfCbxQvs4UXYHXTSpvLTF/hlf8mK6AvfxbMXOE62dmYURYjMYnN89r0oQ8H48pz8biQLcTMbpOH3MtbWTh1adLyvUSC+cEW0g8wzOtiblu9HiWkXddfj2qHexmZqivCdV88s8Bzdfd1Wn928OjM7y99xu6BVzZqMEKvqY8+SW+lRGz72KQcBymxRQY6vRrL4mjYjfoxK4UGC4ninFDhmei379IHEufDBXMgIlbj0pIhqQX1jXYjHQ== 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=e7dieo0iKntbsoyyRsE7GqfPv+ghGHRn4EUF1ndlK98=; b=NfY6hekv0OUPEO/b7KCyhaAnhkAzExxm7FHroCrSGnMkSZig5fVajJwWjUFkA7txed9QrGxPJHRjnd4Kh4zctLwMM/pq6NR+WZ3UkQDUhk5QhweWSH5alwx3ilaJKmOtCa0UQ5JMtOMvxAD+tjs9OcEtIaPTz4p95tJpFJae9ypKgZgxEkqTAeA1O+4z1GfUcfxyzI3fIoRbMPPYmiZG7bv1/1ZSYTQxzboclyz+S6mb1EWSU74VPPXt2pTfJggBkbKr/2oNAhItqBKGkkRyqN1pJ+D/PSRSvGoToiKF8gV5mc7rGF5uPF3gYFog1iIBLGkqoSHQWG1GwIf5nnwTWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=smartsharesystems.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=e7dieo0iKntbsoyyRsE7GqfPv+ghGHRn4EUF1ndlK98=; b=WvqPXABuyBmEyXmCq6ckEuSpRyEAkZt9RUsNq5B4ciB4rV/R37X+mUOUNeWWJf/A8PoR3+8P18EVXiuX3zDHT6H8AQ/O86VCu48kjQdi9VRzwQ/VGICKbMElHALKuAeLAWQQcbnNZd2OiRbzlO0c+FM3hxY6GLEHTHONm6wvda/4fgm/PCZ4RdDmQefES6SHqdAiiAJuhf6CQj7wXN7TamSDV7NYQdqxC3HOg38KDAs3xyTqzz6OFDgH/HbwPxZWRYOObUkZptLidugsILJSHSv6CouOEGgP6h7nB5wU4ZC5Pf/yk1947NGyeeU3TEKFEfsiuV28t/Ajt5RHm9KDQQ== Received: from DM6PR07CA0068.namprd07.prod.outlook.com (2603:10b6:5:74::45) by DS7PR12MB5768.namprd12.prod.outlook.com (2603:10b6:8:77::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Wed, 15 Jun 2022 12:58:55 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:5:74:cafe::a0) by DM6PR07CA0068.outlook.office365.com (2603:10b6:5:74::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.17 via Frontend Transport; Wed, 15 Jun 2022 12:58:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5332.12 via Frontend Transport; Wed, 15 Jun 2022 12:58:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 15 Jun 2022 12:58:54 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 15 Jun 2022 05:58:50 -0700 From: Spike Du To: , , , CC: , , , , Subject: [PATCH v8 0/6] introduce per-queue available descriptor threshold and host shaper Date: Wed, 15 Jun 2022 15:58:30 +0300 Message-ID: <20220615125836.391771-1-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220614120134.1828188-2-spiked@nvidia.com> References: <20220614120134.1828188-2-spiked@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29ca0064-77ef-403f-44c5-08da4ececd92 X-MS-TrafficTypeDiagnostic: DS7PR12MB5768:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eURoeROoxekb0A7e3mxtcUPlFzU2OpovB9yQxd7QW1ii/JpGklg9OoA9lm7FRJfOZEdIJbAMUr/JAG8SG5hYGRLAZyDYc069H5TGcGuUSy/OzN2/78y7OUjTOOIaagch9qsurpbeOt9z17FNKbyTd7cji8Hz1dzqXOZFuuGDoyo60NEekECU5EF3g7fKwPoeekmtZqZiJkmMnl9SCrsztfWX7eS5f72meWRYQLec45HSvpUTuuEfII0DoUyk+6iO655qrjiDZ1Hqm6t2yM8y9U/mF1tyhjx6FxDn+FMIgovU+eFizVwOyo0G7ox371lNBCk8iT7PHzF65R9EYn9+cKatwI0+Q1RWsYlmjGxDkS++3oJ/QNxgZuDJH6r+3BG+w9pSVJ/fIHC/SFHgiGb8Vo4n/rs3dph5LX2WFkgYDFpUKOBIf/W4zUFxdV1lQ3nNIXaMFlBjjTfnLqMVANpwIGFInZiViMyDUv/rDVkB8ltCUdvb2Y76K4br4PwPE5raSF0xGxENTYM2Y2gSXqDGPmapF8A2hyEhEMq7DKA+xxgkSSbdKCZRZkHmt7T33G23JSBGPZeln76Q6lg3WWrn1NJw50B3NxxQSsUN8SRy16xrMA4cJZJhHNMC3HmbegRb7Px5swxlkW/3ACTHDWNudB6RPKYlEhj3iLr0dKDlFlCBoFdEtw1xL5YTNP5ciDE4TSE/UByGq3AVQuf8MHnaVltaGCNLksONf/Sauhx9nvLuz8ijbiT20VlBGQGwJjSG X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(46966006)(40470700004)(36840700001)(8676002)(6666004)(86362001)(5660300002)(26005)(36756003)(110136005)(6286002)(82310400005)(8936002)(2616005)(316002)(16526019)(7696005)(70206006)(47076005)(54906003)(336012)(83380400001)(81166007)(426003)(70586007)(55016003)(107886003)(508600001)(186003)(2906002)(40460700003)(356005)(4326008)(36860700001)(1076003)(131093003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2022 12:58:54.4241 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29ca0064-77ef-403f-44c5-08da4ececd92 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5768 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 available descriptor threshold(ADT for short) is per RX queue attribute, when RX queue available descriptors for HW is below ADT, HW sends an event to application. Host shaper can configure shaper rate and avail_thresh-triggered for a host port. The shaper limits the rate of traffic from host port to embedded ARM rx port on Nvidia BlueField 2 NIC. If avail_thresh-triggered is enabled, a 100Mbps shaper is enabled automatically when one of the host port's Rx queues receives available descriptor threshold event. These two features can combine to control traffic from host port to wire port for BlueField 2 NIC. The traffic flows from host to embedded ARM, then to the physical port. The work flow is on the ARM system, configure available descriptor threshold to RX queue and enable avail_thresh-triggered flag in host shaper, after receiving available descriptor threshold event, delay a while until RX queue is empty , then disable the shaper. We recycle this work flow to reduce RX queue drops on ARM system. Add new libethdev API to set available descriptor threshold, add rte event RTE_ETH_EVENT_RX_AVAIL_THRESH to handle available descriptor threshold event. For host shaper, because it doesn't align to existing DPDK framework and is specific to Nvidia NIC, use PMD private API. For integration with testpmd, put the private cmdline function and available descriptor threshold event handler in mlx5 PMD directory by adding a new file mlx5_testpmd.c. Follow David Marchand's driver specific commands framework to add mlx5 specific commands. Spike Du (6): net/mlx5: add LWM support for Rxq common/mlx5: share interrupt management net/mlx5: add LWM event handling support net/mlx5: support Rx queue based available descriptor threshold net/mlx5: add private API to config host port shaper app/testpmd: add Host Shaper command app/test-pmd/testpmd.c | 7 + doc/guides/nics/mlx5.rst | 93 +++++++++ doc/guides/rel_notes/release_22_07.rst | 2 + drivers/common/mlx5/linux/meson.build | 13 ++ drivers/common/mlx5/linux/mlx5_common_os.c | 131 ++++++++++++ drivers/common/mlx5/linux/mlx5_common_os.h | 11 + drivers/common/mlx5/mlx5_prm.h | 26 +++ drivers/common/mlx5/version.map | 2 + drivers/common/mlx5/windows/mlx5_common_os.h | 24 +++ drivers/net/mlx5/linux/mlx5_ethdev_os.c | 71 ------- drivers/net/mlx5/linux/mlx5_os.c | 132 +++--------- drivers/net/mlx5/linux/mlx5_socket.c | 53 +---- drivers/net/mlx5/meson.build | 4 + drivers/net/mlx5/mlx5.c | 68 +++++++ drivers/net/mlx5/mlx5.h | 12 +- drivers/net/mlx5/mlx5_devx.c | 60 +++++- drivers/net/mlx5/mlx5_devx.h | 1 + drivers/net/mlx5/mlx5_rx.c | 288 +++++++++++++++++++++++++++ drivers/net/mlx5/mlx5_rx.h | 13 ++ drivers/net/mlx5/mlx5_testpmd.c | 205 +++++++++++++++++++ drivers/net/mlx5/mlx5_testpmd.h | 26 +++ drivers/net/mlx5/mlx5_txpp.c | 28 +-- drivers/net/mlx5/rte_pmd_mlx5.h | 30 +++ drivers/net/mlx5/version.map | 2 + drivers/net/mlx5/windows/mlx5_ethdev_os.c | 22 -- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 48 +---- 26 files changed, 1064 insertions(+), 308 deletions(-) create mode 100644 drivers/net/mlx5/mlx5_testpmd.c create mode 100644 drivers/net/mlx5/mlx5_testpmd.h -- 1.8.3.1