mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 06:44:36 -05:00
Merge tag 'v6.18-rc4-smb-server-fixes' of git://git.samba.org/ksmbd
Pull smb server fixes from Steve French: - More safely detect RDMA capable devices correctly * tag 'v6.18-rc4-smb-server-fixes' of git://git.samba.org/ksmbd: ksmbd: detect RDMA capable netdevs include IPoIB ksmbd: detect RDMA capable lower devices when bridge and vlan netdev is used
This commit is contained in:
@@ -2606,7 +2606,7 @@ void ksmbd_rdma_destroy(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
|
||||
static bool ksmbd_find_rdma_capable_netdev(struct net_device *netdev)
|
||||
{
|
||||
struct smb_direct_device *smb_dev;
|
||||
int i;
|
||||
@@ -2648,6 +2648,28 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
|
||||
return rdma_capable;
|
||||
}
|
||||
|
||||
bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
|
||||
{
|
||||
struct net_device *lower_dev;
|
||||
struct list_head *iter;
|
||||
|
||||
if (ksmbd_find_rdma_capable_netdev(netdev))
|
||||
return true;
|
||||
|
||||
/* check if netdev is bridge or VLAN */
|
||||
if (netif_is_bridge_master(netdev) ||
|
||||
netdev->priv_flags & IFF_802_1Q_VLAN)
|
||||
netdev_for_each_lower_dev(netdev, lower_dev, iter)
|
||||
if (ksmbd_find_rdma_capable_netdev(lower_dev))
|
||||
return true;
|
||||
|
||||
/* check if netdev is IPoIB safely without layer violation */
|
||||
if (netdev->type == ARPHRD_INFINIBAND)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static const struct ksmbd_transport_ops ksmbd_smb_direct_transport_ops = {
|
||||
.prepare = smb_direct_prepare,
|
||||
.disconnect = smb_direct_disconnect,
|
||||
|
||||
Reference in New Issue
Block a user