RDMA/{core, cma}: Simplify rdma_translate_ip
Since no caller needs vlan, rdma_translate_ip is simplified to avoid vlan pointer. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
699a83f1eb
commit
575c7e583e
3 changed files with 6 additions and 11 deletions
|
@ -243,8 +243,7 @@ void rdma_copy_addr(struct rdma_dev_addr *dev_addr,
|
|||
EXPORT_SYMBOL(rdma_copy_addr);
|
||||
|
||||
int rdma_translate_ip(const struct sockaddr *addr,
|
||||
struct rdma_dev_addr *dev_addr,
|
||||
u16 *vlan_id)
|
||||
struct rdma_dev_addr *dev_addr)
|
||||
{
|
||||
struct net_device *dev;
|
||||
|
||||
|
@ -267,8 +266,6 @@ int rdma_translate_ip(const struct sockaddr *addr,
|
|||
|
||||
rdma_copy_addr(dev_addr, dev, NULL);
|
||||
dev_addr->bound_dev_if = dev->ifindex;
|
||||
if (vlan_id)
|
||||
*vlan_id = rdma_vlan_dev_vlan_id(dev);
|
||||
dev_put(dev);
|
||||
break;
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
|
@ -280,8 +277,6 @@ int rdma_translate_ip(const struct sockaddr *addr,
|
|||
dev, 1)) {
|
||||
rdma_copy_addr(dev_addr, dev, NULL);
|
||||
dev_addr->bound_dev_if = dev->ifindex;
|
||||
if (vlan_id)
|
||||
*vlan_id = rdma_vlan_dev_vlan_id(dev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -481,7 +476,7 @@ static int addr_resolve_neigh(struct dst_entry *dst,
|
|||
if (dst->dev->flags & IFF_LOOPBACK) {
|
||||
int ret;
|
||||
|
||||
ret = rdma_translate_ip(dst_in, addr, NULL);
|
||||
ret = rdma_translate_ip(dst_in, addr);
|
||||
if (!ret)
|
||||
memcpy(addr->dst_dev_addr, addr->src_dev_addr,
|
||||
MAX_ADDR_LEN);
|
||||
|
@ -558,7 +553,7 @@ static int addr_resolve(struct sockaddr *src_in,
|
|||
}
|
||||
|
||||
if (ndev->flags & IFF_LOOPBACK) {
|
||||
ret = rdma_translate_ip(dst_in, addr, NULL);
|
||||
ret = rdma_translate_ip(dst_in, addr);
|
||||
/*
|
||||
* Put the loopback device and get the translated
|
||||
* device instead.
|
||||
|
|
|
@ -601,7 +601,7 @@ static int cma_translate_addr(struct sockaddr *addr, struct rdma_dev_addr *dev_a
|
|||
int ret;
|
||||
|
||||
if (addr->sa_family != AF_IB) {
|
||||
ret = rdma_translate_ip(addr, dev_addr, NULL);
|
||||
ret = rdma_translate_ip(addr, dev_addr);
|
||||
} else {
|
||||
cma_translate_ib((struct sockaddr_ib *) addr, dev_addr);
|
||||
ret = 0;
|
||||
|
@ -2131,7 +2131,7 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,
|
|||
mutex_lock_nested(&conn_id->handler_mutex, SINGLE_DEPTH_NESTING);
|
||||
conn_id->state = RDMA_CM_CONNECT;
|
||||
|
||||
ret = rdma_translate_ip(laddr, &conn_id->id.route.addr.dev_addr, NULL);
|
||||
ret = rdma_translate_ip(laddr, &conn_id->id.route.addr.dev_addr);
|
||||
if (ret) {
|
||||
mutex_unlock(&conn_id->handler_mutex);
|
||||
rdma_destroy_id(new_cm_id);
|
||||
|
|
|
@ -94,7 +94,7 @@ struct rdma_dev_addr {
|
|||
* The dev_addr->net field must be initialized.
|
||||
*/
|
||||
int rdma_translate_ip(const struct sockaddr *addr,
|
||||
struct rdma_dev_addr *dev_addr, u16 *vlan_id);
|
||||
struct rdma_dev_addr *dev_addr);
|
||||
|
||||
/**
|
||||
* rdma_resolve_ip - Resolve source and destination IP addresses to
|
||||
|
|
Loading…
Reference in a new issue