Commit 56809c8d authored by Wen Gu's avatar Wen Gu Committed by Zhengchao Shao
Browse files

net/smc: change the term virtual ISM to Emulated-ISM

mainline inclusion
from mainline-v6.9-rc1
commit b27696cd8fcc0ace1b2dfd81b7bff824a30b1fd1
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IACM52

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b27696cd8fcc0ace1b2dfd81b7bff824a30b1fd1

--------------------------------

According to latest release of SMCv2.1[1], the term 'virtual ISM' has
been changed to 'Emulated-ISM' to avoid the ambiguity of the word
'virtual' in different contexts. So the names or comments in the code
need be modified accordingly.

[1] https://www.ibm.com/support/pages/node/7112343



Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
Link: https://lore.kernel.org/r/20240205033317.127269-1-guwen@linux.alibaba.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent bc1dde56
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -1045,7 +1045,7 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
	int rc = SMC_CLC_DECL_NOSMCDDEV;
	struct smcd_dev *smcd;
	int i = 1, entry = 1;
	bool is_virtual;
	bool is_emulated;
	u16 chid;

	if (smcd_indicated(ini->smc_type_v1))
@@ -1057,12 +1057,12 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
		chid = smc_ism_get_chid(smcd);
		if (!smc_find_ism_v2_is_unique_chid(chid, ini, i))
			continue;
		is_virtual = __smc_ism_is_virtual(chid);
		is_emulated = __smc_ism_is_emulated(chid);
		if (!smc_pnet_is_pnetid_set(smcd->pnetid) ||
		    smc_pnet_is_ndev_pnetid(sock_net(&smc->sk), smcd->pnetid)) {
			if (is_virtual && entry == SMCD_CLC_MAX_V2_GID_ENTRIES)
			if (is_emulated && entry == SMCD_CLC_MAX_V2_GID_ENTRIES)
				/* It's the last GID-CHID entry left in CLC
				 * Proposal SMC-Dv2 extension, but a virtual
				 * Proposal SMC-Dv2 extension, but an Emulated-
				 * ISM device will take two entries. So give
				 * up it and try the next potential ISM device.
				 */
@@ -1072,7 +1072,7 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
			ini->is_smcd = true;
			rc = 0;
			i++;
			entry = is_virtual ? entry + 2 : entry + 1;
			entry = is_emulated ? entry + 2 : entry + 1;
			if (entry > SMCD_CLC_MAX_V2_GID_ENTRIES)
				break;
		}
@@ -1413,10 +1413,10 @@ static int smc_connect_ism(struct smc_sock *smc,
		if (rc)
			return rc;

		if (__smc_ism_is_virtual(ini->ism_chid[ini->ism_selected]))
		if (__smc_ism_is_emulated(ini->ism_chid[ini->ism_selected]))
			ini->ism_peer_gid[ini->ism_selected].gid_ext =
						ntohll(aclc->d1.gid_ext);
		/* for non-virtual ISM devices, peer gid_ext remains 0. */
		/* for non-Emulated-ISM devices, peer gid_ext remains 0. */
	}
	ini->ism_peer_gid[ini->ism_selected].gid = ntohll(aclc->d0.gid);

