Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit fe75889

Browse files
paravmellanoxjgunthorpe
authored andcommitted
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 <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 9327c7a commit fe75889

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

drivers/infiniband/core/cma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,8 +2517,8 @@ cma_iboe_set_path_rec_l2_fields(struct rdma_id_private *id_priv)
25172517
return ndev;
25182518
}
25192519

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)
25222522
{
25232523
struct rdma_id_private *id_priv;
25242524
int ret;
@@ -2528,20 +2528,20 @@ int rdma_set_ib_paths(struct rdma_cm_id *id,
25282528
RDMA_CM_ROUTE_RESOLVED))
25292529
return -EINVAL;
25302530

2531-
id->route.path_rec = kmemdup(path_rec, sizeof *path_rec * num_paths,
2531+
id->route.path_rec = kmemdup(path_rec, sizeof(*path_rec),
25322532
GFP_KERNEL);
25332533
if (!id->route.path_rec) {
25342534
ret = -ENOMEM;
25352535
goto err;
25362536
}
25372537

2538-
id->route.num_paths = num_paths;
2538+
id->route.num_paths = 1;
25392539
return 0;
25402540
err:
25412541
cma_comp_exch(id_priv, RDMA_CM_ROUTE_RESOLVED, RDMA_CM_ADDR_RESOLVED);
25422542
return ret;
25432543
}
2544-
EXPORT_SYMBOL(rdma_set_ib_paths);
2544+
EXPORT_SYMBOL(rdma_set_ib_path);
25452545

25462546
static int cma_resolve_iw_route(struct rdma_id_private *id_priv, int timeout_ms)
25472547
{

drivers/infiniband/core/ucma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,9 @@ static int ucma_set_ib_path(struct ucma_context *ctx,
12311231
struct sa_path_rec opa;
12321232

12331233
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);
12351235
} else {
1236-
ret = rdma_set_ib_paths(ctx->cm_id, &sa_path, 1);
1236+
ret = rdma_set_ib_path(ctx->cm_id, &sa_path);
12371237
}
12381238
if (ret)
12391239
return ret;

include/rdma/rdma_cm_ib.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
#include <rdma/rdma_cm.h>
3737

3838
/**
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
4040
* connection.
4141
* @id: Connection identifier associated with the request.
4242
* @path_rec: Reference to the path record
4343
*
4444
* 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
4646
* connection and replaces the call to rdma_resolve_route.
4747
*/
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);
5050

5151
/* Global qkey for UDP QPs and multicast groups. */
5252
#define RDMA_UDP_QKEY 0x01234567

0 commit comments

Comments
 (0)