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

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 <guwen@linux.alibaba.com>
Reviewed-and-tested-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wen Gu and committed by
David S. Miller
c6b8b8eb 01fd1617

+14
+14
net/smc/smc_clc.c
··· 155 155 rc = 0; 156 156 } 157 157 } 158 + #if IS_ENABLED(CONFIG_S390) 158 159 if (!rc && !smc_clc_eid_table.ueid_cnt) { 159 160 smc_clc_eid_table.seid_enabled = 1; 160 161 rc = -EAGAIN; /* indicate success and enabling of seid */ 161 162 } 163 + #endif 162 164 write_unlock(&smc_clc_eid_table.lock); 163 165 return rc; 164 166 } ··· 275 273 276 274 int smc_nl_enable_seid(struct sk_buff *skb, struct genl_info *info) 277 275 { 276 + #if IS_ENABLED(CONFIG_S390) 278 277 write_lock(&smc_clc_eid_table.lock); 279 278 smc_clc_eid_table.seid_enabled = 1; 280 279 write_unlock(&smc_clc_eid_table.lock); 281 280 return 0; 281 + #else 282 + return -EOPNOTSUPP; 283 + #endif 282 284 } 283 285 284 286 int smc_nl_disable_seid(struct sk_buff *skb, struct genl_info *info) 285 287 { 286 288 int rc = 0; 287 289 290 + #if IS_ENABLED(CONFIG_S390) 288 291 write_lock(&smc_clc_eid_table.lock); 289 292 if (!smc_clc_eid_table.ueid_cnt) 290 293 rc = -ENOENT; 291 294 else 292 295 smc_clc_eid_table.seid_enabled = 0; 293 296 write_unlock(&smc_clc_eid_table.lock); 297 + #else 298 + rc = -EOPNOTSUPP; 299 + #endif 294 300 return rc; 295 301 } 296 302 ··· 1338 1328 INIT_LIST_HEAD(&smc_clc_eid_table.list); 1339 1329 rwlock_init(&smc_clc_eid_table.lock); 1340 1330 smc_clc_eid_table.ueid_cnt = 0; 1331 + #if IS_ENABLED(CONFIG_S390) 1341 1332 smc_clc_eid_table.seid_enabled = 1; 1333 + #else 1334 + smc_clc_eid_table.seid_enabled = 0; 1335 + #endif 1342 1336 } 1343 1337 1344 1338 void smc_clc_exit(void)