From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65948C433FE for ; Fri, 7 Oct 2022 06:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbiJGG4h (ORCPT ); Fri, 7 Oct 2022 02:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiJGG4g (ORCPT ); Fri, 7 Oct 2022 02:56:36 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 095F4A927A for ; Thu, 6 Oct 2022 23:56:34 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1665125793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GgVpcqrUgsel6oJ3/zPc/XyjpW73BV9CcYsw6eQFDgk=; b=X4qDPNNdMUr52z6VZGdwtiM2YZt6p4p+eKkuf6IBUQKrXopp1aeIbnGKzwAPGSaMQGNTsC 2t9nsI7p4tIMvNHkKw3DGRSF278J5Wy1Jf9g2d60vg/a2ETIYjJAoDNGK3A446zq3eW5uX 1KETFLcc37oBaYFjBSLAbYnVn5xSSIw= Date: Fri, 7 Oct 2022 14:56:26 +0800 MIME-Version: 1.0 Subject: Re: [PATCH] rdma: not display the rdma link in other net namespace To: Leon Romanovsky , Jason Gunthorpe Cc: Leon Romanovsky , linux-rdma@vger.kernel.org References: <20220926024033.284341-1-yanjun.zhu@linux.dev> <4e5d49fe-38a3-4891-3755-3decf8ffebda@linux.dev> <99a4b7ea-64df-7de4-2d7a-52e797644e71@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yanjun Zhu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 在 2022/10/7 14:21, Leon Romanovsky 写道: > On Thu, Oct 06, 2022 at 01:23:05PM -0300, Jason Gunthorpe wrote: >> On Thu, Oct 06, 2022 at 07:21:39PM +0300, Leon Romanovsky wrote: >> >>>> And in exclusive mode, a rdma link that can not be accessed in net namespace >>>> A still >>>> >>>> appears in net namespace A when running "rdma link show" in net namespace A. >>>> >>>> The above is different from others in net namespace. >>>> >>>> For example, in net namespace, if net device NIC0 is moved to net namespace >>>> B from net namespace A, >>>> >>>> this NIC0 will not appear in net namespace A when running "ip link" command >>>> in net namespace A. >>>> >>>> Is it a problem? >>> rdmatool presents IB devices. It has no logic that decides if that >>> device is usable/operable or not. >> It should really not report an IB device that is not in the net >> namespace.. > It is kernel (nldev.c) job to hide such IB devices and it seems like it > does. For devices with help of ib_enum_all_devs() and for links with > ib_device_get_by_index(). Thanks, Jason and Leon I am working on it. I will send the patch out very soon. Zhu Yanjun > > They both checks netns - rdma_dev_access_netns(device, net). > > Thanks