Commit f7f4b23e authored by Matan Barak's avatar Matan Barak Committed by Doug Ledford

IB/core: Rename rdma_addr_find_dmac_by_grh

rdma_addr_find_dmac_by_grh resolves dmac, vlan_id and if_index and
downsteram patch will also add hop_limit as an output parameter,
thus we rename it to rdma_addr_find_l2_eth_by_grh.
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 4bfdf635
...@@ -541,8 +541,9 @@ static void resolve_cb(int status, struct sockaddr *src_addr, ...@@ -541,8 +541,9 @@ static void resolve_cb(int status, struct sockaddr *src_addr,
complete(&((struct resolve_cb_context *)context)->comp); complete(&((struct resolve_cb_context *)context)->comp);
} }
int rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgid, int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
u8 *dmac, u16 *vlan_id, int *if_index) const union ib_gid *dgid,
u8 *dmac, u16 *vlan_id, int *if_index)
{ {
int ret = 0; int ret = 0;
struct rdma_dev_addr dev_addr; struct rdma_dev_addr dev_addr;
...@@ -584,7 +585,7 @@ int rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgi ...@@ -584,7 +585,7 @@ int rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgi
dev_put(dev); dev_put(dev);
return ret; return ret;
} }
EXPORT_SYMBOL(rdma_addr_find_dmac_by_grh); EXPORT_SYMBOL(rdma_addr_find_l2_eth_by_grh);
int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id)
{ {
......
...@@ -467,11 +467,11 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, ...@@ -467,11 +467,11 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num,
if (!idev) if (!idev)
return -ENODEV; return -ENODEV;
ret = rdma_addr_find_dmac_by_grh(&dgid, &sgid, ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid,
ah_attr->dmac, ah_attr->dmac,
wc->wc_flags & IB_WC_WITH_VLAN ? wc->wc_flags & IB_WC_WITH_VLAN ?
NULL : &vlan_id, NULL : &vlan_id,
&if_index); &if_index);
if (ret) { if (ret) {
dev_put(idev); dev_put(idev);
return ret; return ret;
...@@ -1158,10 +1158,10 @@ int ib_resolve_eth_dmac(struct ib_qp *qp, ...@@ -1158,10 +1158,10 @@ int ib_resolve_eth_dmac(struct ib_qp *qp,
ifindex = sgid_attr.ndev->ifindex; ifindex = sgid_attr.ndev->ifindex;
ret = rdma_addr_find_dmac_by_grh(&sgid, ret = rdma_addr_find_l2_eth_by_grh(&sgid,
&qp_attr->ah_attr.grh.dgid, &qp_attr->ah_attr.grh.dgid,
qp_attr->ah_attr.dmac, qp_attr->ah_attr.dmac,
NULL, &ifindex); NULL, &ifindex);
dev_put(sgid_attr.ndev); dev_put(sgid_attr.ndev);
} }
......
...@@ -152,9 +152,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) ...@@ -152,9 +152,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
if ((pd->uctx) && if ((pd->uctx) &&
(!rdma_is_multicast_addr((struct in6_addr *)attr->grh.dgid.raw)) && (!rdma_is_multicast_addr((struct in6_addr *)attr->grh.dgid.raw)) &&
(!rdma_link_local_addr((struct in6_addr *)attr->grh.dgid.raw))) { (!rdma_link_local_addr((struct in6_addr *)attr->grh.dgid.raw))) {
status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid, status = rdma_addr_find_l2_eth_by_grh(&sgid, &attr->grh.dgid,
attr->dmac, &vlan_tag, attr->dmac, &vlan_tag,
&sgid_attr.ndev->ifindex); &sgid_attr.ndev->ifindex);
if (status) { if (status) {
pr_err("%s(): Failed to resolve dmac from gid." pr_err("%s(): Failed to resolve dmac from gid."
"status = %d\n", __func__, status); "status = %d\n", __func__, status);
......
...@@ -130,8 +130,9 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, ...@@ -130,8 +130,9 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
int rdma_addr_size(struct sockaddr *addr); int rdma_addr_size(struct sockaddr *addr);
int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id); int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id);
int rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgid, int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
u8 *smac, u16 *vlan_id, int *if_index); const union ib_gid *dgid,
u8 *smac, u16 *vlan_id, int *if_index);
static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr) static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr)
{ {
......
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