Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1591209rdd; Thu, 11 Jan 2024 04:02:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEy8ao0TxDR79Wo97fVufgHEsRIv5dj9tL+iHOqmmalZubSFnjiBVLGrNrgdJS4Sv5LZz1/ X-Received: by 2002:a05:6a20:548a:b0:19a:3dc6:7829 with SMTP id i10-20020a056a20548a00b0019a3dc67829mr806347pzk.37.1704974525131; Thu, 11 Jan 2024 04:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704974525; cv=none; d=google.com; s=arc-20160816; b=SLMS8kFi7dGbpuZZuA6mouxPUSGcL8Q/8aWl74cCK8T8g1v0zUpmNbloMs4so0oh+W LJPHsecjqQiHbkjY08sG0HKgADQtIfrg9zq/ADcsU3EJliyJ3fOvz+U0KCZpSs4sFaMZ aGtc/UEoBdbAVJ0ZjbcdVmJdfg1HlNA0pFq+EtPOB322ivIQZ+sdXV3WWLmjYmbMgHeF uyCPVp5AeLlyxT3x7QYsrXT6h6bIjUNATX+2evjHmSFj88864Jr/6rkmRzrcfXpIAZdx ZCziaYdX5sq8diRmIzNKEOmns6iGJMaBLPVpI9o3XGcMPYhpIJkTlulbV1j6Z8r1XWiz dD2g== ARC-Message-Signature: i=1; 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; bh=SLapBp+R10MIktvaCkGz9GsiVktLq432aMFctIW+9c4=; fh=jvQSXgb9+Gwj+2SIugFJuht8/m1b8ZaGKJU/ZBOVFgM=; b=J6CiTl8Q/zJYNuIpxK0rZ2To9Qz7VzMdLL+hULAAMkA2va6UooqSXsdWG/UJwMvN/+ 86muv3zH+kfCbELcRsdLq0eFqS3R7lAAe6OB8je6ol480sO0Lps0ojhVlMn30ouNWw3k iF5SSsl+halrkClcf1V9JOO18poS8hPbLYEIyDoxOMLLmPH4GP5iH/QJyNKkGMExOqPO JZvxJnZFVt+YuWbUNbsC0uKvbOYdpVCd+J4biDOyLS0dBT+51Ae7incb71R9WdhePJC8 QKjQ03VSvNkUVERr8QZqXUFZlMu1fZEI4SiiLW2sqaZpZFhUKJ0fIcslKjTSJKC1xMEK GaRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-23538-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=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 ja3-20020a170902efc300b001d35223d0c3si918337plb.68.2024.01.11.04.02.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 04:02:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23538-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; spf=pass (google.com: domain of linux-kernel+bounces-23538-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=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 C8D8D2836F1 for ; Thu, 11 Jan 2024 12:02:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82FB715E88; Thu, 11 Jan 2024 12:01:22 +0000 (UTC) Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) (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 CF06D15ACE; Thu, 11 Jan 2024 12:01:19 +0000 (UTC) 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 X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0W-PdqDE_1704974470; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0W-PdqDE_1704974470) by smtp.aliyun-inc.com; Thu, 11 Jan 2024 20:01:11 +0800 From: Wen Gu To: wintera@linux.ibm.com, wenjia@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, 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-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 02/15] net/smc: decouple specialized struct from SMC-D DMB registration Date: Thu, 11 Jan 2024 20:00:23 +0800 Message-Id: <20240111120036.109903-3-guwen@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240111120036.109903-1-guwen@linux.alibaba.com> References: <20240111120036.109903-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 virtual 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 66bcfddd3fcf..fb1837d0a861 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