-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDMA/restrack: Hide restrack DB from IB/core
There is no need to expose internals of restrack DB to IB/core. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
- Loading branch information
Leon Romanovsky
authored and
Jason Gunthorpe
committed
Feb 19, 2019
1 parent
4811852
commit 41eda65
Showing
6 changed files
with
114 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* | ||
* Copyright (c) 2017-2019 Mellanox Technologies. All rights reserved. | ||
*/ | ||
|
||
#ifndef _RDMA_CORE_RESTRACK_H_ | ||
#define _RDMA_CORE_RESTRACK_H_ | ||
|
||
#include <linux/mutex.h> | ||
#include <linux/rwsem.h> | ||
|
||
/** | ||
* struct rdma_restrack_root - main resource tracking management | ||
* entity, per-device | ||
*/ | ||
struct rdma_restrack_root { | ||
/* | ||
* @rwsem: Read/write lock to protect erase of entry. | ||
* Lists and insertions are protected by XArray internal lock. | ||
*/ | ||
struct rw_semaphore rwsem; | ||
/** | ||
* @xa: Array of XArray structures to hold restrack entries. | ||
* We want to use array of XArrays because insertion is type | ||
* dependent. For types with xisiting unique ID (like QPN), | ||
* we will insert to that unique index. For other types, | ||
* we insert based on pointers and auto-allocate unique index. | ||
*/ | ||
struct xarray xa[RDMA_RESTRACK_MAX]; | ||
/** | ||
* @next_id: Next ID to support cyclic allocation | ||
*/ | ||
u32 next_id[RDMA_RESTRACK_MAX]; | ||
}; | ||
|
||
|
||
int rdma_restrack_init(struct ib_device *dev); | ||
void rdma_restrack_clean(struct ib_device *dev); | ||
#endif /* _RDMA_CORE_RESTRACK_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters