Commit b27696cd authored by Wen Gu's avatar Wen Gu Committed by Jakub Kicinski

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

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/7112343Signed-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.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fef599ff
...@@ -1045,7 +1045,7 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc, ...@@ -1045,7 +1045,7 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
int rc = SMC_CLC_DECL_NOSMCDDEV; int rc = SMC_CLC_DECL_NOSMCDDEV;
struct smcd_dev *smcd; struct smcd_dev *smcd;
int i = 1, entry = 1; int i = 1, entry = 1;
bool is_virtual; bool is_emulated;
u16 chid; u16 chid;
if (smcd_indicated(ini->smc_type_v1)) if (smcd_indicated(ini->smc_type_v1))
...@@ -1057,12 +1057,12 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc, ...@@ -1057,12 +1057,12 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
chid = smc_ism_get_chid(smcd); chid = smc_ism_get_chid(smcd);
if (!smc_find_ism_v2_is_unique_chid(chid, ini, i)) if (!smc_find_ism_v2_is_unique_chid(chid, ini, i))
continue; continue;
is_virtual = __smc_ism_is_virtual(chid); is_emulated = __smc_ism_is_emulated(chid);
if (!smc_pnet_is_pnetid_set(smcd->pnetid) || if (!smc_pnet_is_pnetid_set(smcd->pnetid) ||
smc_pnet_is_ndev_pnetid(sock_net(&smc->sk), 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 /* 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 * ISM device will take two entries. So give
* up it and try the next potential ISM device. * 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, ...@@ -1072,7 +1072,7 @@ static int smc_find_ism_v2_device_clnt(struct smc_sock *smc,
ini->is_smcd = true; ini->is_smcd = true;
rc = 0; rc = 0;
i++; i++;
entry = is_virtual ? entry + 2 : entry + 1; entry = is_emulated ? entry + 2 : entry + 1;
if (entry > SMCD_CLC_MAX_V2_GID_ENTRIES) if (entry > SMCD_CLC_MAX_V2_GID_ENTRIES)
break; break;
} }
...@@ -1413,10 +1413,10 @@ static int smc_connect_ism(struct smc_sock *smc, ...@@ -1413,10 +1413,10 @@ static int smc_connect_ism(struct smc_sock *smc,
if (rc) if (rc)
return 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 = ini->ism_peer_gid[ini->ism_selected].gid_ext =
ntohll(aclc->d1.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); 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, ...@@ -2117,10 +2117,10 @@ static void smc_check_ism_v2_match(struct smc_init_info *ini,
if (smc_ism_get_chid(smcd) == proposed_chid && if (smc_ism_get_chid(smcd) == proposed_chid &&
!smc_ism_cantalk(proposed_gid, ISM_RESERVED_VLANID, smcd)) { !smc_ism_cantalk(proposed_gid, ISM_RESERVED_VLANID, smcd)) {
ini->ism_peer_gid[*matches].gid = proposed_gid->gid; 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 = ini->ism_peer_gid[*matches].gid_ext =
proposed_gid->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; ini->ism_dev[*matches] = smcd;
(*matches)++; (*matches)++;
break; break;
...@@ -2170,10 +2170,10 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, ...@@ -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 = ntohll(smcd_v2_ext->gidchid[i].gid);
smcd_gid.gid_ext = 0; smcd_gid.gid_ext = 0;
chid = ntohs(smcd_v2_ext->gidchid[i].chid); 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 || if ((i + 1) == smc_v2_ext->hdr.ism_gid_cnt ||
chid != ntohs(smcd_v2_ext->gidchid[i + 1].chid)) 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 * entries and CHID of the second entry repeats
* that of the first entry. * that of the first entry.
* *
......
...@@ -56,11 +56,11 @@ enum smc_state { /* possible states of an SMC socket */ ...@@ -56,11 +56,11 @@ enum smc_state { /* possible states of an SMC socket */
}; };
enum smc_supplemental_features { enum smc_supplemental_features {
SMC_SPF_VIRT_ISM_DEV = 0, SMC_SPF_EMULATED_ISM_DEV = 0,
}; };
#define SMC_FEATURE_MASK \ #define SMC_FEATURE_MASK \
(BIT(SMC_SPF_VIRT_ISM_DEV)) (BIT(SMC_SPF_EMULATED_ISM_DEV))
struct smc_link_group; struct smc_link_group;
......
...@@ -952,8 +952,8 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini) ...@@ -952,8 +952,8 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)
gidchids[entry].chid = gidchids[entry].chid =
htons(smc_ism_get_chid(ini->ism_dev[i])); htons(smc_ism_get_chid(ini->ism_dev[i]));
gidchids[entry].gid = htonll(smcd_gid.gid); gidchids[entry].gid = htonll(smcd_gid.gid);
if (smc_ism_is_virtual(smcd)) { if (smc_ism_is_emulated(smcd)) {
/* a virtual ISM device takes two /* an Emulated-ISM device takes two
* entries. CHID of the second entry * entries. CHID of the second entry
* repeats that of the first entry. * repeats that of the first entry.
*/ */
...@@ -1055,7 +1055,7 @@ smcd_clc_prep_confirm_accept(struct smc_connection *conn, ...@@ -1055,7 +1055,7 @@ smcd_clc_prep_confirm_accept(struct smc_connection *conn,
clc->d1.chid = htons(chid); clc->d1.chid = htons(chid);
if (eid && eid[0]) if (eid && eid[0])
memcpy(clc->d1.eid, eid, SMC_MAX_EID_LEN); 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); clc->d1.gid_ext = htonll(smcd_gid.gid_ext);
len = SMCD_CLC_ACCEPT_CONFIRM_LEN_V2; len = SMCD_CLC_ACCEPT_CONFIRM_LEN_V2;
if (first_contact) { if (first_contact) {
......
...@@ -175,7 +175,7 @@ struct smc_clc_msg_proposal { /* clc proposal message sent by Linux */ ...@@ -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 #define SMCD_CLC_MAX_V2_GID_ENTRIES 8 /* max # of CHID-GID entries in CLC
* proposal SMC-Dv2 extension. * proposal SMC-Dv2 extension.
* each ISM device takes one entry and * 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 { struct smc_clc_msg_proposal_area {
......
...@@ -1535,7 +1535,7 @@ void smc_smcd_terminate(struct smcd_dev *dev, struct smcd_gid *peer_gid, ...@@ -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) { list_for_each_entry_safe(lgr, l, &dev->lgr_list, list) {
if ((!peer_gid->gid || if ((!peer_gid->gid ||
(lgr->peer_gid.gid == 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)) && lgr->peer_gid.gid_ext == peer_gid->gid_ext)) &&
(vlan == VLAN_VID_MASK || lgr->vlan_id == vlan)) { (vlan == VLAN_VID_MASK || lgr->vlan_id == vlan)) {
if (peer_gid->gid) /* peer triggered termination */ if (peer_gid->gid) /* peer triggered termination */
...@@ -1881,7 +1881,7 @@ static bool smcd_lgr_match(struct smc_link_group *lgr, ...@@ -1881,7 +1881,7 @@ static bool smcd_lgr_match(struct smc_link_group *lgr,
lgr->smcd != smcismdev) lgr->smcd != smcismdev)
return false; return false;
if (smc_ism_is_virtual(smcismdev) && if (smc_ism_is_emulated(smcismdev) &&
lgr->peer_gid.gid_ext != peer_gid->gid_ext) lgr->peer_gid.gid_ext != peer_gid->gid_ext)
return false; return false;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "smc.h" #include "smc.h"
#define SMC_VIRTUAL_ISM_CHID_MASK 0xFF00 #define SMC_EMULATED_ISM_CHID_MASK 0xFF00
#define SMC_ISM_IDENT_MASK 0x00FFFF #define SMC_ISM_IDENT_MASK 0x00FFFF
struct smcd_dev_list { /* List of SMCD devices */ struct smcd_dev_list { /* List of SMCD devices */
...@@ -66,10 +66,10 @@ static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok, ...@@ -66,10 +66,10 @@ static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok,
return rc < 0 ? rc : 0; return rc < 0 ? rc : 0;
} }
static inline bool __smc_ism_is_virtual(u16 chid) static inline bool __smc_ism_is_emulated(u16 chid)
{ {
/* CHIDs in range of 0xFF00 to 0xFFFF are reserved /* CHIDs in range of 0xFF00 to 0xFFFF are reserved
* for virtual ISM device. * for Emulated-ISM device.
* *
* loopback-ism: 0xFFFF * loopback-ism: 0xFFFF
* virtio-ism: 0xFF00 ~ 0xFFFE * virtio-ism: 0xFF00 ~ 0xFFFE
...@@ -77,11 +77,11 @@ static inline bool __smc_ism_is_virtual(u16 chid) ...@@ -77,11 +77,11 @@ static inline bool __smc_ism_is_virtual(u16 chid)
return ((chid & 0xFF00) == 0xFF00); return ((chid & 0xFF00) == 0xFF00);
} }
static inline bool smc_ism_is_virtual(struct smcd_dev *smcd) static inline bool smc_ism_is_emulated(struct smcd_dev *smcd)
{ {
u16 chid = smcd->ops->get_chid(smcd); u16 chid = smcd->ops->get_chid(smcd);
return __smc_ism_is_virtual(chid); return __smc_ism_is_emulated(chid);
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment