Commit ec6e1411 authored by Wen Gu's avatar Wen Gu Committed by Zhengchao Shao
Browse files

net/smc: ignore loopback-ism when dumping SMC-D devices

mainline inclusion
from mainline-v6.10-rc1
commit c8df2d449f645f90a67aaa05a617e6e86c3f1c5e
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IACM52

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c8df2d449f645f90a67aaa05a617e6e86c3f1c5e

--------------------------------

Since loopback-ism is not a PCI device, the PCI information fed back by
smc_nl_handle_smcd_dev() does not apply to loopback-ism. So currently
ignore loopback-ism when dumping SMC-D devices. The netlink function of
loopback-ism will be refactored when SMC netlink interface is updated.

Link: https://lore.kernel.org/r/caab067b-f5c3-490f-9259-262624c236b4@linux.ibm.com/


Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
Reviewed-and-tested-by: default avatarJan Karcher <jaka@linux.ibm.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 0c355fce
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -322,6 +322,8 @@ static void smc_nl_prep_smcd_dev(struct smcd_dev_list *dev_list,
	list_for_each_entry(smcd, &dev_list->list, list) {
		if (num < snum)
			goto next;
		if (smc_ism_is_loopback(smcd))
			goto next;
		if (smc_nl_handle_smcd_dev(smcd, skb, cb))
			goto errout;
next:
+5 −0
Original line number Diff line number Diff line
@@ -84,4 +84,9 @@ static inline bool smc_ism_is_emulated(struct smcd_dev *smcd)
	return __smc_ism_is_emulated(chid);
}

static inline bool smc_ism_is_loopback(struct smcd_dev *smcd)
{
	return (smcd->ops->get_chid(smcd) == 0xFFFF);
}

#endif