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 6E0E8A0503; Fri, 6 May 2022 05:57:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 189724014F; Fri, 6 May 2022 05:57:07 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2057.outbound.protection.outlook.com [40.107.237.57]) by mails.dpdk.org (Postfix) with ESMTP id 80A4B40042 for ; Fri, 6 May 2022 05:57:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXSAd5cobhCBXNXbqcr4Z2DHAI90P3+l5E2FzgZdZ9Yb3peG3vJCcBzYgyS5DQDthQZDLzTm8pUouCiUCQrO27RIEh7weMoFqghdJ+FujyreYDfikgjPH+5nBjRJz9BXgcAfsqP/TmMqDg6QeIH+NfMD/rM9Yt9uea+gWMbYscBwTCTx1sLA3ZTszJDV7b7Fj4j+/PI5EkWbVhb+uYKp4JIG/94kN6lYNPDvvTr8MstVyC3VQvnW16Y/KaEnofJu5Dfi9EWYvGSn1uErRyjEa5Khbz+JUwHPp9clH5xu7CKTMCoIrfsB1msU7+rCSsMO+/xB/htPEkEth+H/gQhKvg== 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=Iz2oMDiwAzxu8nhACoWkkXHXyN+gMb2GP1FVmjIAGsE=; b=My/RdeyFITTOdVC48ipfu0GRRyn3oJen5Nqti/yo7WGX4uMZw355zJ44bL20+YM+5fK50U97CVS15QbhqRyLB/oF6DkSQ9jh1FNRvDrDDvjVjt+0OH+D0HKjmnVQ31EtZ5FcJSR9fiWJ98e5bVfQA5YG19UFUJzEEsPdmdZlwRKRwErTIGfHgeX/ILlQt1fG6diUDwqK/8eSLt/KigOO41FHW3LuYc/olKLAJ/UnowvbXzPQ7nPEri+JZZwD8X1rLDnIAkZ7FC4gauOTlhxVc0s4FJKVZMTOYisGI1J5h5091Ns1z7FNRkVAbVEdiuscv+sIfP+XZnomGezK0kou5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=dpdk.org 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=Iz2oMDiwAzxu8nhACoWkkXHXyN+gMb2GP1FVmjIAGsE=; b=TnkTTpom96cNAxn9oJTjDaVSzrtDoSBKHa2SRccjr1Im+YiSe9qFdtyk29y4H4x2v1lOXp5F3c6HhU8ztWrW50hpFf8QhPF01Be/qLhRQeUDNxs9OgZ54Fhzh1Pf1vzso6NYCwYWw8OBzZCNOkcMkZsa08v3NBaqmguJeuwk/2lDzNdptWafu57Q2AsRaTrsLkK2AiVoD5F0JCZsQ9Ux2BW9w4Gp1B9B+IQt57wvC6MLLuaghqSM8tsn4hzgtDbQe1CxJpdxuJ4JKNiOPeZguiP9u9DRWZwU9n7dJeCDzAAZdFMEoLW3GWqrLk1crq2apoTEbmYZIU2Fhp5AgW/SRw== Received: from BN0PR04CA0004.namprd04.prod.outlook.com (2603:10b6:408:ee::9) by SJ1PR12MB6315.namprd12.prod.outlook.com (2603:10b6:a03:456::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Fri, 6 May 2022 03:57:03 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ee:cafe::b) by BN0PR04CA0004.outlook.office365.com (2603:10b6:408:ee::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Fri, 6 May 2022 03:57:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5227.15 via Frontend Transport; Fri, 6 May 2022 03:57:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 6 May 2022 03:57:02 +0000 Received: from nvidia.com (10.126.231.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; Thu, 5 May 2022 20:57:00 -0700 From: Spike Du To: , , , CC: , Subject: [RFC v1 0/7] net/mlx5: introduce limit watermark and host shaper Date: Fri, 6 May 2022 06:56:38 +0300 Message-ID: <20220506035645.4101714-1-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220401032232.1267376-2-spiked@nvidia.com> References: <20220401032232.1267376-2-spiked@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: 06aabeab-f501-4559-7bdb-08da2f147acc X-MS-TrafficTypeDiagnostic: SJ1PR12MB6315: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: y14UZ9o7sR8zSzjekfU3faDDmkTe/+EqWCWCZq6bY0NRgXmILw8PNdhTdmGq1WFAMJJD+8HFnVZXG+lroiFXrK21Uv06I9hdcBCZ5m+kHOooDbWWNYhNRYagDjJ09/As0xBAt7RWufP/nwv+BsLqNxic+Ssu8Ld4+fa06pPTw1PKjWxbNauBsWVEL+0Jwl+WyP2/r8jpq7AvKm5VRKows8D2jTiiSIaE0Pw4PR+ziNctEyl4/0zmWO6sW1rnclYDT6IIxDvyvDBY/Bta0oqfyWaUL/lFj5DoYbUjV/vhO2Q45QWAUKkPcLwzrZR77iE3wSKzQ0iUMOG0yuPSdLSQ4VSUYfUYWTiJddo27445/XukQMJtgcvttoKhbYVw4U6pBRdv66rYiFyN337L1gj7Yl7nOdy/YBnychHpc5nrBsuLe3QOVSUPlngHhlMbvF761PRelE1CDGKwNREamMe7qVdVlfp1qFzZyIh9YcTop0FgvIr3bezbRj8gTBfba1G/Z1TYASCYtR2SrVA9pTp42/vLfgwi/3KGuXQczL5jSoKc78wETAXEZqnmomC/1RtIQK2DsGWlFKWe3sYWsg0PwJFnyteE0RQU38plfeU8Ur+OZBRNWLU2GqZOcMt4nzEVqycmQmAPBatM2AbcJLsOzedMZlIOuRzXaIFTdn57PCG259Yf0jTOJ/VIz3xSfDxOAll/Sy+Z1lwqPkEjBi8TKQ== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(8936002)(508600001)(70586007)(26005)(8676002)(6286002)(81166007)(86362001)(4326008)(36860700001)(70206006)(316002)(54906003)(110136005)(356005)(6666004)(7696005)(5660300002)(40460700003)(2616005)(186003)(16526019)(1076003)(107886003)(47076005)(336012)(82310400005)(426003)(36756003)(83380400001)(2906002)(55016003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2022 03:57:03.0700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06aabeab-f501-4559-7bdb-08da2f147acc 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6315 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 LWM(limit watermark) is per RX queue attribute, when RX queue fullness reach the LWM limit, HW sends an event to dpdk application. Host shaper can configure shaper rate and lwm-triggered for a host port. The shaper limits the rate of traffic from host port to wire port. If lwm-triggered is enabled, a 100Mbps shaper is enabled automatically when one of the host port's Rx queues receives LWM event. These two features can combine to control traffic from host port to wire port. The work flow is configure LWM to RX queue and enable lwm-triggered flag in host shaper, after receiving LWM event, delay a while until RX queue is empty , then disable the shaper. We recycle this work flow to reduce RX queue drops. Add new libethdev API to set LWM, add rte event RTE_ETH_EVENT_RXQ_LIMIT_REACHED to handle LWM 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 LWM event handler in mlx5 PMD directory by adding a new file mlx5_test.c. Only add minimal code in testpmd to invoke interfaces from mlx5_test.c. Spike Du (7): net/mlx5: add LWM support for Rxq common/mlx5: share interrupt management ethdev: introduce Rx queue based limit watermark net/mlx5: add LWM event handling support net/mlx5: support Rx queue based limit watermark net/mlx5: add private API to config host port shaper app/testpmd: add LWM and Host Shaper command app/test-pmd/cmdline.c | 74 ++++++++ app/test-pmd/config.c | 23 +++ app/test-pmd/meson.build | 3 + app/test-pmd/testpmd.c | 13 ++ app/test-pmd/testpmd.h | 1 + doc/guides/nics/mlx5.rst | 87 +++++++++ doc/guides/rel_notes/release_22_07.rst | 2 + drivers/common/mlx5/linux/meson.build | 44 +++-- 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 | 3 +- 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 | 7 +- drivers/net/mlx5/mlx5.c | 62 +++++++ 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 | 253 +++++++++++++++++++++++++++ drivers/net/mlx5/mlx5_rx.h | 11 ++ drivers/net/mlx5/mlx5_test.c | 191 ++++++++++++++++++++ drivers/net/mlx5/mlx5_test.h | 27 +++ 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 | 52 +----- lib/ethdev/ethdev_driver.h | 7 + lib/ethdev/rte_ethdev.c | 28 +++ lib/ethdev/rte_ethdev.h | 30 +++- lib/ethdev/version.map | 3 + 34 files changed, 1193 insertions(+), 331 deletions(-) create mode 100644 drivers/net/mlx5/mlx5_test.c create mode 100644 drivers/net/mlx5/mlx5_test.h -- 1.8.3.1