@@ -2117,10 +2117,10 @@ static void smc_check_ism_v2_match(struct smc_init_info *ini,
		if (smc_ism_get_chid(smcd) == proposed_chid &&
		    !smc_ism_cantalk(proposed_gid, ISM_RESERVED_VLANID, smcd)) {
			ini->ism_peer_gid[*matches].gid = proposed_gid->gid;
			if (__smc_ism_is_virtual(proposed_chid))
			if (__smc_ism_is_emulated(proposed_chid))
				ini->ism_peer_gid[*matches].gid_ext =
							proposed_gid->gid_ext;
				/* non-virtual ISM's peer gid_ext remains 0. */
				/* non-Emulated-ISM's peer gid_ext remains 0. */
			ini->ism_dev[*matches] = smcd;
			(*matches)++;
			break;
@@ -2170,10 +2170,10 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
		smcd_gid.gid = ntohll(smcd_v2_ext->gidchid[i].gid);
		smcd_gid.gid_ext = 0;
		chid = ntohs(smcd_v2_ext->gidchid[i].chid);
		if (__smc_ism_is_virtual(chid)) {
		if (__smc_ism_is_emulated(chid)) {
			if ((i + 1) == smc_v2_ext->hdr.ism_gid_cnt ||
			    chid != ntohs(smcd_v2_ext->gidchid[i + 1].chid))
				/* each virtual ISM device takes two GID-CHID
				/* each Emulated-ISM device takes two GID-CHID
				 * entries and CHID of the second entry repeats
				 * that of the first entry.
				 *
+2 −2
Original line number Diff line number Diff line
@@ -56,11 +56,11 @@ enum smc_state { /* possible states of an SMC socket */
};

enum smc_supplemental_features {
	SMC_SPF_VIRT_ISM_DEV	= 0,
	SMC_SPF_EMULATED_ISM_DEV	= 0,
};

#define SMC_FEATURE_MASK \
	(BIT(SMC_SPF_VIRT_ISM_DEV))
	(BIT(SMC_SPF_EMULATED_ISM_DEV))

struct smc_link_group;

+3 −3
Original line number Diff line number Diff line
@@ -951,8 +951,8 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)
				gidchids[entry].chid =
					htons(smc_ism_get_chid(ini->ism_dev[i]));
				gidchids[entry].gid = htonll(smcd_gid.gid);
				if (smc_ism_is_virtual(smcd)) {
					/* a virtual ISM device takes two
				if (smc_ism_is_emulated(smcd)) {
					/* an Emulated-ISM device takes two
					 * entries. CHID of the second entry
					 * repeats that of the first entry.
					 */
@@ -1054,7 +1054,7 @@ smcd_clc_prep_confirm_accept(struct smc_connection *conn,
		clc->d1.chid = htons(chid);
		if (eid && eid[0])
			memcpy(clc->d1.eid, eid, SMC_MAX_EID_LEN);
		if (__smc_ism_is_virtual(chid))
		if (__smc_ism_is_emulated(chid))
			clc->d1.gid_ext = htonll(smcd_gid.gid_ext);
		len = SMCD_CLC_ACCEPT_CONFIRM_LEN_V2;
		if (first_contact) {
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ struct smc_clc_msg_proposal { /* clc proposal message sent by Linux */
#define SMCD_CLC_MAX_V2_GID_ENTRIES	8 /* max # of CHID-GID entries in CLC
					   * proposal SMC-Dv2 extension.
					   * each ISM device takes one entry and
					   * each virtual ISM takes two entries.
					   * each Emulated-ISM takes two entries
					   */

struct smc_clc_msg_proposal_area {
+2 −2
Original line number Diff line number Diff line
@@ -1535,7 +1535,7 @@ void smc_smcd_terminate(struct smcd_dev *dev, struct smcd_gid *peer_gid,
	list_for_each_entry_safe(lgr, l, &dev->lgr_list, list) {
		if ((!peer_gid->gid ||
		     (lgr->peer_gid.gid == peer_gid->gid &&
		      !smc_ism_is_virtual(dev) ? 1 :
		      !smc_ism_is_emulated(dev) ? 1 :
		      lgr->peer_gid.gid_ext == peer_gid->gid_ext)) &&
		    (vlan == VLAN_VID_MASK || lgr->vlan_id == vlan)) {
			if (peer_gid->gid) /* peer triggered termination */
@@ -1881,7 +1881,7 @@ static bool smcd_lgr_match(struct smc_link_group *lgr,
	    lgr->smcd != smcismdev)
		return false;

	if (smc_ism_is_virtual(smcismdev) &&
	if (smc_ism_is_emulated(smcismdev) &&
	    lgr->peer_gid.gid_ext != peer_gid->gid_ext)
		return false;

Loading