Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp2214319rba; Sun, 24 Mar 2024 06:56:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3dHLXoJtOZKd27EiKeY0/Zm22ghurgp5pVaylV0Q9yxx1nAiI9wJb9cv2fnxH5P3NQtdIQyLKmO12mW8TNA3gZTxUQ1koLotykcnKHA== X-Google-Smtp-Source: AGHT+IFg58QoDyaUIkA0vQHAE2teezSk9furDxf6lN0cQhsqP+no+GX9Y5W47mQuKSQlrbwcbxWu X-Received: by 2002:a05:622a:1885:b0:431:1137:8513 with SMTP id v5-20020a05622a188500b0043111378513mr6539215qtc.8.1711288566788; Sun, 24 Mar 2024 06:56:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711288566; cv=pass; d=google.com; s=arc-20160816; b=dNz77ZfhhtDWmS+XYwrIPEoXPklyf64RC92Tl52bWsgRBbgg5rnikC3MXMStUeLHd4 3tWqcAe3aemJe3kTcl4nvX1jDOEMGYkZVkj5jPpOja6m415YSzhldMLL4JGr8cZDp9DI IIEVDPWFgferAF9Xk+Ol/vvDjYZPk69VWgtTvvJ7c1Qh8a2lDqDjGWzZ4l11uwnjHmY1 OMQfmwqCze76GR+zZu9jJi3MWazQoIzO0vECXnaq4Jq/G96ZAbeSgoFjESOMa3kVuvWp e0SGqSliWOMBU5Cxzto6uUrcvKh686vVIb45JdZJwabo0Ro9e3b8X1pDFf8pP8vUQzDu P6Ew== 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=IIAQ3smKJ1xO0QXGHU7ULNYQ3GbL0dtaim54yNSvNgs=; fh=dZ+5j4HvJgOzvN8nB02tgPlkwHWSh0WzjxQ9fqEQCrY=; b=TyAt0y3WNdYOgVq9dmv4qhjr5/wKOCAuHILi+uUjGfAHKPITDZtDY5VsIAojxrzlTb +PDObMtkldvDnqxRqSmTqKY1oNkyxx6Az5HAYtLqBZapbjia1dzVG2XVi6wVchGQ2xXu t0XmrQ9PnC5YjFXZN16DUA9C6lqIenCshuarmrCXa+aPGuBkddyTmHS5pwtE9ODlktcC Irh53XUMlvUY5JqLi+0BnsjfIUxBk8PYVYKvMcxk6a/MAgkazzLEPS3u8+iaXzhPJ2lB pYFZ8rqcL+h04EJuQ5mRX12LMSDGddmBN4NYr56ITQc9WHc5oU+30Szoh5WC2ZLCphRP 69yw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=s6D+w6hp; 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-112689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112689-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 ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id eq17-20020a05622a5e1100b004313e1efec2si3429704qtb.700.2024.03.24.06.56.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 06:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=s6D+w6hp; 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-112689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112689-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2663A1C20A87 for ; Sun, 24 Mar 2024 13:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D798918638; Sun, 24 Mar 2024 13:55:40 +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="s6D+w6hp" Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (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 6A62F17C79; Sun, 24 Mar 2024 13:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711288540; cv=none; b=t0Wm08LQkjQCeuBO6vndjjp9gulvs+ZNuxyAQTQLGb1ZulNJxLZrergk8WNuSILaDJGOWx3ydWUpCUw+z41hgE4L2xpPCjObfX7rs5scKuhKdPLq72xHkmjyA4PpY6DM8Krmu1bRLL4y1W+kd5Hr1wdi65y+4y7BJjE83Y8gY54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711288540; c=relaxed/simple; bh=6wEN+AYA7xgUP1zm+npurszQ6R0sY0XEGXDU+rAAOFQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GbuRpwAFGSZdUAH5MR08YfdYlFrm8jHt3eYNpIjuNzprGMH9Upl+yzogq+ot1RLd5GTpY73Bowx1eLs9OxDnsHojA70jNxdEiN8UtYbgPRvArpxVh/bQCUM9gu8IYRbQqa4k6SsHIuHovmR18za5hWMIKn/gxSjv0JL4JyScNUY= 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=s6D+w6hp; arc=none smtp.client-ip=115.124.30.119 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=1711288529; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=IIAQ3smKJ1xO0QXGHU7ULNYQ3GbL0dtaim54yNSvNgs=; b=s6D+w6hpSPf0h56UxC0TehmezZbUfxjX5Gz1VgJ+/FpCYfOnKLycHImrgSV9k4cdpB97wthraf5lssu/pHxl+kCmiU2Y4FFlto+/lZtkw5N5Ax0wqA+OKeVixKVnDfGin+1Aka4ohTwF29G7WlQYcrBAoI1Q5A5ZVWY+PDBKE7Y= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R491e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0W37-8tp_1711288526; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0W37-8tp_1711288526) by smtp.aliyun-inc.com; Sun, 24 Mar 2024 21:55:28 +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: [RFC PATCH net-next v5 01/11] net/smc: decouple ism_client from SMC-D DMB registration Date: Sun, 24 Mar 2024 21:55:12 +0800 Message-Id: <20240324135522.108564-2-guwen@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240324135522.108564-1-guwen@linux.alibaba.com> References: <20240324135522.108564-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 ac88de2a06a0..051726586730 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, @@ -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); -- 2.32.0.3.g01195cf9f