Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp448430lqi; Thu, 7 Mar 2024 01:58:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXky6YzLnAEwnKzUBMbc0q7/2opQa1JYopHt07Cq62rynmKsv6Y2ZK6h4Ii/d0YAlCUBOoMpO+2f75EQwixSA4FGJs5Y6+u/l2no/4D9A== X-Google-Smtp-Source: AGHT+IFvx0IhELyCJV5qN9XAjR/Urznc7kC1VXUga3Zy66aeteCdNzgGSE2aPSAVywaX8fD55a5f X-Received: by 2002:a05:6a00:896:b0:6e6:4946:985f with SMTP id q22-20020a056a00089600b006e64946985fmr6283249pfj.11.1709805515731; Thu, 07 Mar 2024 01:58:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709805515; cv=pass; d=google.com; s=arc-20160816; b=qjDhI2WW4RcEXr7Z6zRThlOQS9NgSN9+cn8VGbDmV9PmOVG0S6AYBXp2KGbDJun4+T nNysC0JsrUYdWIfOQWsSq5qKFu0ZB0BqsXX+qM5sDgyX+tuoJH+HEONB2wTCPmzT6vHQ LHH0y+N1nYuQaSMjq5yG1fCqMytCtD78kmQ7zQP4Jz8UbcGD+bVqK5KvWgpJagMZQWkh 5fawh3txRUEHYupFqNXm8OJyZe5MLUjsEWrFQCdN6JnUsEhp1u5VtrTTIQZQk+HDOzP0 sfRlQIF06zxlv17Oz14z2saso+ONohYnQYmD5xTB57JWoaM+KC49uWyEEnVevy4dql+r u75w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=k2AEGh2dIEmA6LLggJT02tbo3NMTF78wsiLAFf4qX7g=; fh=dZ+5j4HvJgOzvN8nB02tgPlkwHWSh0WzjxQ9fqEQCrY=; b=dF1c2oxMbPM8OxGPBUHtqFajd6t1ksxNcAdE7s6+57MFYwgo4iLJ+QIQF09NZOgqzK ZG4h23BbCnCSX1rrf7DL17tbgLQLcndaFJ5/xP7LPLCWDOwQG4HCCH8+lzTUEtLYW0fj sPEEpH+so2dRCykKAcszhYMrQwXvMkttmwZgU/aGPmttOcGTCPCQbZPiS0/JQFdAy0tO Vdflh02voR3Ion1Gq2t2c1Kqgz28RuhkvRQyQuTQJ5bhANB2Cwft/0bF8/d8Z4TVPquq XrQj01TLgCIVo+9JcGpB4JgOh+7JOidAy2SU8mpvKHOP8M8c1EYZDSJJkMjftJ8DPXSA 81PA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=teTWZC4P; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-95269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2-20020a656b82000000b005d771540eb9si14730274pgw.206.2024.03.07.01.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 01:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=teTWZC4P; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-95269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 69AEF2835E8 for ; Thu, 7 Mar 2024 09:58:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE9DA85634; Thu, 7 Mar 2024 09:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="teTWZC4P" Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 179F283CBB; Thu, 7 Mar 2024 09:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805351; cv=none; b=O9nciUVBv/VPcB0lH20FOErmfChN3QCGId7WqApWODRov6/lxbRXZu+a7JBp53DJ4gs6bG6dHj8E1zL4kn82jL9f3wG0cV3IcT3OuhVSEAAtgXDVNc9929ZZD/3VTHDA5I82w/fjkC/a/zfkbKtgqBXk2fat1tKhCT7+XUVbYlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805351; c=relaxed/simple; bh=C1mw7oH08T3IaINFHe/PDEuNZ2af3//YPGBqcSjSzq0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JAGvnZx4mQHCGSW1OKvHfHajvlMoj9ayCIaSTtSMlG7pghKrfaq38Qe9i55VtbR04ZaYLsCWYUBGXF9Y8oxdCY3IeiOog6dTyeM51LukVlRMqEis097W26tEAdvmEbiMh/JFmK7zwNVC0HPr8m8LBo12dNswkYyhd71wQyPw7ec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=teTWZC4P; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1709805345; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=k2AEGh2dIEmA6LLggJT02tbo3NMTF78wsiLAFf4qX7g=; b=teTWZC4P3urHEE42RvrODz0qnNMt9cl9AwaD96UOmV0Co2Gt1YmxFhqk9qwL5l4rmfnNZ98XrCFsV3lw7SaDw8eqL5ECZ/dA6qoPL0bx44MJHcyoQSJqy/h668trteKHsKLPg3IailSE4q+NmG43hczODgsTAWAqcWqtoavhchw= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0W2-KdxS_1709805343; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0W2-KdxS_1709805343) by smtp.aliyun-inc.com; Thu, 07 Mar 2024 17:55:45 +0800 From: Wen Gu To: wintera@linux.ibm.com, twinkler@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, wenjia@linux.ibm.com, jaka@linux.ibm.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, alibuda@linux.alibaba.com, tonylu@linux.alibaba.com, guwen@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next v2 02/11] net/smc: decouple ism_client from SMC-D DMB registration Date: Thu, 7 Mar 2024 17:55:27 +0800 Message-Id: <20240307095536.29648-3-guwen@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240307095536.29648-1-guwen@linux.alibaba.com> References: <20240307095536.29648-1-guwen@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/s390/net/ism_drv.c | 2 +- include/net/smc.h | 4 ++-- net/smc/smc_ism.c | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 2c8e964425dc..9b2a52913e76 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -726,7 +726,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); } diff --git a/include/net/smc.h b/include/net/smc.h index c9dcb30e3fd9..6273c3a8b24a 100644 --- a/include/net/smc.h +++ b/include/net/smc.h @@ -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; diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index b6eca4231913..26743a14cf27 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c @@ -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, @@ -453,6 +449,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); -- 2.32.0.3.g01195cf9f