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 EF8B6A0C45; Tue, 19 Oct 2021 00:44:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B80F140683; Tue, 19 Oct 2021 00:44:14 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id CA87D40142 for ; Tue, 19 Oct 2021 00:44:12 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Mon, 18 Oct 2021 15:44:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6hLzhM7yPKuRq5yDQgRqNAKgnYMgeT1ZBRN1jmcFzTEyvhbSZ9jYryScnNUnpt/ryleuJZ4EIi98J7MRuyI6nM3Emajc0qP9PN/BbrQJcSfsbqdvSEnJwFe+BBPBqFneGyi+mlOFXku/w6rvOjD2BSuBwqvcGccroZng8r4IYGJV1Y5j2vAnzmRPh3XgHfL1ItjReKofLDPN/1XyxWiwtnlfiLmaoCLETyU2w9OjQ+R6nAR4K6QDjyB1125E0aBB7YtaFBmhXSs0FFsthds3+4HP4J261wHYQ7CEdioYh5ptI2F8guWviMrqViU1ryD2HEdJfjE77yNRj0rhZAUfA== 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=81BajaBM9/eJclZu9ZkL6qMnMTZaXJ1tyRE43EcGK3I=; b=Fd1pUvGx2Y5xKIrdQYU2F8z8WS8C78+CO9n+AxyGqvmmd1DuawpvGZoIVPF7UpJvRSnt6atjCxTkVZLLnTLIcxNtkieiPdpJMTcNv7/2ZUfgmnr2n1yD3vtxwX3l/QtBCMR5HWcuh4DXnOUvdb+cDUD+5OqKiEAjp7Z4we18hW2ePRzpZPwqwg+rejNfPCgkfIVzSlXjJHXn7zgtulsjwt8G7QWfbJ8tPTD2HTDJVwt4d+hmMNPdP5OOMsLej/RYYD44G0OX8GlfcYdFD6OPOJ5jhx57wdupfSdq09Dwi4/XSenFvsyIGwXC7th3kb8b2lCC+HafxFihSpAkbBX3Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=81BajaBM9/eJclZu9ZkL6qMnMTZaXJ1tyRE43EcGK3I=; b=OnilbLmJurl2Ze9Ou4+9fsHhc9FTSF4a3P69pa/E2fYKZkN0a7FYzI2pqSJUNNCSecER+NWeRcJruwcAcmzpbcaxMCAoVYSEQ8lWHIumQw08mZU0VwRJGSYxoEPbVcR5Tk8YkJPPROTCQhsoeLw0Gnb/Bpv/+hllRDPxKanRTuXdAi6bQbft8PyiJAqhd6c9uklGuCZ5iTLNCw3hUjtCyLRJoNm8GIbERFsw/h6SPR1FdDGkcnWVQ+3B4jx4E1vYtGW2OrxaNOFYz3COWSmxWUq9PzGb7uuvDKh+SSJl2ZVHOkAkV+iF3fHjaS4xJmMF0ESYLKeG+Izt9F8oYKlPNw== Received: from DM3PR08CA0021.namprd08.prod.outlook.com (2603:10b6:0:52::31) by BN8PR12MB3602.namprd12.prod.outlook.com (2603:10b6:408:49::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Mon, 18 Oct 2021 22:44:10 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:0:52:cafe::20) by DM3PR08CA0021.outlook.office365.com (2603:10b6:0:52::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Mon, 18 Oct 2021 22:44:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 22:44:09 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 18 Oct 2021 22:44:07 +0000 From: Dmitry Kozlyuk To: Date: Tue, 19 Oct 2021 01:43:49 +0300 Message-ID: <20211018224353.3362537-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211018144059.3303406-1-dkozlyuk@nvidia.com> References: <20211018144059.3303406-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87ab1ee7-2cde-41eb-1e71-08d99288ccfd X-MS-TrafficTypeDiagnostic: BN8PR12MB3602: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kAtpES6DU1oBv1qrjMzObQ3hPIdvDzw4PyAn61LjpAe1sPY4LKtgYwXaZ1ZQm6RATacVZXsnZJsjUAXDHQR+K4KVbGJgTbh2coGpvDD1T56OSMqCjAaTjgRzAHG/JXH1gbpyNX05pojJP1kDEw/aX1YvvK4MPLHT8gSfhxW4+mMQIfpN/1X88ITKeX5+kZ8gJQKU7fGRRVG5F9vwQ7NXdDZ4nz+QQug/Ar0gARxTQpEPoUaJhg42Ew7pp5pTjHt6MKtBfTnoRsQFf0U44H4xQf9l5SI9ignNKIZCivWvI/KWklgKGorBl8E4lKkrzi8sk8a5T4aowwz/jIeO8EA4SOQsW61kYE4Dlwo8weeM0Q4FGs2j3y0kZUVVxElTNqPV8BaHSPRo6wx7xtOO3bE/Ki9v24iBTFPcQqRjaZdhbjosglwenS1jcc/r4Gnm6ZBi/tyQKnwOQIKz7FCXZpFAqL+l0l+ju2dcJ/BvyMJhUEMXzn+zbI6ccigb8I9hqLVyRBdPerH8TUWk4tnPO+XuhJXsKW9rbN8e14puXJzUeODdxEVYUq45XZnR3m8T0E/jxGa4Lnww+Dn9JAEh1MwkAKssGwzibvQbLEqYaqWWcxjHxEuOURvMXHbUrIgc1anOPbZoPZsoTPJylrVKaObZC1FfBJqIpiwtWAj1XNsR9fH2B96UPfXqAgCzTfZMdnPRKs/sbXboXheRHsfGhI76JcOGrOqvzv3m9MPYye9eiWp66MitZLPAff7S05zD1Gf6moKozFcGG9Ku7fF/Pz+Obloe/oJ/wFuNH84k/jZohsQ= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(6916009)(356005)(86362001)(7696005)(6286002)(508600001)(7636003)(336012)(966005)(426003)(55016002)(36906005)(70586007)(36860700001)(2906002)(26005)(5660300002)(2616005)(8676002)(1076003)(16526019)(186003)(70206006)(45080400002)(8936002)(6666004)(316002)(36756003)(83380400001)(47076005)(82310400003); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 22:44:09.8186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87ab1ee7-2cde-41eb-1e71-08d99288ccfd 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.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3602 Subject: [dpdk-dev] [PATCH v9 0/4] net/mlx5: implicit mempool registration 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 Sender: "dev" MLX5 hardware has its internal IOMMU where PMD registers the memory. On the data path, PMD translates VA into a key consumed by the device IOMMU. It is impractical for the PMD to register all allocated memory because of increased lookup cost both in HW and SW. Most often mbuf memory comes from mempools, so if PMD tracks them, it can almost always have mbuf memory registered before an mbuf hits the PMD. This patchset adds such tracking in the PMD and internal API to support it. Please see [1] for the discussion of the patch 2/4 and how it can be useful outside of the MLX5 PMD. [1]: http://inbox.dpdk.org/dev/CH0PR12MB509112FADB778AB28AF3771DB9F99@CH0PR12MB5091.namprd12.prod.outlook.com/ v9 (CI): Fix another failure of mempool_autotest. Use negative result of rte_mempool_populate_iova() to report errors in unit tests instead of rte_errno. v8: Fix mempool_autotest failure on Ubuntu 18.04 (CI). v7 (internal CI): 1. Fix unit test compilation issues with GCC. 2. Keep rte_mempool_event description non-internal: Doxygen treats it as not documented otherwise, "doc" target fails. v6: Fix compilation issue in proc-info (CI). v5: 1. Change non-IO flag inference + various fixes (Andrew). 2. Fix callback unregistration from secondary processes (Olivier). 3. Support non-IO flag in proc-dump (David). 4. Fix the usage of locks (Olivier). 5. Avoid resource leaks in unit test (Olivier). v4: (Andrew) 1. Improve mempool event callbacks unit tests and documentation. 2. Make MEMPOOL_F_NON_IO internal and automatically inferred. Add unit tests for the inference logic. v3: Improve wording and naming; fix typos (Thomas). v2 (internal review and testing): 1. Change tracked mempool event from being created (CREATE) to being fully populated (READY), which is the state PMD is interested in. 2. Unit test the new mempool callback API. 3. Remove bogus "error" messages in normal conditions. 4. Fixes in PMD. Dmitry Kozlyuk (4): mempool: add event callbacks mempool: add non-IO flag common/mlx5: add mempool registration facilities net/mlx5: support mempool registration app/proc-info/main.c | 6 +- app/test/test_mempool.c | 363 ++++++++++++++++ doc/guides/nics/mlx5.rst | 13 + doc/guides/rel_notes/release_21_11.rst | 9 + drivers/common/mlx5/mlx5_common_mp.c | 50 +++ drivers/common/mlx5/mlx5_common_mp.h | 14 + drivers/common/mlx5/mlx5_common_mr.c | 580 +++++++++++++++++++++++++ drivers/common/mlx5/mlx5_common_mr.h | 17 + drivers/common/mlx5/version.map | 5 + drivers/net/mlx5/linux/mlx5_mp_os.c | 44 ++ drivers/net/mlx5/linux/mlx5_os.c | 4 +- drivers/net/mlx5/mlx5.c | 152 +++++++ drivers/net/mlx5/mlx5.h | 10 + drivers/net/mlx5/mlx5_mr.c | 120 ++--- drivers/net/mlx5/mlx5_mr.h | 2 - drivers/net/mlx5/mlx5_rx.h | 21 +- drivers/net/mlx5/mlx5_rxq.c | 13 + drivers/net/mlx5/mlx5_trigger.c | 77 +++- drivers/net/mlx5/windows/mlx5_os.c | 1 + lib/mempool/rte_mempool.c | 134 ++++++ lib/mempool/rte_mempool.h | 64 +++ lib/mempool/version.map | 8 + 22 files changed, 1589 insertions(+), 118 deletions(-) -- 2.25.1