Commit 8caaccf5 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

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: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 201091eb
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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)
+1 −0
Original line number Diff line number Diff line
@@ -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 {
+2 −0
Original line number Diff line number Diff line
@@ -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;
}

+1 −0
Original line number Diff line number Diff line
@@ -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.
+5 −0
Original line number Diff line number Diff line
@@ -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)
{
Loading