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

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

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: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Reviewed-and-tested-by: Jan Karcher <jaka@linux.ibm.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Wen Gu and committed by
Paolo Abeni
784c46f5 e5c5f359

+5 -8
+1 -1
drivers/s390/net/ism_drv.c
··· 745 745 } 746 746 747 747 static int smcd_register_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb, 748 - struct ism_client *client) 748 + void *client) 749 749 { 750 750 return ism_register_dmb(smcd->priv, (struct ism_dmb *)dmb, client); 751 751 }
+2 -2
include/net/smc.h
··· 47 47 #define ISM_ERROR 0xFFFF 48 48 49 49 struct smcd_dev; 50 - struct ism_client; 51 50 52 51 struct smcd_gid { 53 52 u64 gid; ··· 57 58 int (*query_remote_gid)(struct smcd_dev *dev, struct smcd_gid *rgid, 58 59 u32 vid_valid, u32 vid); 59 60 int (*register_dmb)(struct smcd_dev *dev, struct smcd_dmb *dmb, 60 - struct ism_client *client); 61 + void *client); 61 62 int (*unregister_dmb)(struct smcd_dev *dev, struct smcd_dmb *dmb); 62 63 int (*add_vlan_id)(struct smcd_dev *dev, u64 vlan_id); 63 64 int (*del_vlan_id)(struct smcd_dev *dev, u64 vlan_id); ··· 77 78 struct smcd_dev { 78 79 const struct smcd_ops *ops; 79 80 void *priv; 81 + void *client; 80 82 struct list_head list; 81 83 spinlock_t lock; 82 84 struct smc_connection **conn;
+2 -5
net/smc/smc_ism.c
··· 222 222 int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len, 223 223 struct smc_buf_desc *dmb_desc) 224 224 { 225 - #if IS_ENABLED(CONFIG_ISM) 226 225 struct smcd_dmb dmb; 227 226 int rc; 228 227 ··· 230 231 dmb.sba_idx = dmb_desc->sba_idx; 231 232 dmb.vlan_id = lgr->vlan_id; 232 233 dmb.rgid = lgr->peer_gid.gid; 233 - rc = lgr->smcd->ops->register_dmb(lgr->smcd, &dmb, &smc_ism_client); 234 + rc = lgr->smcd->ops->register_dmb(lgr->smcd, &dmb, lgr->smcd->client); 234 235 if (!rc) { 235 236 dmb_desc->sba_idx = dmb.sba_idx; 236 237 dmb_desc->token = dmb.dmb_tok; ··· 239 240 dmb_desc->len = dmb.dmb_len; 240 241 } 241 242 return rc; 242 - #else 243 - return 0; 244 - #endif 245 243 } 246 244 247 245 static int smc_nl_handle_smcd_dev(struct smcd_dev *smcd, ··· 442 446 if (!smcd) 443 447 return; 444 448 smcd->priv = ism; 449 + smcd->client = &smc_ism_client; 445 450 ism_set_priv(ism, &smc_ism_client, smcd); 446 451 if (smc_pnetid_by_dev_port(&ism->pdev->dev, 0, smcd->pnetid)) 447 452 smc_pnetid_by_table_smcd(smcd);