Commit 85463316 authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

RDMA/core: Prefix _ib to IB/RoCE specific functions

In rdma cm module, functions which are common between IB and iWarp
are named with cma_.
iWarp specific functions are prefixed with cma_iw.
IB specific functions are perfixed with cma_ib.

However some functions in request processing path didn't follow
cma_ib notion. Prefix them with _ib for better code clarity.
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarDaniel Jurgens <danielj@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 79d684f0
......@@ -1514,7 +1514,7 @@ static struct rdma_id_private *cma_find_listener(
}
static struct rdma_id_private *
cma_id_from_event(struct ib_cm_id *cm_id,
cma_ib_id_from_event(struct ib_cm_id *cm_id,
const struct ib_cm_event *ib_event,
struct net_device **net_dev)
{
......@@ -1860,7 +1860,7 @@ static int cma_ib_handler(struct ib_cm_id *cm_id,
}
static struct rdma_id_private *
cma_new_conn_id(const struct rdma_cm_id *listen_id,
cma_ib_new_conn_id(const struct rdma_cm_id *listen_id,
const struct ib_cm_event *ib_event,
struct net_device *net_dev)
{
......@@ -1924,7 +1924,7 @@ cma_new_conn_id(const struct rdma_cm_id *listen_id,
}
static struct rdma_id_private *
cma_new_udp_id(const struct rdma_cm_id *listen_id,
cma_ib_new_udp_id(const struct rdma_cm_id *listen_id,
const struct ib_cm_event *ib_event,
struct net_device *net_dev)
{
......@@ -1982,7 +1982,7 @@ static void cma_set_req_event_data(struct rdma_cm_event *event,
event->param.conn.qp_num = req_data->remote_qpn;
}
static int cma_check_req_qp_type(const struct rdma_cm_id *id,
static int cma_ib_check_req_qp_type(const struct rdma_cm_id *id,
const struct ib_cm_event *ib_event)
{
return (((ib_event->event == IB_CM_REQ_RECEIVED) &&
......@@ -1992,7 +1992,7 @@ static int cma_check_req_qp_type(const struct rdma_cm_id *id,
(!id->qp_type));
}
static int cma_req_handler(struct ib_cm_id *cm_id,
static int cma_ib_req_handler(struct ib_cm_id *cm_id,
const struct ib_cm_event *ib_event)
{
struct rdma_id_private *listen_id, *conn_id = NULL;
......@@ -2001,11 +2001,11 @@ static int cma_req_handler(struct ib_cm_id *cm_id,
u8 offset;
int ret;
listen_id = cma_id_from_event(cm_id, ib_event, &net_dev);
listen_id = cma_ib_id_from_event(cm_id, ib_event, &net_dev);
if (IS_ERR(listen_id))
return PTR_ERR(listen_id);
if (!cma_check_req_qp_type(&listen_id->id, ib_event)) {
if (!cma_ib_check_req_qp_type(&listen_id->id, ib_event)) {
ret = -EINVAL;
goto net_dev_put;
}
......@@ -2019,12 +2019,12 @@ static int cma_req_handler(struct ib_cm_id *cm_id,
offset = cma_user_data_offset(listen_id);
event.event = RDMA_CM_EVENT_CONNECT_REQUEST;
if (ib_event->event == IB_CM_SIDR_REQ_RECEIVED) {
conn_id = cma_new_udp_id(&listen_id->id, ib_event, net_dev);
conn_id = cma_ib_new_udp_id(&listen_id->id, ib_event, net_dev);
event.param.ud.private_data = ib_event->private_data + offset;
event.param.ud.private_data_len =
IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE - offset;
} else {
conn_id = cma_new_conn_id(&listen_id->id, ib_event, net_dev);
conn_id = cma_ib_new_conn_id(&listen_id->id, ib_event, net_dev);
cma_set_req_event_data(&event, &ib_event->param.req_rcvd,
ib_event->private_data, offset);
}
......@@ -2276,7 +2276,8 @@ static int cma_ib_listen(struct rdma_id_private *id_priv)
addr = cma_src_addr(id_priv);
svc_id = rdma_get_service_id(&id_priv->id, addr);
id = ib_cm_insert_listen(id_priv->id.device, cma_req_handler, svc_id);
id = ib_cm_insert_listen(id_priv->id.device,
cma_ib_req_handler, svc_id);
if (IS_ERR(id))
return PTR_ERR(id);
id_priv->cm_id.ib = id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment