Unverified Commit 06bfbb03 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9892 support for SMC-D loopback_lo feature

Merge Pull Request from: @ci-robot 
 
PR sync from: Zhengchao Shao <shaozhengchao@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/P2YB3RFGOJOEYSIPMGSMZ45WE7KGWTRV/ 
Support for SMC-D loopback_lo feature.

Wen Gu (22):
  net/smc: rename some 'fce' to 'fce_v2x' for clarity
  net/smc: introduce sub-functions for smc_clc_send_confirm_accept()
  net/smc: unify the structs of accept or confirm message for v1 and v2
  net/smc: support SMCv2.x supplemental features negotiation
  net/smc: introduce virtual ISM device support feature
  net/smc: define a reserved CHID range for virtual ISM devices
  net/smc: compatible with 128-bits extended GID of virtual ISM device
  net/smc: support extended GID in SMC-D lgr netlink attribute
  net/smc: manage system EID in SMC stack instead of ISM driver
  net/smc: fix incorrect SMC-D link group matching logic
  net/smc: change the term virtual ISM to Emulated-ISM
  net/smc: decouple ism_client from SMC-D DMB registration
  net/smc: introduce loopback-ism for SMC intra-OS shortcut
  net/smc: implement ID-related operations of loopback-ism
  net/smc: implement DMB-related operations of loopback-ism
  net/smc: mark optional smcd_ops and check for support when called
  net/smc: ignore loopback-ism when dumping SMC-D devices
  net/smc: register loopback-ism into SMC-D device list
  net/smc: add operations to merge sndbuf with peer DMB
  net/smc: {at|de}tach sndbuf to peer DMB if supported
  net/smc: adapt cursor update when sndbuf and peer DMB are merged
  net/smc: implement DMB-merged operations of loopback-ism

Zhengchao Shao (1):
  net/smc: enable the smc-lo on the x86 and arm64 platforms


-- 
2.34.1
 
https://gitee.com/openeuler/kernel/issues/IACM52 
 
Link:https://gitee.com/openeuler/kernel/pulls/9892

 

Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 73239a58 f7ad7aa3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1258,6 +1258,7 @@ CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
CONFIG_SMC=m
CONFIG_SMC_DIAG=m
CONFIG_SMC_LO=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
+1 −0
Original line number Diff line number Diff line
@@ -1241,6 +1241,7 @@ CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
CONFIG_SMC=m
CONFIG_SMC_DIAG=m
CONFIG_SMC_LO=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
+0 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
 */
#define ISM_DMB_WORD_OFFSET	1
#define ISM_DMB_BIT_OFFSET	(ISM_DMB_WORD_OFFSET * 32)
#define ISM_IDENT_MASK		0x00FFFF

