Skip to content

Commit 693e1cd

Browse files
mustafakismailrleon
authored andcommitted
RDMA/irdma: Cleanup and rename irdma_netdev_vlan_ipv6()
The return value from irdma_netdev_vlan_ipv6() is not used. Rename the functions and change to a void return. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Link: https://lore.kernel.org/r/20230725155505.1069-5-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent e49bad7 commit 693e1cd

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

drivers/infiniband/hw/irdma/cm.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,21 +1591,20 @@ static u8 irdma_iw_get_vlan_prio(u32 *loc_addr, u8 prio, bool ipv4)
15911591
}
15921592

15931593
/**
1594-
* irdma_netdev_vlan_ipv6 - Gets the netdev and mac
1594+
* irdma_get_vlan_mac_ipv6 - Gets the vlan and mac
15951595
* @addr: local IPv6 address
15961596
* @vlan_id: vlan id for the given IPv6 address
15971597
* @mac: mac address for the given IPv6 address
15981598
*
1599-
* Returns the net_device of the IPv6 address and also sets the
1600-
* vlan id and mac for that address.
1599+
* Returns the vlan id and mac for an IPv6 address.
16011600
*/
1602-
struct net_device *irdma_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac)
1601+
void irdma_get_vlan_mac_ipv6(u32 *addr, u16 *vlan_id, u8 *mac)
16031602
{
16041603
struct net_device *ip_dev = NULL;
16051604
struct in6_addr laddr6;
16061605

16071606
if (!IS_ENABLED(CONFIG_IPV6))
1608-
return NULL;
1607+
return;
16091608

16101609
irdma_copy_ip_htonl(laddr6.in6_u.u6_addr32, addr);
16111610
if (vlan_id)
@@ -1624,8 +1623,6 @@ struct net_device *irdma_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac)
16241623
}
16251624
}
16261625
rcu_read_unlock();
1627-
1628-
return ip_dev;
16291626
}
16301627

16311628
/**
@@ -3666,8 +3663,8 @@ int irdma_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
36663663
cm_node->vlan_id = irdma_get_vlan_ipv4(cm_node->loc_addr);
36673664
} else {
36683665
cm_node->ipv4 = false;
3669-
irdma_netdev_vlan_ipv6(cm_node->loc_addr, &cm_node->vlan_id,
3670-
NULL);
3666+
irdma_get_vlan_mac_ipv6(cm_node->loc_addr, &cm_node->vlan_id,
3667+
NULL);
36713668
}
36723669
ibdev_dbg(&iwdev->ibdev, "CM: Accept vlan_id=%d\n",
36733670
cm_node->vlan_id);
@@ -3875,8 +3872,8 @@ int irdma_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
38753872
raddr6->sin6_addr.in6_u.u6_addr32);
38763873
cm_info.loc_port = ntohs(laddr6->sin6_port);
38773874
cm_info.rem_port = ntohs(raddr6->sin6_port);
3878-
irdma_netdev_vlan_ipv6(cm_info.loc_addr, &cm_info.vlan_id,
3879-
NULL);
3875+
irdma_get_vlan_mac_ipv6(cm_info.loc_addr, &cm_info.vlan_id,
3876+
NULL);
38803877
}
38813878
cm_info.cm_id = cm_id;
38823879
cm_info.qh_qpid = iwdev->vsi.ilq->qp_id;
@@ -4005,8 +4002,8 @@ int irdma_create_listen(struct iw_cm_id *cm_id, int backlog)
40054002
laddr6->sin6_addr.in6_u.u6_addr32);
40064003
cm_info.loc_port = ntohs(laddr6->sin6_port);
40074004
if (ipv6_addr_type(&laddr6->sin6_addr) != IPV6_ADDR_ANY) {
4008-
irdma_netdev_vlan_ipv6(cm_info.loc_addr,
4009-
&cm_info.vlan_id, NULL);
4005+
irdma_get_vlan_mac_ipv6(cm_info.loc_addr,
4006+
&cm_info.vlan_id, NULL);
40104007
} else {
40114008
cm_info.vlan_id = 0xFFFF;
40124009
wildcard = true;

drivers/infiniband/hw/irdma/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ void irdma_gen_ae(struct irdma_pci_f *rf, struct irdma_sc_qp *qp,
533533
void irdma_copy_ip_ntohl(u32 *dst, __be32 *src);
534534
void irdma_copy_ip_htonl(__be32 *dst, u32 *src);
535535
u16 irdma_get_vlan_ipv4(u32 *addr);
536-
struct net_device *irdma_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac);
536+
void irdma_get_vlan_mac_ipv6(u32 *addr, u16 *vlan_id, u8 *mac);
537537
struct ib_mr *irdma_reg_phys_mr(struct ib_pd *ib_pd, u64 addr, u64 size,
538538
int acc, u64 *iova_start);
539539
int irdma_upload_qp_context(struct irdma_qp *iwqp, bool freeze, bool raw);

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3994,7 +3994,7 @@ static int irdma_attach_mcast(struct ib_qp *ibqp, union ib_gid *ibgid, u16 lid)
39943994
if (!ipv6_addr_v4mapped((struct in6_addr *)ibgid)) {
39953995
irdma_copy_ip_ntohl(ip_addr,
39963996
sgid_addr.saddr_in6.sin6_addr.in6_u.u6_addr32);
3997-
irdma_netdev_vlan_ipv6(ip_addr, &vlan_id, NULL);
3997+
irdma_get_vlan_mac_ipv6(ip_addr, &vlan_id, NULL);
39983998
ipv4 = false;
39993999
ibdev_dbg(&iwdev->ibdev,
40004000
"VERBS: qp_id=%d, IP6address=%pI6\n", ibqp->qp_num,

0 commit comments

Comments
 (0)