[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1695134522-126655-14-git-send-email-guwen@linux.alibaba.com>
Date: Tue, 19 Sep 2023 22:41:57 +0800
From: Wen Gu <guwen@...ux.alibaba.com>
To: kgraul@...ux.ibm.com,
wenjia@...ux.ibm.com,
jaka@...ux.ibm.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: alibuda@...ux.alibaba.com,
tonylu@...ux.alibaba.com,
guwen@...ux.alibaba.com,
linux-s390@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next 13/18] net/smc: register loopback device as SMC-Dv2 device
After loopback device gets ready, add it to the smcd_dev list as an
SMC-Dv2 device for use by SMC-D protocol.
Signed-off-by: Wen Gu <guwen@...ux.alibaba.com>
---
net/smc/smc_loopback.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/net/smc/smc_loopback.c b/net/smc/smc_loopback.c
index 7807b38..650561b 100644
--- a/net/smc/smc_loopback.c
+++ b/net/smc/smc_loopback.c
@@ -303,18 +303,27 @@ static int smcd_lo_register_dev(struct smc_lo_dev *ldev)
ldev->smcd = smcd;
smcd->priv = ldev;
-
- /* TODO:
- * register smc_lo to smcd_dev list.
- */
+ mutex_lock(&smcd_dev_list.mutex);
+ smc_ism_check_v2_capable(smcd);
+ 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",
+ smc_lo_dev_name, smcd->pnetid,
+ smcd->pnetid_by_user ? " (user defined)" : "");
return 0;
}
static void smcd_lo_unregister_dev(struct smc_lo_dev *ldev)
{
- /* TODO:
- * unregister smc_lo from smcd_dev list.
- */
+ struct smcd_dev *smcd = ldev->smcd;
+
+ pr_warn_ratelimited("smc: removing smcd device %s\n",
+ smc_lo_dev_name);
+ smcd->going_away = 1;
+ smc_smcd_terminate_all(smcd);
+ mutex_lock(&smcd_dev_list.mutex);
+ list_del_init(&smcd->list);
+ mutex_unlock(&smcd_dev_list.mutex);
}
static void smc_lo_dev_release(struct device *dev)
--
1.8.3.1
Powered by blists - more mailing lists