From: Leon Romanovsky <leon@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
Andy Gospodarek <andrew.gospodarek@broadcom.com>,
Aron Silverton <aron.silverton@oracle.com>,
Dan Williams <dan.j.williams@intel.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Dave Jiang <dave.jiang@intel.com>,
David Ahern <dsahern@kernel.org>,
Andy Gospodarek <gospo@broadcom.com>,
Christoph Hellwig <hch@infradead.org>,
Itay Avraham <itayavr@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Jakub Kicinski <kuba@kernel.org>,
Leonid Bloch <lbloch@nvidia.com>,
linux-cxl@vger.kernel.org, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
"Nelson, Shannon" <shannon.nelson@amd.com>
Subject: Re: [PATCH v4 07/10] fwctl/mlx5: Support for communicating with mlx5 fw
Date: Thu, 13 Feb 2025 16:25:16 +0200 [thread overview]
Message-ID: <20250213142516.GM17863@unreal> (raw)
In-Reply-To: <daca71bd-547d-406c-83d8-05f8508703b2@intel.com>
On Thu, Feb 13, 2025 at 02:19:38PM +0100, Przemek Kitszel wrote:
> On 2/7/25 01:13, Jason Gunthorpe wrote:
> > From: Saeed Mahameed <saeedm@nvidia.com>
>
> In part this is a general feedback for the subsystem too.
>
> > +FWCTL MLX5 DRIVER
>
> I don't like this design.
> That way each and every real driver would need to make another one to
> just use fwctl.
>
> Why not just require the real driver to call fwctl_register(opsstruct),
> with the required .validate, .do_cmd, etc commands backed there?
> There will be much less scaffolding.
We invented auxiliary_bus to actually reduce scaffolding. The auxiliary
devices allow split of complex, multi-subsystem devices without need
to create hard binding of their drivers.
It allows for every subsystem to have its own independent driver, which
can be loaded separately, something that is not possible with your idea.
>
> Or the intention is to have this little driver replaced by OOT one,
> but keep the real (say networking) driver as-is from intree?
No, please read the purpose here drivers/base/auxiliary.c:
....
23 * In some subsystems, the functionality of the core device (PCI/ACPI/other) is
24 * too complex for a single device to be managed by a monolithic driver (e.g.
25 * Sound Open Firmware), multiple devices might implement a common intersection
26 * of functionality (e.g. NICs + RDMA), or a driver may want to export an
27 * interface for another subsystem to drive (e.g. SIOV Physical Function export
28 * Virtual Function management). A split of the functionality into child-
29 * devices representing sub-domains of functionality makes it possible to
30 * compartmentalize, layer, and distribute domain-specific concerns via a Linux
31 * device-driver model.
....
>
> > +++ b/drivers/fwctl/mlx5/main.c
> > @@ -0,0 +1,340 @@
> > +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
> > +/*
> > + * Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES
>
> -2025
>
> > + */
> > +#include <linux/fwctl.h>
> > +#include <linux/auxiliary_bus.h>
> > +#include <linux/mlx5/device.h>
> > +#include <linux/mlx5/driver.h>
>
> this breaks abstraction (at least your headers are in nice place, but
> this is rather uncommon, typical solution is to have them backed inside
> the driver directory) - the two drivers will be tightly coupled
FWCTL driver is connected to auxiliary device which is managed by some
other driver core (in our case mlx5_core). It is coupled by design.
>
> > +module_auxiliary_driver(mlx5ctl_driver);
> > +
> > +MODULE_IMPORT_NS("FWCTL");
> > +MODULE_DESCRIPTION("mlx5 ConnectX fwctl driver");
> > +MODULE_AUTHOR("Saeed Mahameed <saeedm@nvidia.com>");
> > +MODULE_LICENSE("Dual BSD/GPL");
> > diff --git a/include/uapi/fwctl/fwctl.h b/include/uapi/fwctl/fwctl.h
> > index 7a21f2f011917a..0790b8291ee1bd 100644
> > --- a/include/uapi/fwctl/fwctl.h
> > +++ b/include/uapi/fwctl/fwctl.h
> > @@ -42,6 +42,7 @@ enum {
> > enum fwctl_device_type {
> > FWCTL_DEVICE_TYPE_ERROR = 0,
> > + FWCTL_DEVICE_TYPE_MLX5 = 1,
>
> is that for fwctl info to be able to properly report what device user
> has asked ioctl on? Would be great to embed 32byte long cstring of
> DRIVER_NAME, to don't need each and every device to come to you and
> ask for inclusion, that would also resolve problem of conflicting IDs
> (my-driver-id prior-to and after upstreaming)
Yes, we do want to make sure that FWCTL is used for upstream code and
don't want to open it for any out-of-tree drivers, which wants to use
this interface but didn't send it to upstream.
Thanks
>
>
next prev parent reply other threads:[~2025-02-13 14:25 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 0:13 [PATCH v4 00/10] Introduce fwctl subystem Jason Gunthorpe
2025-02-07 0:13 ` [PATCH v4 01/10] fwctl: Add basic structure for a class subsystem with a cdev Jason Gunthorpe
2025-02-07 23:32 ` Dan Williams
2025-02-07 23:55 ` Jason Gunthorpe
2025-02-08 0:08 ` Dave Jiang
2025-02-07 0:13 ` [PATCH v4 02/10] fwctl: Basic ioctl dispatch for the character device Jason Gunthorpe
2025-02-07 12:59 ` Jonathan Cameron
2025-02-07 13:52 ` Jason Gunthorpe
2025-02-08 0:16 ` Dave Jiang
2025-02-10 15:24 ` Jason Gunthorpe
2025-02-13 12:42 ` Przemek Kitszel
2025-02-13 18:52 ` Jason Gunthorpe
2025-02-07 0:13 ` [PATCH v4 03/10] fwctl: FWCTL_INFO to return basic information about the device Jason Gunthorpe
2025-02-07 13:06 ` Jonathan Cameron
2025-02-07 14:23 ` Jason Gunthorpe
2025-02-08 0:21 ` Dave Jiang
2025-02-07 0:13 ` [PATCH v4 04/10] taint: Add TAINT_FWCTL Jason Gunthorpe
2025-02-07 13:09 ` Jonathan Cameron
2025-02-08 0:24 ` Dave Jiang
2025-02-07 0:13 ` [PATCH v4 05/10] fwctl: FWCTL_RPC to execute a Remote Procedure Call to device firmware Jason Gunthorpe
2025-02-08 0:28 ` Dave Jiang
2025-02-07 0:13 ` [PATCH v4 06/10] fwctl: Add documentation Jason Gunthorpe
2025-02-07 14:42 ` Jonathan Cameron
2025-02-10 15:17 ` Jason Gunthorpe
2025-02-08 0:40 ` Dave Jiang
2025-02-07 0:13 ` [PATCH v4 07/10] fwctl/mlx5: Support for communicating with mlx5 fw Jason Gunthorpe
2025-02-13 13:19 ` Przemek Kitszel
2025-02-13 14:25 ` Leon Romanovsky [this message]
2025-02-13 19:18 ` Jason Gunthorpe
2025-02-07 0:13 ` [PATCH v4 08/10] mlx5: Create an auxiliary device for fwctl_mlx5 Jason Gunthorpe
2025-02-07 0:13 ` [PATCH v4 09/10] fwctl/bnxt: Support communicating with bnxt fw Jason Gunthorpe
2025-02-07 14:59 ` Jonathan Cameron
2025-02-07 15:03 ` Jason Gunthorpe
2025-02-07 0:13 ` [PATCH v4 10/10] bnxt: Create an auxiliary device for fwctl_bnxt Jason Gunthorpe
2025-02-07 0:44 ` Jakub Kicinski
2025-02-07 3:17 ` Andy Gospodarek
2025-02-07 12:46 ` Jason Gunthorpe
2025-02-07 15:36 ` Jakub Kicinski
2025-02-07 20:25 ` Saeed Mahameed
2025-02-07 21:51 ` Jakub Kicinski
2025-02-08 1:10 ` Saeed Mahameed
2025-02-08 1:16 ` Jason Gunthorpe
2025-02-08 3:24 ` Andy Gospodarek
2025-02-11 1:04 ` Jakub Kicinski
2025-02-11 7:55 ` Leon Romanovsky
2025-02-11 14:27 ` Andy Gospodarek
2025-02-12 14:20 ` Leon Romanovsky
2025-02-11 18:36 ` Nelson, Shannon
2025-02-12 13:22 ` Leon Romanovsky
2025-02-14 1:03 ` Saeed Mahameed
2025-02-17 12:49 ` Jiri Pirko
2025-02-17 19:02 ` Leon Romanovsky
2025-02-11 16:24 ` David Ahern
2025-02-18 20:05 ` Jason Gunthorpe
2025-02-18 21:42 ` David Ahern
2025-02-18 23:31 ` Jakub Kicinski
2025-02-24 22:34 ` Saeed Mahameed
2025-02-07 23:29 ` Andy Gospodarek
2025-02-08 0:08 ` Jakub Kicinski
2025-02-07 21:41 ` [PATCH v4 00/10] Introduce fwctl subystem Dan Williams
2025-02-07 21:58 ` Dave Jiang
2025-02-11 9:33 ` Jonathan Cameron
2025-02-13 17:55 ` Jason Gunthorpe
2025-02-13 17:52 ` Jason Gunthorpe
2025-02-12 22:21 ` Zhu Yanjun
2025-02-13 2:30 ` Nelson, Shannon
2025-02-13 18:02 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213142516.GM17863@unreal \
--to=leon@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=aron.silverton@oracle.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dave.jiang@intel.com \
--cc=dsahern@kernel.org \
--cc=gospo@broadcom.com \
--cc=hch@infradead.org \
--cc=itayavr@nvidia.com \
--cc=jgg@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=lbloch@nvidia.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
--cc=saeedm@nvidia.com \
--cc=shannon.nelson@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).