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 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FDCAC43381 for ; Wed, 13 Mar 2019 13:28:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13AEA214AE for ; Wed, 13 Mar 2019 13:28:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="DiqqOCL1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725868AbfCMN2p (ORCPT ); Wed, 13 Mar 2019 09:28:45 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41154 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMN2o (ORCPT ); Wed, 13 Mar 2019 09:28:44 -0400 Received: by mail-qk1-f196.google.com with SMTP id o129so1046057qke.8 for ; Wed, 13 Mar 2019 06:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3DV+/hUgT1uVM2lpZ94eAp4EHmkpyf76W5luiwd0SOQ=; b=DiqqOCL16RecnbUNFBrM7PvKJbOIiyKXoUah0lWK/M5GpyQJ2VrmVwHpzf02b2WZFX 3mavsB2NeXXl9qpo3AZt74/UVkWQhk4BrE+tS8GLktAcPRtVTubBR0LnNKXrCpWCU2Oq fppFyXxKEG7rkfxbEkNeh9OD07QGdMwIjC7Whj1MekyIYuti3v6hcEcPwdMhLUEgvadg 4Pl+bIjKAVQxpopmzj37JVnrbiWAZ4rEWSG4GUH2ko/WpAWN86ys7hntdTLj7/JKg395 4QmlMY0ZyXHj1TUN/3Ezs/QLD932GinqY3ZCKgsuFribeQXT7sonLkAEMCBx3KclZbNp d36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3DV+/hUgT1uVM2lpZ94eAp4EHmkpyf76W5luiwd0SOQ=; b=sYG2GJxJJq5dI9iT60gkqvp/G0k2HXzy6Xm6FUBbMxRvhzLotP3G03jJD0lWsiz/fB Nkk+a5UvR+t3zFJ/ACBBvnS0k/mzLO0b1114hfFxznAnQq2GulnOxlpxmpPYLZCfvmEu 3j7n5NkOh62iQ3UXE9JCrpZYnccPEuO1jfHHyNXNNkNUzMyzUUqzlyHGqF9lwKT1yPbi gqdESuzodDX8DSeVp7GQ/v0bvF19F3UTJUkDhxz///l1lQqmzuvBt+aFcM5mvsZ0r9Uo o8IrqpAxGe9TiRUnPRcdez3CpDA51Z1kLPsDKHSZvRdC3k98198zKnSaKeZhae7wvRCX l9Cw== X-Gm-Message-State: APjAAAVOlxpQOOV9a+r2doPztheXQ/oE7Xgb59b15DtmEIyYDDG0TsBr HuI+PCGWYveoGzSuW8uCFf/LXQ== X-Google-Smtp-Source: APXvYqyA0vv8ynXKMwCx7n/HNmDSrK+qK5quQJ9aUSiFNmGK1ZNLQqwhzT6THf1utsZDzzgrj3bKXA== X-Received: by 2002:ae9:c20f:: with SMTP id j15mr30123556qkg.132.1552483723794; Wed, 13 Mar 2019 06:28:43 -0700 (PDT) Received: from ziepe.ca ([24.137.65.181]) by smtp.gmail.com with ESMTPSA id v27sm1994816qkl.17.2019.03.13.06.28.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 06:28:43 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1h43w1-0001TO-QT; Wed, 13 Mar 2019 10:28:41 -0300 Date: Wed, 13 Mar 2019 10:28:41 -0300 From: Jason Gunthorpe To: Jeff Kirsher Cc: "Ertman, David M" , "Saleem, Shiraz" , "dledford@redhat.com" , "davem@davemloft.net" , "linux-rdma@vger.kernel.org" , "netdev@vger.kernel.org" , "Ismail, Mustafa" , "Patil, Kiran" Subject: Re: [RFC v1 01/19] net/i40e: Add peer register/unregister to struct i40e_netdev_priv Message-ID: <20190313132841.GI20037@ziepe.ca> References: <20190215171107.6464-1-shiraz.saleem@intel.com> <20190215171107.6464-2-shiraz.saleem@intel.com> <20190215172233.GC30706@ziepe.ca> <9DD61F30A802C4429A01CA4200E302A7A5A471B8@fmsmsx124.amr.corp.intel.com> <20190221193523.GO17500@ziepe.ca> <2B0E3F215D1AB84DA946C8BEE234CCC97B11DF23@ORSMSX101.amr.corp.intel.com> <20190222202340.GY17500@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Mar 12, 2019 at 07:11:08PM -0700, Jeff Kirsher wrote: > > > I am assuming that the term PCI driver is being used to mean the PCI > > > subsystem in the kernel. If this assumption is wrong, please disregard > > > the next > > > paragraph, but the following points will still apply. > > > > No, I mean the driver that has the struct pci_driver for the PCI > > function. Maybe that is the LAN driver for this case. > > Sorry for the delayed response, I was dealing with a death in the family. My condolences > I want to make sure we are on the same page, so please correct me if I am > wrong. The Intel RDMA driver is not a stand-alone PCI function driver > because there is no separate PCI function for RDMA, so the RDMA driver does > not call pci_register_driver(), that is done with the LAN driver. The > Intel RDMA driver still needs to access to HW resources which is accessible > only through the LAN PF driver (e.g. i40e/ice) and does not have its own > netdev, so it uses the netdev exposed by the LAN PF driver. The access to > the netdev is needed so that it can listen to RT netlink messages and other > reasons. Whichever driver own the pci_driver is the one that has to setup the other driver core elements. Sounds like it is the net driver in your design. > We refer to "software bus" because out hardware doe not expose the hardware > bus, so our APIs to bus_register/unregister are actually using a software > bus, which is exposed and managed by the LAN driver. You have a multi-function device, and we have the mfd subsystem to help these cases. Probably this driver should use it. > > Register a device driver to the driver core and wait for the driver > > core to call that driver's probe method. > > Yes, the LAN PF driver is the software component exposing and managing the > bus, so it is the one who will call probe/remove of the peer driver (RDMA > driver). Although netdev notifiers based approach is needed if the RDMA > driver was loaded first before the LAN PF driver (i40e or ice) is loaded. Why would notifiers be needed? Driver core handles all these ordering things. If you have a device_driver with no device it waits until a device gets plugged in to call probe. Jason