Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: introduce CHID callback for ISM devices

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>

authored by

Ursula Braun and committed by
David S. Miller
8caaccf5 201091eb

+22
+12
drivers/s390/net/ism_drv.c
··· 414 414 *eid = &SYSTEM_EID.seid_string[0]; 415 415 } 416 416 417 + static u16 ism_get_chid(struct smcd_dev *smcd) 418 + { 419 + struct ism_dev *ismdev; 420 + 421 + ismdev = (struct ism_dev *)smcd->priv; 422 + if (!ismdev || !ismdev->pdev) 423 + return 0; 424 + 425 + return to_zpci(ismdev->pdev)->pchid; 426 + } 427 + 417 428 static void ism_handle_event(struct ism_dev *ism) 418 429 { 419 430 struct smcd_event *entry; ··· 482 471 .signal_event = ism_signal_ieq, 483 472 .move_data = ism_move, 484 473 .get_system_eid = ism_get_system_eid, 474 + .get_chid = ism_get_chid, 485 475 }; 486 476 487 477 static int ism_dev_init(struct ism_dev *ism)
+1
include/net/smc.h
··· 66 66 bool sf, unsigned int offset, void *data, 67 67 unsigned int size); 68 68 void (*get_system_eid)(struct smcd_dev *dev, u8 **eid); 69 + u16 (*get_chid)(struct smcd_dev *dev); 69 70 }; 70 71 71 72 struct smcd_dev {
+2
net/smc/af_smc.c
··· 566 566 smc_pnet_find_ism_resource(smc->clcsock->sk, ini); 567 567 if (!ini->ism_dev[0]) 568 568 return SMC_CLC_DECL_NOSMCDDEV; 569 + else 570 + ini->ism_chid[0] = smc_ism_get_chid(ini->ism_dev[0]); 569 571 return 0; 570 572 } 571 573
+1
net/smc/smc_core.h
··· 303 303 /* SMC-D */ 304 304 u64 ism_peer_gid[SMC_MAX_ISM_DEVS + 1]; 305 305 struct smcd_dev *ism_dev[SMC_MAX_ISM_DEVS + 1]; 306 + u16 ism_chid[SMC_MAX_ISM_DEVS + 1]; 306 307 }; 307 308 308 309 /* Find the connection associated with the given alert token in the link group.
+5
net/smc/smc_ism.c
··· 46 46 smcd->ops->get_system_eid(smcd, eid); 47 47 } 48 48 49 + u16 smc_ism_get_chid(struct smcd_dev *smcd) 50 + { 51 + return smcd->ops->get_chid(smcd); 52 + } 53 + 49 54 /* Set a connection using this DMBE. */ 50 55 void smc_ism_set_conn(struct smc_connection *conn) 51 56 {
+1
net/smc/smc_ism.h
··· 51 51 void *data, size_t len); 52 52 int smc_ism_signal_shutdown(struct smc_link_group *lgr); 53 53 void smc_ism_get_system_eid(struct smcd_dev *dev, u8 **eid); 54 + u16 smc_ism_get_chid(struct smcd_dev *dev); 54 55 void smc_ism_init(void); 55 56 #endif