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 D160AC433FE for ; Mon, 16 May 2022 12:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbiEPMki (ORCPT ); Mon, 16 May 2022 08:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243400AbiEPMkg (ORCPT ); Mon, 16 May 2022 08:40:36 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB05A387A6 for ; Mon, 16 May 2022 05:40:32 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=chengyou@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VDLc7lt_1652704829; Received: from 30.43.106.100(mailfrom:chengyou@linux.alibaba.com fp:SMTPD_---0VDLc7lt_1652704829) by smtp.aliyun-inc.com(127.0.0.1); Mon, 16 May 2022 20:40:30 +0800 Message-ID: <3bf3f0f4-1592-2aa6-42c7-f1b4ff73fc6d@linux.alibaba.com> Date: Mon, 16 May 2022 20:40:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH for-next v7 10/12] RDMA/erdma: Add the erdma module Content-Language: en-US To: Jason Gunthorpe Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org, KaiShen@linux.alibaba.com, tonylu@linux.alibaba.com, BMT@zurich.ibm.com References: <20220421071747.1892-1-chengyou@linux.alibaba.com> <20220421071747.1892-11-chengyou@linux.alibaba.com> <20220510131724.GA1093822@nvidia.com> <15a6e72f-2967-5c19-3742-d854409275ce@linux.alibaba.com> <20220516114940.GT1343366@nvidia.com> From: Cheng Xu In-Reply-To: <20220516114940.GT1343366@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 5/16/22 7:49 PM, Jason Gunthorpe wrote: > On Mon, May 16, 2022 at 11:15:32AM +0800, Cheng Xu wrote: >> >> >> On 5/10/22 9:17 PM, Jason Gunthorpe wrote: >>> On Thu, Apr 21, 2022 at 03:17:45PM +0800, Cheng Xu wrote: >>> >>>> +static struct rdma_link_ops erdma_link_ops = { >>>> + .type = "erdma", >>>> + .newlink = erdma_newlink, >>>> +}; >>> >>> Why is there still a newlink? >>> >>> Jason >> >> >> Yeah, I remember your suggestion that the ibdev should keep the same >> lifecycle with its PCI device, and so does it now. >> >> The initialization flow for erdma now: >> probe: >> - Hardware specified initialization >> - IB device initialization >> - Calling ib_register_device with ibdev->netdev == NULL >> >> After probe, The ib device has been registered, but we left it in >> invalid state. >> To fully complete the initialization, we should set the ibdev->netdev. >> >> And the newlink command in erdma only do one thing now: set the >> ibdev->netdev if the rule matches, and it is uncorrelated with the >> ib device lifecycle. > > This is not what newlink is for, it can't be used like this > > Jason [A typo in previous reply, so I re-edit it] Yeah, the newlink is only used by siw and rxe to control their ib device lifecycle now. But for the usage of newlink, it is triggered by 'rdma link add' command. In my opinion, the 'rdma link' command set is all about display (rdma link show) or management of the link relationship between ib device and net device (rdma link add/del). And what erdma needs is setting up the link between ib device and net device. So, though the current usage is controling the lifecycle of siw/rxe, but for the command's naming and connotation, should it be OK to expand the usage of newlink to meet our requirement? Or, Is it ok that erdma registers a net notifier in our module to handle this? Thanks, Cheng Xu