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 99D34A034C; Sun, 22 May 2022 07:59:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D63540156; Sun, 22 May 2022 07:59:28 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060.outbound.protection.outlook.com [40.107.93.60]) by mails.dpdk.org (Postfix) with ESMTP id C9FDF40040 for ; Sun, 22 May 2022 07:59:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S2MMPtxu1C3V46cktyo1Ey4ehs6gvPD9JCtuV2I2Nifk8Q9ko+9diG9NehMesAnZDHM1PuVdUTTPnh90pdmT7D4zFnLQyzDpJRAkzPz5D3/PkMWWZ3pUvS9QBxD/aCbaY7UkiCEkuf59lJSXjtacMilA6WV3idcf2Ruip53ZEy4Zfc0NZJlZVLNPBpNUUdfczsSpnABqgx0XX/C02KmENEFjX2q1O8IVRj854ljSeJKRsBihEEIMDLkHY17FGF/cJUOmldr6uPqRXKl8U5t/v1SVGU2o7nF/87wqhu3zIhXe69SnPQEjV/qXlJYbLZeVXUBuKvDlp3xnIIGMgR8ytQ== 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=L/7M/2WbmhX3juplHSK2FUYqkXAxtCbhUOYJMOU7xhY=; b=OSyodPtVaDo8gGCvKW7ejpJVaHHDN88GExJ2+PDbf857k/ruqU49P4C64xefKSanTdBim87jYry5UpSzRWB2NnFk1P6JJgjuoHhA6nSWwjkTvunGu4vkBlFF9q2ew2VKApqlazkJqEt44kJcrMfA3SabvdSv3b7KRzj1ryFF1GVILPyP9v4ZfM6+ll6/c9+/klskkjCiWJebJNyq0JG4wNzatIwwefh+FYSKKYrByPQeSwkeTaJRudnKAC/vPPjhXjGhYe2ZCAPfvdUjEpfJkAsFTkannOi2PBB2lkz4qw/AaFTWGojM2GUBIEZN6MbZB6fl+qnGGnh2ep1nXdDMVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=L/7M/2WbmhX3juplHSK2FUYqkXAxtCbhUOYJMOU7xhY=; b=qaHnot4IXXR9q0whdf1UcbrJBTEiAw+4xJzEftKYt9cRnbDwGKSmnLWE+Diowj34YgpAh0g96u3gD1PSO/Hi/OlTEvnoUytvoWVvXQ7AepUYN0+bjvUIvQGBvvj+R3YGaHrIBs1lZQNJtQ4WXmlSOSdOLujkDfUkthjDvBlKv0WLTWuqj7VuJ5NnP2eL4G887QGSPsGksn0GHBLLCV+nnaVxfkqMsRxIrNUpU+HjdvAH57jmW9ri31I5cjUy7Bw2V0PGFVgZteZpMnS9jXkFtCEFPWK/ABm0iRTusmnPVS1BxSif+SFtfHsSfHGlHjMh+24Px/gVC2plsc7obutQjg== Received: from CO2PR04CA0142.namprd04.prod.outlook.com (2603:10b6:104::20) by BN9PR12MB5196.namprd12.prod.outlook.com (2603:10b6:408:11d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Sun, 22 May 2022 05:59:20 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:104:0:cafe::21) by CO2PR04CA0142.outlook.office365.com (2603:10b6:104::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Sun, 22 May 2022 05:59:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5273.14 via Frontend Transport; Sun, 22 May 2022 05:59:19 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 22 May 2022 05:59:19 +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; Sat, 21 May 2022 22:59:16 -0700 From: Spike Du To: , , , CC: , Subject: [RFC v2 0/7] introduce per-queue limit watermark and host shaper Date: Sun, 22 May 2022 08:58:53 +0300 Message-ID: <20220522055900.417282-1-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220506035645.4101714-1-spiked@nvidia.com> References: <20220506035645.4101714-1-spiked@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4e295c5-b8d5-44fc-0979-08da3bb83633 X-MS-TrafficTypeDiagnostic: BN9PR12MB5196: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: 7Kg0uDV/6UN+JQmvsMecToklKGW/+gNRlTxxnaCJMN5nIsmX9O1I8/LeV8KllXuMzYlQO3T1gcEE2O4dSydF8AtDoYyhrj7D96QBwoLY13ZomOU/okiqykTNOk8e9FCBOx1+PyT/YPfC2Pl+2PhI7+E/MDDQQPR58caAEMgolKPQoWB86o6ezd5x35ZqAqk0bCv4aULVvgFKYUslmuE08lYLfYcQrZcpZNJj2Hes8nTsRAMW7DayNx/RHCic0UTKU+BMShk2xAZp7LR8Wc2lqR+Fm6uL0EHEKxuFrt4jbCpliJZUqVF/FFcBUBQIKBmCbUh6JAh6O6luAwWWAB2P2PQZHFxoU3e/xnQ+pb9AqOZtzUp51RzEGb9nGIM3u/mVepPro0VXryaDqxIw7F11i7Mu4qDboTaHlXevO5RyWsrRF+E+nWDwpQzfJN1fQzshY/A9BwprYFWSPax5eliPp4ezpy0zRNvQrkLErfVUB1wV1YS3NbYw/NjPVTD5YgWdIbd4TJkBmtY4Y68dNfixa2xr9cMCBH/SGNlmso+A91cFmp2pg5sRv8hgNHvTSxhJKXZ2h1r/uyxLVvToKdBkdm3n75EZXtwzjqYhjWInVWAktbEWW8HXxjTE3Y5amf+LLPwLxaj4p/i3CtRCGXpVhhn/urTOxB7R2FhiHIMhcU9/zEKrX7L+jfT3DskgKNpjzQrF3uPrE0zZphhKuNsViA== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(5660300002)(70586007)(70206006)(81166007)(8676002)(4326008)(356005)(36756003)(36860700001)(82310400005)(6666004)(2906002)(8936002)(7696005)(316002)(426003)(336012)(47076005)(86362001)(107886003)(2616005)(55016003)(40460700003)(508600001)(6286002)(26005)(110136005)(186003)(54906003)(16526019)(1076003)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2022 05:59:19.4588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4e295c5-b8d5-44fc-0979-08da3bb83633 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5196 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 | 4 + app/test-pmd/testpmd.c | 24 ++ app/test-pmd/testpmd.h | 1 + doc/guides/nics/mlx5.rst | 84 ++++++ 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/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 | 292 +++++++++++++++++++ drivers/net/mlx5/mlx5_rx.h | 13 + drivers/net/mlx5/mlx5_testpmd.c | 184 ++++++++++++ drivers/net/mlx5/mlx5_testpmd.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 | 48 +-- lib/ethdev/ethdev_driver.h | 22 ++ lib/ethdev/rte_ethdev.c | 52 ++++ lib/ethdev/rte_ethdev.h | 74 ++++- lib/ethdev/version.map | 4 + 33 files changed, 1305 insertions(+), 309 deletions(-) create mode 100644 drivers/net/mlx5/mlx5_testpmd.c create mode 100644 drivers/net/mlx5/mlx5_testpmd.h -- 2.27.0