Skip to content

Commit c4216a8

Browse files
committed
Merge branch 'net-smc-updates'
Wenjia Zhang says: ==================== smc: Updates 2023-03-01 The 1st patch is to make implements later do not need to adhere to a specific SEID format. The 2nd patch does some cleanup. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 45ef71d + 298c91d commit c4216a8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

drivers/s390/net/ism_drv.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/types.h>
1212
#include <linux/interrupt.h>
1313
#include <linux/device.h>
14-
#include <linux/pci.h>
1514
#include <linux/err.h>
1615
#include <linux/ctype.h>
1716
#include <linux/processor.h>
@@ -842,6 +841,12 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
842841
return ism_move(smcd->priv, dmb_tok, idx, sf, offset, data, size);
843842
}
844843

844+
static int smcd_supports_v2(void)
845+
{
846+
return SYSTEM_EID.serial_number[0] != '0' ||
847+
SYSTEM_EID.type[0] != '0';
848+
}
849+
845850
static u64 smcd_get_local_gid(struct smcd_dev *smcd)
846851
{
847852
return ism_get_local_gid(smcd->priv);
@@ -869,6 +874,7 @@ static const struct smcd_ops ism_ops = {
869874
.reset_vlan_required = smcd_reset_vlan_required,
870875
.signal_event = smcd_signal_ieq,
871876
.move_data = smcd_move,
877+
.supports_v2 = smcd_supports_v2,
872878
.get_system_eid = ism_get_seid,
873879
.get_local_gid = smcd_get_local_gid,
874880
.get_chid = smcd_get_chid,

include/net/smc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct smcd_ops {
6767
int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx,
6868
bool sf, unsigned int offset, void *data,
6969
unsigned int size);
70+
int (*supports_v2)(void);
7071
u8* (*get_system_eid)(void);
7172
u64 (*get_local_gid)(struct smcd_dev *dev);
7273
u16 (*get_chid)(struct smcd_dev *dev);

net/smc/smc_ism.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static void smcd_register_dev(struct ism_dev *ism)
429429
u8 *system_eid = NULL;
430430

431431
system_eid = smcd->ops->get_system_eid();
432-
if (system_eid[24] != '0' || system_eid[28] != '0') {
432+
if (smcd->ops->supports_v2()) {
433433
smc_ism_v2_capable = true;
434434
memcpy(smc_ism_v2_system_eid, system_eid,
435435
SMC_MAX_EID_LEN);

0 commit comments

Comments
 (0)