Unverified Commit 8c008792 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7674 net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list()

parents 80a0681e c999ef0c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -797,6 +797,16 @@ static void smc_pnet_create_pnetids_list(struct net *net)
	u8 ndev_pnetid[SMC_MAX_PNETID_LEN];
	struct net_device *dev;

	/* Newly created netns do not have devices.
	 * Do not even acquire rtnl.
	 */
	if (list_empty(&net->dev_base_head))
		return;

	/* Note: This might not be needed, because smc_pnet_netdev_event()
	 * is also calling smc_pnet_add_base_pnetid() when handling
	 * NETDEV_UP event.
	 */
	rtnl_lock();
	for_each_netdev(net, dev)
		smc_pnet_add_base_pnetid(net, dev, ndev_pnetid);