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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 59DB3C5517A for ; Fri, 6 Nov 2020 06:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CC2B20A8B for ; Fri, 6 Nov 2020 06:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604645796; bh=yRhE6XR0cLSyZZkXEIf4EKqkW1OuHyv4bdZKoioXVrw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=VUeCAv5tvxbexmrmfH/i6UsRCzNAY5sxJSRztcb7aMKaH0c/bLFGdnXISPk5T2aax EQkzfyG8/yT7Y8Ju3j/+qj3HSxUXkpBFpOBJDsAZlAkYM0irELHAiKbrHD6oqbGiHA c7WrOIOfSqB3iKUq7SRnJIE/14sQVZ9L4YTehAx8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbgKFG4e (ORCPT ); Fri, 6 Nov 2020 01:56:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:40512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgKFG4d (ORCPT ); Fri, 6 Nov 2020 01:56:33 -0500 Received: from localhost (searspoint.nvidia.com [216.228.112.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 83A17206F4; Fri, 6 Nov 2020 06:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604645793; bh=yRhE6XR0cLSyZZkXEIf4EKqkW1OuHyv4bdZKoioXVrw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kuiVH9hQopx87bfdsAx2gbKmFgqYBDw23j1qfXnRfX10trVIjqzi1XQuIsXTGLE9G 1DTngfIQUa/4q9EbToBgKnayZOqY86jTsC5P77eqHjqujTvlcdN+c69Yid3YbD3VC5 tWou/zcOf1hZwMT8Gp8NSxGCgRn/4TGKZrD2daKc= Date: Fri, 6 Nov 2020 08:56:29 +0200 From: Leon Romanovsky To: Jason Gunthorpe , Saeed Mahameed Cc: Doug Ledford , gregkh , Jakub Kicinski , Jason Wang , linux-rdma@vger.kernel.org, "Michael S. Tsirkin" , netdev@vger.kernel.org, Parav Pandit , Roi Dayan , virtualization@lists.linux-foundation.org, alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, "David S . Miller" , ranjani.sridharan@linux.intel.com, pierre-louis.bossart@linux.intel.com, fred.oh@linux.intel.com, shiraz.saleem@intel.com, dan.j.williams@intel.com, kiran.patil@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH mlx5-next v1 05/11] net/mlx5: Register mlx5 devices to auxiliary virtual bus Message-ID: <20201106065629.GD5475@unreal> References: <20201101201542.2027568-1-leon@kernel.org> <20201101201542.2027568-6-leon@kernel.org> <20201105210948.GS2620339@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201105210948.GS2620339@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Nov 05, 2020 at 05:09:48PM -0400, Jason Gunthorpe wrote: > On Thu, Nov 05, 2020 at 12:59:20PM -0800, Saeed Mahameed wrote: > > > 2. you can always load a driver without its underlying device existed. > > for example, you can load a pci device driver/module and it will load > > and wait for pci devices to pop up, the subsysetem infrastructure will > > match between drivers and devices and probe them. > > Yes, this works fine with this design > > > struct aux_driver mlx5_vpda_aux_driver { > > > > .name = "vdpa", > > /* match this driver with mlx5_core devices */ > > .id_table = {"mlx5_core"}, > > .ops { > > /* called before probe on actual aux mlx5_core device */ > > .is_supported(struct aux_device); > > This means module auto loading is impossible, we can't tell to load > the module until we load the module to call the is_supported code .. Right, and if we can, it will be violation of everything we know in driver model, because the call "is_supported" will need to be called for every registered driver without any relation to existed devices. And mlx5_rescan_drivers() came as a need to overcome LAG and eswitch craziness in everything related to their reprobe flows. Once they will be changed to work like normal drivers, we will be able to simplify it. So let's talk offline to see how can we improve mlx5_core even more after this series is merged. Thanks > > Jason