From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E7E6A04A4; Wed, 3 Jun 2020 17:07:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A52251D59E; Wed, 3 Jun 2020 17:06:15 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) by dpdk.org (Postfix) with ESMTP id C3A351D55E for ; Wed, 3 Jun 2020 17:06:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiwzC9f62xdYb7uMRv/w13bpBpHVHu2vQw6hTeOYE/TJoYHh++1X/wLfbIpVJOO4WIQzLiDdQheV4/nzBfiP8aAVN/BBgL5lv5kM96fpz9TO6hX2VasyMnLZvmb/Whzj+BznYB6qTnq942QM7YaQ/PlpbuTLG3xzEagktXdHZRKwujw2dEwWCfq3AMT/aYotRuT/8AilnJq5VUTR4hVXJrAb1LTC+PXwWKIRBu8zqgtz9hOIWN7MdbcdxdHYH+Zfio2XQdmpOiiGR81cmLfF1NfLGTaS6l31zQ8+AAWEEXFFCkv9o6tzQCiBwsNtlYRnGEPG1JKtZmBuqJcRwR8tzw== 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-SenderADCheck; bh=xvCXPOTELFaxO7FGq/rvtyWLbHy6iME3ckGoHzwnXKE=; b=lrxn7je93/PAtBuebaT/1LIw0NSkK4/d4uAxJ7t+f5/VSgh5NcHI5NHqwf1+0IQQ9gFPrqSg9sOrHM7wbjSZAXzs6GWjEm5e5FalvjIESt6MnbnJk0N6mdvBQLWQdMItKbTGA7f7xbW5DfjRNYpc0LVSRv2HZDPYfI3WpJpckYgGDh0nm1iEWFH20oZQy4aCcgmhiQy89tjAcLrndQdLHAUuE4QFffG4cCW3rN0p8Ygz73vylokf76a2YkyRaBGkZbAgiSAkCieVnHu1A2Z1caw7xjIm0/zX1wH+PFjkWRF7zLNhgHlkWssnCPrjCR0ZZCC3GfstMSM2ud5hNArHVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvCXPOTELFaxO7FGq/rvtyWLbHy6iME3ckGoHzwnXKE=; b=p1cgSS32grpGtZgAAh9E3F3oOrdZVqHbL+3XkTnF4hXJxNv5ijF9x3lCMjtchanzRDb9/YT2LXmCmg9DvAv8ECIWhorotSRy65y37b+VB7G9H0NLXj09znGSdZYwDmKkd2xcFqcDVoImv3SaK/cLWW7GV4uNKEgIBCa4hc553zw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) by AM0PR05MB5235.eurprd05.prod.outlook.com (2603:10a6:208:f5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Wed, 3 Jun 2020 15:06:10 +0000 Received: from AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::1068:89a9:41d3:b14a]) by AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::1068:89a9:41d3:b14a%3]) with mapi id 15.20.3066.018; Wed, 3 Jun 2020 15:06:10 +0000 From: Ophir Munk To: dev@dpdk.org, Matan Azrad , Raslan Darawsheh Cc: Ophir Munk Date: Wed, 3 Jun 2020 15:05:57 +0000 Message-Id: <20200603150602.4686-4-ophirmu@mellanox.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200603150602.4686-1-ophirmu@mellanox.com> References: <20200603150602.4686-1-ophirmu@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4PR0302CA0033.eurprd03.prod.outlook.com (2603:10a6:205:2::46) To AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4PR0302CA0033.eurprd03.prod.outlook.com (2603:10a6:205:2::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.19 via Frontend Transport; Wed, 3 Jun 2020 15:06:10 +0000 X-Mailer: git-send-email 2.8.4 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f16f41d1-2c76-4228-6f37-08d807cfa676 X-MS-TrafficTypeDiagnostic: AM0PR05MB5235: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-Forefront-PRVS: 04238CD941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xzawn82w+0BFe3ocWVNkBwsKJXDrm5k1RPdwNjqMLojdiACOyiiLA+ZArxZMoeH82ruG7UbzLtnbAoCBgSZhj+igdWFavAXLe31v7IaQy02cXtek37xKVaB4YH3kRe1BsLj88Hgm1iOQ5AVdGi6vYJTjP6mkzvxEP/67tx1dKMB5zIbDllsNYi+F6i/UHgAewZUd6W1GuP0QrwRyS4DeqnkzAIFylc4OVViYnJAYEP3IkZWUwg7cqR6gsXaSY3L7+7Xw8F451loYvCBoU+Av9BfYpGqswUCNdM324vp83ISc96cVtcjzCghFDOEKtDdFJI2RjAEPJvLqvYTrqXjsRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4209.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(366004)(136003)(346002)(39860400002)(376002)(26005)(4326008)(186003)(478600001)(316002)(8676002)(16526019)(8886007)(6666004)(2906002)(66476007)(8936002)(66946007)(956004)(66556008)(2616005)(55016002)(107886003)(86362001)(83380400001)(36756003)(6636002)(7696005)(5660300002)(1076003)(52116002)(110136005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yx5vTbUYMlh68vm5VANuUDAjHkGxZGhF6alrtofZCX+Hf7eIvKYp8u6n/plvn1NPSk6zI6yiDwsD5/D0MqcfWZwymQDOGfxDx9gdYAEvCclOBvAntzeFbukPvCQ7UEPxTAeQHjgWMQpskfRHz2CijgliiSaB7dloRR2F3qW7hWZ1kpn7ekDrlRk+3XVhCT0vruZQPfFK4llcxVS4FA0wy1GO/6ATypa1nPR+28wTZRXmXJCggyTIN7U7MbF6ruHRK00VKxjMn+j52u5VDWcdkxOdxANyuo4lYmJXP2JWNEHo89UiU535j/JPuEjEnJnPfKX8iacdg5ExuvfRzG/3tld7YB0dO4KnVR2aUS9PvOFHsO6otMngsQUUdDym9tSwr59pt0PseA66C3EQshUDGBppW3bQl0YOv72t1Z4chvx8kQus5rBAZUULGnVWck16BfH0cE9xeI7zwPxl6GKg63pjABCJ3uxONNQ7yPUrwJJPHAOnhsEyveEBu8mLIdKq X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f16f41d1-2c76-4228-6f37-08d807cfa676 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2020 15:06:10.7798 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xX44boGi4JbaYipBb8ApOqplzmTkRKWAOhE6UY9nbQ1ZwXJvHptV7O2vFVFmvZxU77y4oGulSfGlbMxAg/jW9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5235 Subject: [dpdk-dev] [PATCH v1 3/8] drivers: remove mlx5 protection domain dependency on ibv X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Replace 'struct ibv_pd *' with 'void *' in struct mlx5_ctx_shared and all function calls in mlx5 PMD. Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_common_mr.c | 24 ++++++++++++------------ drivers/common/mlx5/mlx5_common_mr.h | 6 +++--- drivers/net/mlx5/mlx5.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c index 3b46446..e894523 100644 --- a/drivers/common/mlx5/mlx5_common_mr.c +++ b/drivers/common/mlx5/mlx5_common_mr.c @@ -521,7 +521,7 @@ mr_find_contig_memsegs_cb(const struct rte_memseg_list *msl, * request fails. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd of a device (net, regex, vdpa,...). * @param share_cache * Pointer to a global shared MR cache. * @param[out] entry @@ -536,7 +536,7 @@ mr_find_contig_memsegs_cb(const struct rte_memseg_list *msl, * Searched LKey on success, UINT32_MAX on failure and rte_errno is set. */ static uint32_t -mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused, +mlx5_mr_create_secondary(void *pd __rte_unused, struct mlx5_mp_id *mp_id, struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr, @@ -569,7 +569,7 @@ mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused, * Register entire virtually contiguous memory chunk around the address. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd of a device (net, regex, vdpa,...). * @param share_cache * Pointer to a global shared MR cache. * @param[out] entry @@ -584,7 +584,7 @@ mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused, * Searched LKey on success, UINT32_MAX on failure and rte_errno is set. */ uint32_t -mlx5_mr_create_primary(struct ibv_pd *pd, +mlx5_mr_create_primary(void *pd, struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr, unsigned int mr_ext_memseg_en) @@ -816,7 +816,7 @@ mlx5_mr_create_primary(struct ibv_pd *pd, * This can be called from primary and secondary process. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd handle of a device (net, regex, vdpa,...). * @param share_cache * Pointer to a global shared MR cache. * @param[out] entry @@ -829,7 +829,7 @@ mlx5_mr_create_primary(struct ibv_pd *pd, * Searched LKey on success, UINT32_MAX on failure and rte_errno is set. */ static uint32_t -mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, +mlx5_mr_create(void *pd, struct mlx5_mp_id *mp_id, struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr, unsigned int mr_ext_memseg_en) @@ -856,7 +856,7 @@ mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, * Insert the found/created entry to local bottom-half cache table. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd of a device (net, regex, vdpa,...). * @param share_cache * Pointer to a global shared MR cache. * @param mr_ctrl @@ -871,7 +871,7 @@ mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, * Searched LKey on success, UINT32_MAX on no match. */ static uint32_t -mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, +mr_lookup_caches(void *pd, struct mlx5_mp_id *mp_id, struct mlx5_mr_share_cache *share_cache, struct mlx5_mr_ctrl *mr_ctrl, struct mr_cache_entry *entry, uintptr_t addr, @@ -920,7 +920,7 @@ mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, * per-queue local caches. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd of a device (net, regex, vdpa,...). * @param share_cache * Pointer to a global shared MR cache. * @param mr_ctrl @@ -931,7 +931,7 @@ mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, * @return * Searched LKey on success, UINT32_MAX on no match. */ -uint32_t mlx5_mr_addr2mr_bh(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, +uint32_t mlx5_mr_addr2mr_bh(void *pd, struct mlx5_mp_id *mp_id, struct mlx5_mr_share_cache *share_cache, struct mlx5_mr_ctrl *mr_ctrl, uintptr_t addr, unsigned int mr_ext_memseg_en) @@ -1022,7 +1022,7 @@ mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl) * part of the DPDK memory segments. * * @param pd - * Pointer to ibv_pd of a device (net, regex, vdpa,...). + * Pointer to pd of a device (net, regex, vdpa,...). * @param addr * Starting virtual address of memory. * @param len @@ -1034,7 +1034,7 @@ mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl) * Pointer to MR structure on success, NULL otherwise. */ struct mlx5_mr * -mlx5_create_mr_ext(struct ibv_pd *pd, uintptr_t addr, size_t len, int socket_id) +mlx5_create_mr_ext(void *pd, uintptr_t addr, size_t len, int socket_id) { struct mlx5_mr *mr = NULL; diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h index 4ea47cd..7add4da 100644 --- a/drivers/common/mlx5/mlx5_common_mr.h +++ b/drivers/common/mlx5/mlx5_common_mr.h @@ -122,7 +122,7 @@ void mlx5_mr_btree_free(struct mlx5_mr_btree *bt); __rte_internal void mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused); __rte_internal -uint32_t mlx5_mr_addr2mr_bh(struct ibv_pd *pd, struct mlx5_mp_id *mp_id, +uint32_t mlx5_mr_addr2mr_bh(void *pd, struct mlx5_mp_id *mp_id, struct mlx5_mr_share_cache *share_cache, struct mlx5_mr_ctrl *mr_ctrl, uintptr_t addr, unsigned int mr_ext_memseg_en); @@ -148,11 +148,11 @@ mlx5_mr_lookup_list(struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr); __rte_internal struct mlx5_mr * -mlx5_create_mr_ext(struct ibv_pd *pd, uintptr_t addr, size_t len, +mlx5_create_mr_ext(void *pd, uintptr_t addr, size_t len, int socket_id); __rte_internal uint32_t -mlx5_mr_create_primary(struct ibv_pd *pd, +mlx5_mr_create_primary(void *pd, struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr, unsigned int mr_ext_memseg_en); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index d020c10..30678aa 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -494,7 +494,7 @@ struct mlx5_dev_ctx_shared { uint32_t devx:1; /* Opened with DV. */ uint32_t max_port; /* Maximal IB device port index. */ void *ctx; /* Verbs/DV/DevX context. */ - struct ibv_pd *pd; /* Protection Domain. */ + void *pd; /* Protection Domain. */ uint32_t pdn; /* Protection Domain number. */ uint32_t tdn; /* Transport Domain number. */ char ibdev_name[IBV_SYSFS_NAME_MAX]; /* IB device name. */ -- 2.8.4