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 4717DC433FE for ; Mon, 24 Oct 2022 01:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbiJXBKP (ORCPT ); Sun, 23 Oct 2022 21:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiJXBKN (ORCPT ); Sun, 23 Oct 2022 21:10:13 -0400 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0B4233A3E for ; Sun, 23 Oct 2022 18:10:10 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VSqp2Rd_1666573807; Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0VSqp2Rd_1666573807) by smtp.aliyun-inc.com; Mon, 24 Oct 2022 09:10:08 +0800 Date: Mon, 24 Oct 2022 09:10:07 +0800 From: Dust Li To: Zhu Yanjun , jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, yanjun.zhu@linux.dev Subject: Re: [PATCH 0/3] RDMA net namespace Message-ID: <20221024011007.GE63658@linux.alibaba.com> Reply-To: dust.li@linux.alibaba.com References: <20221023220450.2287909-1-yanjun.zhu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221023220450.2287909-1-yanjun.zhu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Sun, Oct 23, 2022 at 06:04:47PM -0400, Zhu Yanjun wrote: >From: Zhu Yanjun > >There are shared and exclusive modes in RDMA net namespace. After >discussion with Leon, the above modes are compatible with legacy IB >device. > >To the RoCE and iWARP devices, the ib devices should be in the same net >namespace with the related net devices regardless of in shared or >exclusive mode. Does this mean that shared mode is no longer supported for RoCE and iWarp devices ? > >In the first commit, when the net devices are moved to a new net >namespace, the related ib devices are also moved to the same net >namespace. > >In the second commit, the shared/exclusive modes still work with legacy >ib devices. To the RoCE and iWARP devices, these modes will not be >considered. > >Because MLX4/5 do not call the function ib_device_set_netdev to map ib >devices and the related net devices, the function ib_device_get_by_netdev >can not get ib devices from net devices. In the third commit, all the >registered ib devices are parsed to get the net devices, then compared >with the given net devices. > >The steps to make tests: >1) Create a new net namespace net0 > > ip netns add net0 > >2) Show the rdma links in init_net > > rdma link > > " > link mlx5_0/1 state DOWN physical_state DISABLED netdev enp7s0np1 > " > >3) Move the net device to net namespace net0 > > ip link set enp7s0np1 netns net0 > >4) Show the rdma links in init_net again > > rdma link > > There is no rdma links > >5) Show the rdma links in net0 > > ip netns exec net0 rdma link > > " > link mlx5_0/1 state DOWN physical_state DISABLED netdev enp7s0np1 > " > >We can confirm that rdma links are moved to the same net namespace with >the net devices. > >Zhu Yanjun (3): > RDMA/core: Move ib device to the same net namespace with net device > RDMA/core: The legacy IB devices still work with shared/exclusive mode > RDMA/core: Get all the ib devices from net devices > > drivers/infiniband/core/device.c | 107 ++++++++++++++++++++++++++++++- > 1 file changed, 105 insertions(+), 2 deletions(-) > >-- >2.27.0