From patchwork Sun Mar 20 13:30:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12786526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEEFDC433F5 for ; Sun, 20 Mar 2022 13:33:48 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 9AE2C21FD0C; Sun, 20 Mar 2022 06:32:36 -0700 (PDT) Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D73BA21EB7A for ; Sun, 20 Mar 2022 06:31:20 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 82E101021; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 8161FDD6ED; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 20 Mar 2022 09:30:56 -0400 Message-Id: <1647783064-20688-43-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> References: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 42/50] lnet: Check LNET_NID_IS_ANY in LNET_NID_NET X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Horn , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn If LNET_NID_NET is passed the wildcard NID (LNET_ANY_NID) then we should return the wildcard net (LNET_NET_ANY). This also allows NULL to be used as an argument to LNET_NID_NET. Fixes: 6935d7108f ("lnet: Change lnet_send() to take large-addr nids") WC-bug-id: https://jira.whamcloud.com/browse/LU-15478 Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/46292 Reviewed-by: James Simmons Reviewed-by: Serguei Smirnov Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- include/uapi/linux/lnet/lnet-types.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/lnet/lnet-types.h b/include/uapi/linux/lnet/lnet-types.h index eacc401..c5fca5c 100644 --- a/include/uapi/linux/lnet/lnet-types.h +++ b/include/uapi/linux/lnet/lnet-types.h @@ -125,7 +125,10 @@ static inline int nid_is_nid4(const struct lnet_nid *nid) static inline __u32 LNET_NID_NET(const struct lnet_nid *nid) { - return LNET_MKNET(nid->nid_type, __be16_to_cpu(nid->nid_num)); + if (LNET_NID_IS_ANY(nid)) + return LNET_NET_ANY; + else + return LNET_MKNET(nid->nid_type, __be16_to_cpu(nid->nid_num)); } static inline void lnet_nid4_to_nid(lnet_nid_t nid4, struct lnet_nid *nid)