Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2017-10-10 12:24:52 +00:00
parent 6ff5b6bab2
commit 3cd4c11ab2

View File

@ -562,26 +562,6 @@ mlx5_make_default_gid(struct net_device *dev, union ib_gid *gid)
mlx5_addrconf_ifid_eui48(&gid->raw[8], dev);
}
static inline int
mlx5_ip2gid(const struct sockaddr *addr, union ib_gid *gid)
{
switch (addr->sa_family) {
case AF_INET:
ipv6_addr_set_v4mapped(((const struct sockaddr_in *)addr)->sin_addr.s_addr,
(struct in6_addr *)gid->raw);
break;
case AF_INET6:
memcpy(gid->raw, &((const struct sockaddr_in6 *)addr)->sin6_addr, 16);
/* clear SCOPE ID */
gid->raw[2] = 0;
gid->raw[3] = 0;
break;
default:
return -EINVAL;
}
return 0;
}
static void
mlx5_ib_roce_port_update(void *arg)
{
@ -639,7 +619,7 @@ mlx5_ib_roce_port_update(void *arg)
gid_index >= MLX5_IB_GID_MAX)
continue;
memset(&gid_temp, 0, sizeof(gid_temp));
mlx5_ip2gid(ifa->ifa_addr, &gid_temp);
rdma_ip2gid(ifa->ifa_addr, &gid_temp);
/* check for existing entry */
for (j = 0; j != gid_index; j++) {
if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0)