Skip to content

Commit c6b8b8e

Browse files
Wen Gudavem330
Wen Gu
authored andcommitted
net/smc: disable SEID on non-s390 archs where virtual ISM may be used
The system EID (SEID) is an internal EID used by SMC-D to represent the s390 physical machine that OS is executing on. On s390 architecture, it predefined by fixed string and part of cpuid and is enabled regardless of whether underlay device is virtual ISM or platform firmware ISM. However on non-s390 architectures where SMC-D can be used with virtual ISM devices, there is no similar information to identify physical machines, especially in virtualization scenarios. So in such cases, SEID is forcibly disabled and the user-defined UEID will be used to represent the communicable space. Signed-off-by: Wen Gu <[email protected]> Reviewed-and-tested-by: Wenjia Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 01fd161 commit c6b8b8e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

net/smc/smc_clc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ static int smc_clc_ueid_remove(char *ueid)
155155
rc = 0;
156156
}
157157
}
158+
#if IS_ENABLED(CONFIG_S390)
158159
if (!rc && !smc_clc_eid_table.ueid_cnt) {
159160
smc_clc_eid_table.seid_enabled = 1;
160161
rc = -EAGAIN; /* indicate success and enabling of seid */
161162
}
163+
#endif
162164
write_unlock(&smc_clc_eid_table.lock);
163165
return rc;
164166
}
@@ -273,22 +275,30 @@ int smc_nl_dump_seid(struct sk_buff *skb, struct netlink_callback *cb)
273275

274276
int smc_nl_enable_seid(struct sk_buff *skb, struct genl_info *info)
275277
{
278+
#if IS_ENABLED(CONFIG_S390)
276279
write_lock(&smc_clc_eid_table.lock);
277280
smc_clc_eid_table.seid_enabled = 1;
278281
write_unlock(&smc_clc_eid_table.lock);
279282
return 0;
283+
#else
284+
return -EOPNOTSUPP;
285+
#endif
280286
}
281287

282288
int smc_nl_disable_seid(struct sk_buff *skb, struct genl_info *info)
283289
{
284290
int rc = 0;
285291

292+
#if IS_ENABLED(CONFIG_S390)
286293
write_lock(&smc_clc_eid_table.lock);
287294
if (!smc_clc_eid_table.ueid_cnt)
288295
rc = -ENOENT;
289296
else
290297
smc_clc_eid_table.seid_enabled = 0;
291298
write_unlock(&smc_clc_eid_table.lock);
299+
#else
300+
rc = -EOPNOTSUPP;
301+
#endif
292302
return rc;
293303
}
294304

@@ -1328,7 +1338,11 @@ void __init smc_clc_init(void)
13281338
INIT_LIST_HEAD(&smc_clc_eid_table.list);
13291339
rwlock_init(&smc_clc_eid_table.lock);
13301340
smc_clc_eid_table.ueid_cnt = 0;
1341+
#if IS_ENABLED(CONFIG_S390)
13311342
smc_clc_eid_table.seid_enabled = 1;
1343+
#else
1344+
smc_clc_eid_table.seid_enabled = 0;
1345+
#endif
13321346
}
13331347

13341348
void smc_clc_exit(void)

0 commit comments

Comments
 (0)