Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/{cma, ucma}: Simplify and rename rdma_set_ib_paths

Since 2006 there has been no user of rdmacm based application to make use
of setting multiple path records using rdma_set_ib_paths API.

Therefore code is simplified to allow setting one path record entry.
Now that it sets only single path, it is renamed to reflect the same.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Parav Pandit and committed by
Jason Gunthorpe
fe75889f 9327c7af

+11 -11
+5 -5
drivers/infiniband/core/cma.c
··· 2517 2517 return ndev; 2518 2518 } 2519 2519 2520 - int rdma_set_ib_paths(struct rdma_cm_id *id, 2521 - struct sa_path_rec *path_rec, int num_paths) 2520 + int rdma_set_ib_path(struct rdma_cm_id *id, 2521 + struct sa_path_rec *path_rec) 2522 2522 { 2523 2523 struct rdma_id_private *id_priv; 2524 2524 int ret; ··· 2528 2528 RDMA_CM_ROUTE_RESOLVED)) 2529 2529 return -EINVAL; 2530 2530 2531 - id->route.path_rec = kmemdup(path_rec, sizeof *path_rec * num_paths, 2531 + id->route.path_rec = kmemdup(path_rec, sizeof(*path_rec), 2532 2532 GFP_KERNEL); 2533 2533 if (!id->route.path_rec) { 2534 2534 ret = -ENOMEM; 2535 2535 goto err; 2536 2536 } 2537 2537 2538 - id->route.num_paths = num_paths; 2538 + id->route.num_paths = 1; 2539 2539 return 0; 2540 2540 err: 2541 2541 cma_comp_exch(id_priv, RDMA_CM_ROUTE_RESOLVED, RDMA_CM_ADDR_RESOLVED); 2542 2542 return ret; 2543 2543 } 2544 - EXPORT_SYMBOL(rdma_set_ib_paths); 2544 + EXPORT_SYMBOL(rdma_set_ib_path); 2545 2545 2546 2546 static int cma_resolve_iw_route(struct rdma_id_private *id_priv, int timeout_ms) 2547 2547 {
+2 -2
drivers/infiniband/core/ucma.c
··· 1231 1231 struct sa_path_rec opa; 1232 1232 1233 1233 sa_convert_path_ib_to_opa(&opa, &sa_path); 1234 - ret = rdma_set_ib_paths(ctx->cm_id, &opa, 1); 1234 + ret = rdma_set_ib_path(ctx->cm_id, &opa); 1235 1235 } else { 1236 - ret = rdma_set_ib_paths(ctx->cm_id, &sa_path, 1); 1236 + ret = rdma_set_ib_path(ctx->cm_id, &sa_path); 1237 1237 } 1238 1238 if (ret) 1239 1239 return ret;
+4 -4
include/rdma/rdma_cm_ib.h
··· 36 36 #include <rdma/rdma_cm.h> 37 37 38 38 /** 39 - * rdma_set_ib_paths - Manually sets the path records used to establish a 39 + * rdma_set_ib_path - Manually sets the path record used to establish a 40 40 * connection. 41 41 * @id: Connection identifier associated with the request. 42 42 * @path_rec: Reference to the path record 43 43 * 44 44 * This call permits a user to specify routing information for rdma_cm_id's 45 - * bound to Infiniband devices. It is called on the client side of a 45 + * bound to InfiniBand devices. It is called on the client side of a 46 46 * connection and replaces the call to rdma_resolve_route. 47 47 */ 48 - int rdma_set_ib_paths(struct rdma_cm_id *id, 49 - struct sa_path_rec *path_rec, int num_paths); 48 + int rdma_set_ib_path(struct rdma_cm_id *id, 49 + struct sa_path_rec *path_rec); 50 50 51 51 /* Global qkey for UDP QPs and multicast groups. */ 52 52 #define RDMA_UDP_QKEY 0x01234567