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

IB/{core, umad, cm}: Rename ib_init_ah_from_wc to ib_init_ah_attr_from_wc

Currently ib_init_ah_from_wc initializes address handle attributes and
not the address handle object itself.
To avoid confusion between ah_attr vs ah, ib_init_ah_from_wc is
renamed to ib_init_ah_attr_from_wc to reflect that its initialzes
ah_attr.
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarDaniel Jurgens <danielj@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 4ad6a024
...@@ -457,8 +457,9 @@ static int cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc, ...@@ -457,8 +457,9 @@ static int cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
{ {
av->port = port; av->port = port;
av->pkey_index = wc->pkey_index; av->pkey_index = wc->pkey_index;
return ib_init_ah_from_wc(port->cm_dev->ib_device, port->port_num, wc, return ib_init_ah_attr_from_wc(port->cm_dev->ib_device,
grh, &av->ah_attr); port->port_num, wc,
grh, &av->ah_attr);
} }
static int cm_init_av_by_path(struct sa_path_rec *path, struct cm_av *av, static int cm_init_av_by_path(struct sa_path_rec *path, struct cm_av *av,
......
...@@ -248,10 +248,10 @@ static void recv_handler(struct ib_mad_agent *agent, ...@@ -248,10 +248,10 @@ static void recv_handler(struct ib_mad_agent *agent,
const struct ib_global_route *grh; const struct ib_global_route *grh;
int ret; int ret;
ret = ib_init_ah_from_wc(agent->device, agent->port_num, ret = ib_init_ah_attr_from_wc(agent->device, agent->port_num,
mad_recv_wc->wc, mad_recv_wc->wc,
mad_recv_wc->recv_buf.grh, mad_recv_wc->recv_buf.grh,
&ah_attr); &ah_attr);
if (ret) if (ret)
goto err2; goto err2;
......
...@@ -526,7 +526,7 @@ static int ib_resolve_unicast_gid_dmac(struct ib_device *device, ...@@ -526,7 +526,7 @@ static int ib_resolve_unicast_gid_dmac(struct ib_device *device,
} }
/* /*
* This function creates ah from the incoming packet. * This function initializes address handle attributes from the incoming packet.
* Incoming packet has dgid of the receiver node on which this code is * Incoming packet has dgid of the receiver node on which this code is
* getting executed and, sgid contains the GID of the sender. * getting executed and, sgid contains the GID of the sender.
* *
...@@ -535,9 +535,9 @@ static int ib_resolve_unicast_gid_dmac(struct ib_device *device, ...@@ -535,9 +535,9 @@ static int ib_resolve_unicast_gid_dmac(struct ib_device *device,
* GID whom to respond to. * GID whom to respond to.
* *
*/ */
int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, int ib_init_ah_attr_from_wc(struct ib_device *device, u8 port_num,
const struct ib_wc *wc, const struct ib_grh *grh, const struct ib_wc *wc, const struct ib_grh *grh,
struct rdma_ah_attr *ah_attr) struct rdma_ah_attr *ah_attr)
{ {
u32 flow_class; u32 flow_class;
u16 gid_index; u16 gid_index;
...@@ -611,7 +611,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, ...@@ -611,7 +611,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num,
return 0; return 0;
} }
} }
EXPORT_SYMBOL(ib_init_ah_from_wc); EXPORT_SYMBOL(ib_init_ah_attr_from_wc);
struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, const struct ib_wc *wc, struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, const struct ib_wc *wc,
const struct ib_grh *grh, u8 port_num) const struct ib_grh *grh, u8 port_num)
...@@ -619,7 +619,7 @@ struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, const struct ib_wc *wc, ...@@ -619,7 +619,7 @@ struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, const struct ib_wc *wc,
struct rdma_ah_attr ah_attr; struct rdma_ah_attr ah_attr;
int ret; int ret;
ret = ib_init_ah_from_wc(pd->device, port_num, wc, grh, &ah_attr); ret = ib_init_ah_attr_from_wc(pd->device, port_num, wc, grh, &ah_attr);
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
......
...@@ -2904,7 +2904,7 @@ int ib_get_gids_from_rdma_hdr(const union rdma_network_hdr *hdr, ...@@ -2904,7 +2904,7 @@ int ib_get_gids_from_rdma_hdr(const union rdma_network_hdr *hdr,
int ib_get_rdma_header_version(const union rdma_network_hdr *hdr); int ib_get_rdma_header_version(const union rdma_network_hdr *hdr);
/** /**
* ib_init_ah_from_wc - Initializes address handle attributes from a * ib_init_ah_attr_from_wc - Initializes address handle attributes from a
* work completion. * work completion.
* @device: Device on which the received message arrived. * @device: Device on which the received message arrived.
* @port_num: Port on which the received message arrived. * @port_num: Port on which the received message arrived.
...@@ -2914,9 +2914,9 @@ int ib_get_rdma_header_version(const union rdma_network_hdr *hdr); ...@@ -2914,9 +2914,9 @@ int ib_get_rdma_header_version(const union rdma_network_hdr *hdr);
* @ah_attr: Returned attributes that can be used when creating an address * @ah_attr: Returned attributes that can be used when creating an address
* handle for replying to the message. * handle for replying to the message.
*/ */
int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, int ib_init_ah_attr_from_wc(struct ib_device *device, u8 port_num,
const struct ib_wc *wc, const struct ib_grh *grh, const struct ib_wc *wc, const struct ib_grh *grh,
struct rdma_ah_attr *ah_attr); struct rdma_ah_attr *ah_attr);
/** /**
* ib_create_ah_from_wc - Creates an address handle associated with the * ib_create_ah_from_wc - Creates an address handle associated with the
......
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