Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp695200lqa; Sat, 27 Apr 2024 23:09:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeIkeTPCwjugjOpNwwJBD2GGbnmKO4eBJqIs1f2Vgmf/B7s9m8PfAbCfycJTUZRlRVp3VmLd1lpqgamG3kGuRYGZZ1eX0jOxb8cL6dig== X-Google-Smtp-Source: AGHT+IHgQ8ALNuaY9awTzDZoSQJsb3UDHH5LyIkeOsxUv3zxSFINwX7keRf604ee1HPbktDiNYDl X-Received: by 2002:a17:902:ce91:b0:1eb:ac3c:d174 with SMTP id f17-20020a170902ce9100b001ebac3cd174mr783646plg.2.1714284578843; Sat, 27 Apr 2024 23:09:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714284578; cv=pass; d=google.com; s=arc-20160816; b=H2X1vSq2UR/NDAlViigL1ZiVx3dGl+e+Z1T8/QzPsUFq1xE/Nr5qfpi6RiG3dwRs+L CGNE7hR/R6mn3IWPtC/yCD2yS22d+SB673Owk3F7fYSjmJWlMGHLSLDRtTOtkjIQnlAi JA4rrPz/zMC9cabMpU0RZGOv8nl8WUMXyTovKuBj55ltFNg66zz+t5iH3lvfNmqaKApN tgS4e8FCfg1zoKJW3U/L/H7EBvVoFwAbUgt2t+B0D+arHWXfP0ncqmn6CrvSQgvjwxo1 eJMaPVMn3zTyJZfx9BaUHy2JgKpa9XizW4ZTopo40swaRZPKzi0CIilqyf4MwC6Tkw0N 1vcw== 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=amtQ9xRDlPUZxKPiAQamAg0aoynwXc4CEw6KroOqPls=; fh=dZ+5j4HvJgOzvN8nB02tgPlkwHWSh0WzjxQ9fqEQCrY=; b=jZA24a+iP7jnKXFD+v95ogJKUhOysRiISkD84OM0h3S/q9lNDlDv+m73WXf8RqjYgB s7uwj99tspTwrNcyfKy902agYjmMxpU3Z9Rjv4UU5Z0dMAIxWcUAxMu2AAjisd6sc2kc DN7KYSLpghrQO5tsmXf/T8DKX0zeyDHPiVIFUsPuo/knlhOo5FK1j/c+4YPWZsFFUdlY hVI1Ce7JJX6MF1g9suxgxzWcJ/ZZ6yD53TzncF+rMlqM1I8CABuaNq503D96CQpG2p6x n/mTyOFyI4m+TFZPRURQRW4siJznfH2NDirLiuNo99LAqLTOLuwh4dCliIyMs9EgsUJ1 4DPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=NfEeyswJ; 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-161274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161274-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 sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lm5-20020a170903298500b001e428195efasi715397plb.453.2024.04.27.23.09.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 23:09:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=NfEeyswJ; 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-161274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161274-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 89F4EB21492 for ; Sun, 28 Apr 2024 06:09:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8974B3A1CF; Sun, 28 Apr 2024 06:08:02 +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="NfEeyswJ" Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) (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 9EE852A1CF; Sun, 28 Apr 2024 06:07:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.112 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714284481; cv=none; b=TfM3U4OaS5hfry7OZnoIezur27JW4LTId8bgtghvCvbCR6qAq0zNAcPQJ/BBYnYK1nCzXjoS8KKWe2Bls8LrX+UnWX4eNvf2nZxiuDzrh8c0ajLT2eEAM7LQtyWNapUxaQXEs/oPJUxDhW4jQ5XtsffaaBfHqpAadtc4W3OBsr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714284481; c=relaxed/simple; bh=1JQxQkQu+eycNvPHIcvaTtnK6KJeeCWc01FzIlP3PHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DqwoGOT/TRdjr5nC0Q0l5P+/N9sm61D5fygOxHpI9MzgN4a2c6m8+KGNbgsgxwpRiL0gupnd2+suMhfzHfJL8fahooZi7bM87HeBoF/VkZUrQnU1JKjNgQUmOt44bPaCYwNDB1NkXu6Yfk04DefjGT5BGtJuTJDF6ab4XHXTGLc= 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=NfEeyswJ; arc=none smtp.client-ip=115.124.30.112 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=1714284477; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=amtQ9xRDlPUZxKPiAQamAg0aoynwXc4CEw6KroOqPls=; b=NfEeyswJ7LLrYIW2icJs5PZQj3GB59MoTbMkb2XvSxxAMLfhuowfKZS884tpBVvLryUcbMKgzZio3azF6TECAD8M+0YTHlJh1JVaCfwxkX01HZXiUDjxxniZlvJ9P8a6M2e17cp8Mfg6QxU5OrnHBae189WtWmp4n2keobWAdEs= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R611e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045046011;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0W5NS3Cl_1714284474; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0W5NS3Cl_1714284474) by smtp.aliyun-inc.com; Sun, 28 Apr 2024 14:07:56 +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 v7 06/11] net/smc: ignore loopback-ism when dumping SMC-D devices Date: Sun, 28 Apr 2024 14:07:33 +0800 Message-Id: <20240428060738.60843-7-guwen@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240428060738.60843-1-guwen@linux.alibaba.com> References: <20240428060738.60843-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 Since loopback-ism is not a PCI device, the PCI information fed back by smc_nl_handle_smcd_dev() does not apply to loopback-ism. So currently ignore loopback-ism when dumping SMC-D devices. The netlink function of loopback-ism will be refactored when SMC netlink interface is updated. Link: https://lore.kernel.org/r/caab067b-f5c3-490f-9259-262624c236b4@linux.ibm.com/ Signed-off-by: Wen Gu Reviewed-by: Wenjia Zhang Reviewed-and-tested-by: Jan Karcher --- net/smc/smc_ism.c | 2 ++ net/smc/smc_ism.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index 36459a3c739d..188fd28423c2 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c @@ -322,6 +322,8 @@ static void smc_nl_prep_smcd_dev(struct smcd_dev_list *dev_list, list_for_each_entry(smcd, &dev_list->list, list) { if (num < snum) goto next; + if (smc_ism_is_loopback(smcd)) + goto next; if (smc_nl_handle_smcd_dev(smcd, skb, cb)) goto errout; next: diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h index 165cd013404b..322973527c61 100644 --- a/net/smc/smc_ism.h +++ b/net/smc/smc_ism.h @@ -84,4 +84,9 @@ static inline bool smc_ism_is_emulated(struct smcd_dev *smcd) return __smc_ism_is_emulated(chid); } +static inline bool smc_ism_is_loopback(struct smcd_dev *smcd) +{ + return (smcd->ops->get_chid(smcd) == 0xFFFF); +} + #endif -- 2.32.0.3.g01195cf9f