]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/smc: introduce CHID callback for ISM devices
authorUrsula Braun <ubraun@linux.ibm.com>
Sat, 26 Sep 2020 10:44:25 +0000 (12:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Sep 2020 22:19:03 +0000 (15:19 -0700)
With SMCD version 2 the CHIDs of ISM devices are needed for the
CLC handshake.
This patch provides the new callback to retrieve the CHID of an
ISM device.

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>
drivers/s390/net/ism_drv.c
include/net/smc.h
net/smc/af_smc.c
net/smc/smc_core.h
net/smc/smc_ism.c
net/smc/smc_ism.h

index c452ea5d9c8adb547a47063f8a3f924a4621fde3..fe96ca3c88a5a7a8bc38740c1ff9a4403b4c956f 100644 (file)
@@ -414,6 +414,17 @@ static void ism_get_system_eid(struct smcd_dev *smcd, u8 **eid)
        *eid = &SYSTEM_EID.seid_string[0];
 }
 
+static u16 ism_get_chid(struct smcd_dev *smcd)
+{
+       struct ism_dev *ismdev;
+
+       ismdev = (struct ism_dev *)smcd->priv;
+       if (!ismdev || !ismdev->pdev)
+               return 0;
+
+       return to_zpci(ismdev->pdev)->pchid;
+}
+
 static void ism_handle_event(struct ism_dev *ism)
 {
        struct smcd_event *entry;
@@ -471,6 +482,7 @@ static const struct smcd_ops ism_ops = {
        .signal_event = ism_signal_ieq,
        .move_data = ism_move,
        .get_system_eid = ism_get_system_eid,
+       .get_chid = ism_get_chid,
 };
 
 static int ism_dev_init(struct ism_dev *ism)
index b28b384d06250a1bebb140f4a02445730f55fc56..e441aa97ad61b1834f4983d10e15a34a7936f916 100644 (file)
@@ -66,6 +66,7 @@ struct smcd_ops {
                         bool sf, unsigned int offset, void *data,
                         unsigned int size);
        void (*get_system_eid)(struct smcd_dev *dev, u8 **eid);
+       u16 (*get_chid)(struct smcd_dev *dev);
 };
 
 struct smcd_dev {
index 8c1cde36adb80c137f548ecb7c1364b1bac73a2f..f02ed74a28e607cefdaf1c2d3fa817cc2a3f8703 100644 (file)
@@ -566,6 +566,8 @@ static int smc_find_ism_device(struct smc_sock *smc, struct smc_init_info *ini)
        smc_pnet_find_ism_resource(smc->clcsock->sk, ini);
        if (!ini->ism_dev[0])
                return SMC_CLC_DECL_NOSMCDDEV;
+       else
+               ini->ism_chid[0] = smc_ism_get_chid(ini->ism_dev[0]);
        return 0;
 }
 
index ec86084b0dfda189ebb0138e4d69e143c02b00c8..d33bcbc3238f3d389702e65881b2ccb82f55edd4 100644 (file)
@@ -303,6 +303,7 @@ struct smc_init_info {
        /* SMC-D */
        u64                     ism_peer_gid[SMC_MAX_ISM_DEVS + 1];
        struct smcd_dev         *ism_dev[SMC_MAX_ISM_DEVS + 1];
+       u16                     ism_chid[SMC_MAX_ISM_DEVS + 1];
 };
 
 /* Find the connection associated with the given alert token in the link group.
index 63c3dd5578bf0d24cdae1309271c26c55da7e6bb..c5a5b70251b6e2c8ad4501e5f5566c1e7384dc1f 100644 (file)
@@ -46,6 +46,11 @@ void smc_ism_get_system_eid(struct smcd_dev *smcd, u8 **eid)
        smcd->ops->get_system_eid(smcd, eid);
 }
 
+u16 smc_ism_get_chid(struct smcd_dev *smcd)
+{
+       return smcd->ops->get_chid(smcd);
+}
+
 /* Set a connection using this DMBE. */
 void smc_ism_set_conn(struct smc_connection *conn)
 {
index 816d86361e1a7aa16824b3f80499f37ce1b1a287..8048e09ddcf86295ee101532f033f340d134a59f 100644 (file)
@@ -51,5 +51,6 @@ int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
                  void *data, size_t len);
 int smc_ism_signal_shutdown(struct smc_link_group *lgr);
 void smc_ism_get_system_eid(struct smcd_dev *dev, u8 **eid);
+u16 smc_ism_get_chid(struct smcd_dev *dev);
 void smc_ism_init(void);
 #endif