diff options
author | Ursula Braun <ubraun@linux.ibm.com> | 2020-09-26 12:44:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-29 00:19:03 +0200 |
commit | d70bf4f7a99e324b8ad515b90dadec447f8c4c75 (patch) | |
tree | 3298ca3348c42f49afaea902e6ec0d1be290bcd6 /net/smc/smc_ism.c | |
parent | net/smc: introduce list of pnetids for Ethernet devices (diff) | |
download | linux-d70bf4f7a99e324b8ad515b90dadec447f8c4c75.tar.xz linux-d70bf4f7a99e324b8ad515b90dadec447f8c4c75.zip |
net/smc: determine proposed ISM devices
SMCD Version 2 allows to propose up to 8 additional ISM devices
offered to the peer as candidates for SMCD communication.
This patch covers determination of the ISM devices to be proposed.
ISM devices without PNETID are preferred, since ISM devices with
PNETID are a V1 leftover and will disappear over the time.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_ism.c')
-rw-r--r-- | net/smc/smc_ism.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index c5a5b70251b6..e9a6487a42cb 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c @@ -338,7 +338,11 @@ int smcd_register_dev(struct smcd_dev *smcd) if ((*system_eid) + 24 != '0' || (*system_eid) + 28 != '0') smc_ism_v2_capable = true; } - list_add_tail(&smcd->list, &smcd_dev_list.list); + /* sort list: devices without pnetid before devices with pnetid */ + if (smcd->pnetid[0]) + list_add_tail(&smcd->list, &smcd_dev_list.list); + else + list_add(&smcd->list, &smcd_dev_list.list); mutex_unlock(&smcd_dev_list.mutex); pr_warn_ratelimited("smc: adding smcd device %s with pnetid %.16s%s\n", |