aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rxe/rxe_pool.h
diff options
context:
space:
mode:
authorBob Pearson <rpearsonhpe@gmail.com>2021-06-07 23:25:45 -0500
committerJason Gunthorpe <jgg@nvidia.com>2021-06-16 20:51:17 -0300
commit08224016abde5ddca25bb976a66c974b2e2bdbed (patch)
tree222b045969cccc66f1a014b871573726fa3ffd2a /drivers/infiniband/sw/rxe/rxe_pool.h
parentRDMA/rxe: Add bind MW fields to rxe_send_wr (diff)
downloadlinux-dev-08224016abde5ddca25bb976a66c974b2e2bdbed.tar.xz
linux-dev-08224016abde5ddca25bb976a66c974b2e2bdbed.zip
RDMA/rxe: Return errors for add index and key
Modify rxe_add_index() and rxe_add_key() to return an error if the index or key is aleady present in the pool. Currently they print a warning and silently fail with bad consequences to the caller. Link: https://lore.kernel.org/r/20210608042552.33275-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_pool.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_pool.h b/drivers/infiniband/sw/rxe/rxe_pool.h
index 61210b300a78..1feca1bffced 100644
--- a/drivers/infiniband/sw/rxe/rxe_pool.h
+++ b/drivers/infiniband/sw/rxe/rxe_pool.h
@@ -111,11 +111,11 @@ int __rxe_add_to_pool(struct rxe_pool *pool, struct rxe_pool_entry *elem);
/* assign an index to an indexed object and insert object into
* pool's rb tree holding and not holding the pool_lock
*/
-void __rxe_add_index_locked(struct rxe_pool_entry *elem);
+int __rxe_add_index_locked(struct rxe_pool_entry *elem);
#define rxe_add_index_locked(obj) __rxe_add_index_locked(&(obj)->pelem)
-void __rxe_add_index(struct rxe_pool_entry *elem);
+int __rxe_add_index(struct rxe_pool_entry *elem);
#define rxe_add_index(obj) __rxe_add_index(&(obj)->pelem)
@@ -133,11 +133,11 @@ void __rxe_drop_index(struct rxe_pool_entry *elem);
/* assign a key to a keyed object and insert object into
* pool's rb tree holding and not holding pool_lock
*/
-void __rxe_add_key_locked(struct rxe_pool_entry *elem, void *key);
+int __rxe_add_key_locked(struct rxe_pool_entry *elem, void *key);
#define rxe_add_key_locked(obj, key) __rxe_add_key_locked(&(obj)->pelem, key)
-void __rxe_add_key(struct rxe_pool_entry *elem, void *key);
+int __rxe_add_key(struct rxe_pool_entry *elem, void *key);
#define rxe_add_key(obj, key) __rxe_add_key(&(obj)->pelem, key)