Commit 5b9d311a authored by Wen Gu's avatar Wen Gu Committed by Zhengchao Shao
Browse files

net/smc: decouple ism_client from SMC-D DMB registration

mainline inclusion
from mainline-v6.10-rc1
commit 784c46f5467c3cd516e518de211e26611da5c0fb
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IACM52

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=784c46f5467c3cd516e518de211e26611da5c0fb



--------------------------------

The struct 'ism_client' is specialized for s390 platform firmware ISM.
So replace it with 'void' to make SMCD DMB registration helper generic
for both Emulated-ISM and existing ISM.

Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
Reviewed-and-tested-by: default avatarJan Karcher <jaka@linux.ibm.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 56809c8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ static int smcd_query_rgid(struct smcd_dev *smcd, struct smcd_gid *rgid,
}

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);
}
+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ struct smcd_dmb {
#define ISM_ERROR	0xFFFF

struct smcd_dev;
struct ism_client;

struct smcd_gid {
	u64	gid;
@@ -61,7 +60,7 @@ struct smcd_ops {
	int (*query_remote_gid)(struct smcd_dev *dev, struct smcd_gid *rgid,
				u32 vid_valid, u32 vid);
	int (*register_dmb)(struct smcd_dev *dev, struct smcd_dmb *dmb,
			    struct ism_client *client);
			    void *client);
	int (*unregister_dmb)(struct smcd_dev *dev, struct smcd_dmb *dmb);
	int (*add_vlan_id)(struct smcd_dev *dev, u64 vlan_id);
	int (*del_vlan_id)(struct smcd_dev *dev, u64 vlan_id);
@@ -81,6 +80,7 @@ struct smcd_ops {
struct smcd_dev {
	const struct smcd_ops *ops;
	void *priv;
	void *client;
	struct list_head list;
	spinlock_t lock;
	struct smc_connection **conn;
+2 −5
Original line number Diff line number Diff line
@@ -222,7 +222,6 @@ int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
			 struct smc_buf_desc *dmb_desc)
{
#if IS_ENABLED(CONFIG_ISM)
	struct smcd_dmb dmb;
	int rc;

@@ -231,7 +230,7 @@ int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
	dmb.sba_idx = dmb_desc->sba_idx;
	dmb.vlan_id = lgr->vlan_id;
	dmb.rgid = lgr->peer_gid.gid;
	rc = lgr->smcd->ops->register_dmb(lgr->smcd, &dmb, &smc_ism_client);
	rc = lgr->smcd->ops->register_dmb(lgr->smcd, &dmb, lgr->smcd->client);
	if (!rc) {
		dmb_desc->sba_idx = dmb.sba_idx;
		dmb_desc->token = dmb.dmb_tok;
@@ -240,9 +239,6 @@ int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
		dmb_desc->len = dmb.dmb_len;
	}
	return rc;
#else
	return 0;
#endif
}

static int smc_nl_handle_smcd_dev(struct smcd_dev *smcd,
@@ -446,6 +442,7 @@ static void smcd_register_dev(struct ism_dev *ism)
	if (!smcd)
		return;
	smcd->priv = ism;
	smcd->client = &smc_ism_client;
	ism_set_priv(ism, &smc_ism_client, smcd);
	if (smc_pnetid_by_dev_port(&ism->pdev->dev, 0, smcd->pnetid))
		smc_pnetid_by_table_smcd(smcd);