#define ISM_REG_SBA	0x1
#define ISM_REG_IEQ	0x2
@@ -192,12 +191,6 @@ struct ism_sba {
#define ISM_CREATE_REQ(dmb, idx, sf, offset)		\
	((dmb) | (idx) << 24 | (sf) << 23 | (offset))

struct ism_systemeid {
	u8	seid_string[24];
	u8	serial_number[4];
	u8	type[4];
};

static inline void __ism_read_cmd(struct ism_dev *ism, void *data,
				  unsigned long offset, unsigned long len)
{
+18 −41
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ static struct ism_client *clients[MAX_CLIENTS]; /* use an array rather than */
						/* a list for fast mapping  */
static u8 max_client;
static DEFINE_MUTEX(clients_lock);
static bool ism_v2_capable;
struct ism_dev_list {
	struct list_head list;
	struct mutex mutex; /* protects ism device list */
@@ -462,32 +463,6 @@ int ism_move(struct ism_dev *ism, u64 dmb_tok, unsigned int idx, bool sf,
}
EXPORT_SYMBOL_GPL(ism_move);

static struct ism_systemeid SYSTEM_EID = {
	.seid_string = "IBM-SYSZ-ISMSEID00000000",
	.serial_number = "0000",
	.type = "0000",
};

static void ism_create_system_eid(void)
{
	struct cpuid id;
	u16 ident_tail;
	char tmp[5];

	get_cpu_id(&id);
	ident_tail = (u16)(id.ident & ISM_IDENT_MASK);
	snprintf(tmp, 5, "%04X", ident_tail);
	memcpy(&SYSTEM_EID.serial_number, tmp, 4);
	snprintf(tmp, 5, "%04X", id.machine);
	memcpy(&SYSTEM_EID.type, tmp, 4);
}

u8 *ism_get_seid(void)
{
	return SYSTEM_EID.seid_string;
}
EXPORT_SYMBOL_GPL(ism_get_seid);

static void ism_handle_event(struct ism_dev *ism)
{
	struct ism_event *entry;
@@ -579,7 +554,9 @@ static int ism_dev_init(struct ism_dev *ism)

	if (!ism_add_vlan_id(ism, ISM_RESERVED_VLANID))
		/* hardware is V2 capable */
		ism_create_system_eid();
		ism_v2_capable = true;
	else
		ism_v2_capable = false;

	mutex_lock(&ism_dev_list.mutex);
	mutex_lock(&clients_lock);
@@ -684,8 +661,7 @@ static void ism_dev_exit(struct ism_dev *ism)
	}
	mutex_unlock(&clients_lock);

	if (SYSTEM_EID.serial_number[0] != '0' ||
	    SYSTEM_EID.type[0] != '0')
	if (ism_v2_capable)
		ism_del_vlan_id(ism, ISM_RESERVED_VLANID);
	unregister_ieq(ism);
	unregister_sba(ism);
@@ -762,14 +738,14 @@ static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid,
	return ism_cmd(ism, &cmd);
}

static int smcd_query_rgid(struct smcd_dev *smcd, u64 rgid, u32 vid_valid,
			   u32 vid)
static int smcd_query_rgid(struct smcd_dev *smcd, struct smcd_gid *rgid,
			   u32 vid_valid, u32 vid)
{
	return ism_query_rgid(smcd->priv, rgid, vid_valid, vid);
	return ism_query_rgid(smcd->priv, rgid->gid, vid_valid, vid);
}

static int smcd_register_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb,
			     struct ism_client *client)
			     void *client)
{
	return ism_register_dmb(smcd->priv, (struct ism_dmb *)dmb, client);
}
@@ -816,10 +792,11 @@ static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq,
	return ism_cmd(ism, &cmd);
}

static int smcd_signal_ieq(struct smcd_dev *smcd, u64 rgid, u32 trigger_irq,
			   u32 event_code, u64 info)
static int smcd_signal_ieq(struct smcd_dev *smcd, struct smcd_gid *rgid,
			   u32 trigger_irq, u32 event_code, u64 info)
{
	return ism_signal_ieq(smcd->priv, rgid, trigger_irq, event_code, info);
	return ism_signal_ieq(smcd->priv, rgid->gid,
			      trigger_irq, event_code, info);
}

static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
@@ -831,8 +808,7 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,

static int smcd_supports_v2(void)
{
	return SYSTEM_EID.serial_number[0] != '0' ||
		SYSTEM_EID.type[0] != '0';
	return ism_v2_capable;
}

static u64 ism_get_local_gid(struct ism_dev *ism)
@@ -840,9 +816,11 @@ static u64 ism_get_local_gid(struct ism_dev *ism)
	return ism->local_gid;
}

static u64 smcd_get_local_gid(struct smcd_dev *smcd)
static void smcd_get_local_gid(struct smcd_dev *smcd,
			       struct smcd_gid *smcd_gid)
{
	return ism_get_local_gid(smcd->priv);
	smcd_gid->gid = ism_get_local_gid(smcd->priv);
	smcd_gid->gid_ext = 0;
}

static u16 ism_get_chid(struct ism_dev *ism)
@@ -876,7 +854,6 @@ static const struct smcd_ops ism_ops = {
	.signal_event = smcd_signal_ieq,
	.move_data = smcd_move,
	.supports_v2 = smcd_supports_v2,
	.get_system_eid = ism_get_seid,
	.get_local_gid = smcd_get_local_gid,
	.get_chid = smcd_get_chid,
	.get_dev = smcd_get_dev,
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ int ism_register_dmb(struct ism_dev *dev, struct ism_dmb *dmb,
int  ism_unregister_dmb(struct ism_dev *dev, struct ism_dmb *dmb);
int  ism_move(struct ism_dev *dev, u64 dmb_tok, unsigned int idx, bool sf,
	      unsigned int offset, void *data, unsigned int size);
u8  *ism_get_seid(void);

const struct smcd_ops *ism_get_smcd_ops(void);

Loading