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 7D4B1A0C4D; Thu, 7 Oct 2021 00:04:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36C5F407FF; Thu, 7 Oct 2021 00:04:17 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2084.outbound.protection.outlook.com [40.107.92.84]) by mails.dpdk.org (Postfix) with ESMTP id 6F0C840685 for ; Thu, 7 Oct 2021 00:04:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYFje2mVQzg1hANbOfnhAwSw/4SV85SVcVavACwV+omrEeX4TFT4nqza75v/HMtbIsgSmUcyNuzLY4aoEJDJC1SFZO8US2O64vuA7f/l7QJIlizRF0KC2uBa2bjmiooHySd66PgtoklhocFjF3ucnB1NB5dtf7IviQYaR/JMMQxovSJ7Fapogy6QvhdpNZQIWnDulI0YEGb6yjsRNWXWyX81P5c0GrDDr1mJJ7TLMhxlrSvGwY18pW6CklE1l9vU1ILZHzo2lvm3bZDmeszFjBsjrrdSHFyLBdsNK33VJrI+fDEYA5EgdD6UwG4o7UoICV1/fV5OqvqwtKfi3nqAdw== 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=fDmGtQ5F/gMZyDe5N4n1P6JK0pFLqDGAiu38DoJQyQ8=; b=lK4MQ4xNcAL9xH554NOncNF6t5MeSmBSpWo9YONMT5r59Di2p5OivDlEYQoWqH51E7TerineFPIQH0Nq3G+HlLvkDpdJIkRSvRUh56dKM3fcKS4cxh1iPHUY82yV4v4/ScLY4h3g3VvFAg8Zs/pqKZwGCL7wwYYno2pf7o1T9JedxJ/EfM1DSqfqPjpBdrd84Rm8OZZVrA1/YPEK3XVCWfJENVhpf88MbGPt4GRfA1p1NIQlJPzGOIWvS0eTpXiexlFN3u9hxHMLWFWPR6veKG9b0bAQTwdDG0N74d52zEl5Uv5TA4Ufx1WUcOaT+TOzXs6Q036vH3AkO6i00hip4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net 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=fDmGtQ5F/gMZyDe5N4n1P6JK0pFLqDGAiu38DoJQyQ8=; b=nWFZgCwkeDM1tB5shPbzLiQAXwJPNTIONODjZSO7V/Ovctt82HRc4/lv6CZ5N+5pe84D/5pIrQOj1lvo8yUOd0ducTCDqRMXQOmMUpv+7kPC+PzAdYZnj54SODfCfQdpIATJ4bSOmGANk5Iob0He/oAKf3IaQu/u3mKDFCfc/qrPEsLrdHLa3V7wW6mCV0ckbIKdrkB4/hAOGVj1SaQXfN3PWOsWwONr5OzCdBzdd5HKB176v6EOf4sgEKAc1G7guIDKRAheOj5/x0BfNxE8wyiJU7yJ9U1y3fiDr0gSO4B/HA0vFMwv3cZ3G9nvtavs74bKs5iPeTBhslKO6FGRUw== Received: from MWHPR07CA0001.namprd07.prod.outlook.com (2603:10b6:300:116::11) by BYAPR12MB2629.namprd12.prod.outlook.com (2603:10b6:a03:69::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Wed, 6 Oct 2021 22:04:14 +0000 Received: from CO1NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:300:116:cafe::2b) by MWHPR07CA0001.outlook.office365.com (2603:10b6:300:116::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Wed, 6 Oct 2021 22:04:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; 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 CO1NAM11FT043.mail.protection.outlook.com (10.13.174.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Wed, 6 Oct 2021 22:04:14 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 6 Oct 2021 22:04:12 +0000 From: To: CC: Matan Azrad , Thomas Monjalon , Michael Baum Date: Thu, 7 Oct 2021 01:03:32 +0300 Message-ID: <20211006220350.2357487-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210930172822.1949969-1-michaelba@nvidia.com> References: <20210930172822.1949969-1-michaelba@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 HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e47d738-e02e-4520-f8bb-08d989153bf8 X-MS-TrafficTypeDiagnostic: BYAPR12MB2629: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4BLl0ty3CLfp25m/dCQytWJ4eEacXzSSl1htc/8Ib7erf0t468qJKtj99MpbSmOGwbXuuyU+OId7jk0HK23VFPPxsXJtoNewAbMM23ECYH/mU3pfln0OV3wsJ4n6cnJJAKrX6+4PBsHyv5eBaJ+JH3wdGNSq08YXqYNQeNzBlY3LOFSLfYcVF/RNCMEbMHmjoDL2liAKb/Aagpi62auSMSIalgaz+hGcirU99HS2uGklLeWlmERcOXV3fLdBZgrpBri/XhxXxexicO39ITVoLH0kQxaeZbaxk3oQIva3BKB4njo777B1MoJkIQYX4V2sFDbTvs/pWBPKCt7OLX0FHwuBfwJ7vLD5yBaNPRHbuICe1YA+u0CZ1GJeYv22LGZn9O6b55UwMH5TxsnMnWoMWSWSlVHlpJ3AWvL1k/IYw/QAYRGLdHOBsjeCmVoT0a0FZSCJD36w5EJwlAIgzlD+ypzWQa4D8e3nklN/M4ELY0e7aNZ8IQQLciVQ0pmjHGlpN8dBzU0IoOaO+asRR5rHqoyIqIbs9VhMhpaLXG/9xR0Zd4AaIvSmZ00hK6CCZKEc/r8BvNFUObIU3SPIYufmb7Me1tU6GecVGatPkOanurqR7+PqZaw9Ppe8Lr3/Upbol34zV/DLigYHl7SxWWUrWvdAyinqLUrQYRxLa2espqcq5ymszJq/1EnL8iVIREY4iU7bzMnX4xNT/uB7Wo72WKflkeIiUSV29DnV4EUFW5hQ/qJiIDiP3S/ZGP0YlQi4pWWXIYpXJjxkBqh9vQmYOU70IREVwDPkv+d6bmjTlOM= 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)(36840700001)(46966006)(2876002)(7636003)(70586007)(26005)(55016002)(6916009)(82310400003)(2906002)(2616005)(54906003)(316002)(426003)(336012)(186003)(356005)(8936002)(4326008)(7696005)(36756003)(16526019)(1076003)(70206006)(86362001)(508600001)(966005)(8676002)(47076005)(83380400001)(6286002)(6666004)(107886003)(36860700001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2021 22:04:14.2007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e47d738-e02e-4520-f8bb-08d989153bf8 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: CO1NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2629 Subject: [dpdk-dev] [PATCH v2 00/18] mlx5: sharing global MR cache between drivers 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" From: Michael Baum The MLNX PMD supports 5 classes (net, RegEx, vDPA, Compress and Crypto). The various drivers are registered under the common driver, and managed by it. In the common driver probing, it calls in a loop the probe function of each driver registered to it. Each driver creates for itself all the objects required for communication with the hardware, as well as a global MR cache that manages memory mappings. The management of the caches separately by the different drivers, is not very efficient. In fact the same memory is managed several times and each caching handle is done by doubling the number of drivers, so we want to manage this cache jointly by the common driver. This feature will move management to common driver in two phases. Phase 1: sharing HW objects between drivers (11 patches) The communication with the hardware - for any MR handle - is conducted by the Protection Domain, so we are motivated to share it between the drivers. However, to create it we need to give the context of the device, so the context must also be shared between the drivers. At this point we will share between the drivers the next trio (CTX, PD, pdn) to create an infrastructure that will allow sharing of dependent objects, and in particular the global MR cache. The common driver itself will create this trio individually for all drivers, before calling their probe function. As a parameter to the probe function, it will give them a pointer to the structure containing the trio. Phase 2: sharing global MR cache between drivers (7 patches) The common driver will add to the structure containing the trio also the structure that manages the global MR cache, and will keep a list of such structures for memory management. In each driver, each queue will manage its own local MR cache. If the queue does not find its cache, it will switch to searching the global MR cache shared by all. Caching access will be through the pointer that the driver received as a parameter in probing. Depends-on: series-19267 ("mempool: add event callbacks") https://patchwork.dpdk.org/project/dpdk/list/?series=19267 v2: rebase Michael Baum (18): net/mlx5/windows: fix miss callback register for mem event common/mlx5: share basic probing with the internal drivers common/mlx5: share common definitions common/mlx5: share memory related devargs net/mlx5/windows: rearrange probing code common/mlx5: move basic probing functions to common net/mlx5: remove redundant flag in device config common/mlx5: share device context object common/mlx5: add ROCE disable in context device creation common/mlx5: share the protection domain object common/mlx5: share the HCA capabilities handle net/mlx5: remove redundancy in MR file common/mlx5: add MR ctrl init function common/mlx5: add global MR cache create function common/mlx5: share MR top-half search function common/mlx5: share MR management common/mlx5: support device DMA map and unmap common/mlx5: share MR mempool registration drivers/common/mlx5/linux/mlx5_common_os.c | 280 +++++++- drivers/common/mlx5/linux/mlx5_common_os.h | 16 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 96 ++- drivers/common/mlx5/linux/mlx5_nl.c | 2 +- drivers/common/mlx5/linux/mlx5_nl.h | 6 +- drivers/common/mlx5/mlx5_common.c | 596 +++++++++++++++--- drivers/common/mlx5/mlx5_common.h | 96 +-- drivers/common/mlx5/mlx5_common_defs.h | 45 ++ drivers/common/mlx5/mlx5_common_mp.h | 11 + drivers/common/mlx5/mlx5_common_mr.c | 192 +++++- drivers/common/mlx5/mlx5_common_mr.h | 76 ++- drivers/common/mlx5/mlx5_common_private.h | 6 - drivers/common/mlx5/mlx5_devx_cmds.h | 12 +- drivers/common/mlx5/mlx5_malloc.h | 1 - drivers/common/mlx5/version.map | 29 +- drivers/common/mlx5/windows/mlx5_common_os.c | 245 ++++++- drivers/common/mlx5/windows/mlx5_common_os.h | 9 +- drivers/compress/mlx5/mlx5_compress.c | 237 ++----- drivers/crypto/mlx5/mlx5_crypto.c | 201 +----- drivers/crypto/mlx5/mlx5_crypto.h | 6 +- drivers/crypto/mlx5/mlx5_crypto_dek.c | 5 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 6 +- drivers/net/mlx5/linux/mlx5_mp_os.c | 12 +- drivers/net/mlx5/linux/mlx5_os.c | 511 ++++----------- drivers/net/mlx5/linux/mlx5_verbs.c | 99 +-- drivers/net/mlx5/linux/mlx5_verbs.h | 2 - drivers/net/mlx5/meson.build | 1 - drivers/net/mlx5/mlx5.c | 241 ++----- drivers/net/mlx5/mlx5.h | 57 +- drivers/net/mlx5/mlx5_defs.h | 22 +- drivers/net/mlx5/mlx5_devx.c | 39 +- drivers/net/mlx5/mlx5_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_aso.c | 50 +- drivers/net/mlx5/mlx5_flow_dv.c | 66 +- drivers/net/mlx5/mlx5_flow_verbs.c | 4 +- drivers/net/mlx5/mlx5_mr.c | 397 ------------ drivers/net/mlx5/mlx5_mr.h | 26 - drivers/net/mlx5/mlx5_rx.c | 16 +- drivers/net/mlx5/mlx5_rx.h | 20 +- drivers/net/mlx5/mlx5_rxq.c | 11 +- drivers/net/mlx5/mlx5_rxtx.c | 1 - drivers/net/mlx5/mlx5_rxtx.h | 27 - drivers/net/mlx5/mlx5_rxtx_vec.h | 1 - drivers/net/mlx5/mlx5_trigger.c | 8 +- drivers/net/mlx5/mlx5_tx.c | 1 - drivers/net/mlx5/mlx5_tx.h | 30 +- drivers/net/mlx5/mlx5_txpp.c | 23 +- drivers/net/mlx5/mlx5_txq.c | 10 +- drivers/net/mlx5/windows/mlx5_ethdev_os.c | 12 +- drivers/net/mlx5/windows/mlx5_os.c | 402 ++---------- drivers/regex/mlx5/mlx5_regex.c | 144 +---- drivers/regex/mlx5/mlx5_regex.h | 27 +- drivers/regex/mlx5/mlx5_regex_control.c | 19 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 47 +- drivers/regex/mlx5/mlx5_rxp.c | 62 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 212 +------ drivers/vdpa/mlx5/mlx5_vdpa.h | 5 +- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 25 +- drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 6 +- drivers/vdpa/mlx5/mlx5_vdpa_mem.c | 13 +- drivers/vdpa/mlx5/mlx5_vdpa_steer.c | 11 +- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 15 +- 62 files changed, 2075 insertions(+), 2779 deletions(-) create mode 100644 drivers/common/mlx5/mlx5_common_defs.h delete mode 100644 drivers/net/mlx5/mlx5_mr.c delete mode 100644 drivers/net/mlx5/mlx5_mr.h -- 2.25.1