From: Leon Romanovsky <leon@kernel.org>
To: Abhijit Gangurde <abhijit.gangurde@amd.com>
Cc: Jakub Kicinski <kuba@kernel.org>, Jason Gunthorpe <jgg@ziepe.ca>,
Simon Horman <horms@kernel.org>,
shannon.nelson@amd.com, brett.creeley@amd.com,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
corbet@lwn.net, andrew+netdev@lunn.ch, allen.hubbe@amd.com,
nikhil.agarwal@amd.com, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/14] net: ionic: Export the APIs from net driver to support device commands
Date: Wed, 6 Aug 2025 20:58:18 +0300 [thread overview]
Message-ID: <20250806175818.GV402218@unreal> (raw)
In-Reply-To: <5d495e57-71f5-e465-cba0-d727c6b36167@amd.com>
On Wed, Aug 06, 2025 at 01:24:04PM +0530, Abhijit Gangurde wrote:
>
> On 8/2/25 01:51, Jakub Kicinski wrote:
> > On Fri, 1 Aug 2025 14:00:14 -0300 Jason Gunthorpe wrote:
> > > > Perhaps I misunderstand things, or otherwise am on the wrong track here.
> > > > But this seems to open the possibility of users of ionic_adminq_post_wait(),
> > > > outside the Ethernet driver, executing a wide range or admin commands.
> > > > It seems to me that it would be nice to narrow that surface.
> > > The kernel is monolithic, it is not normal to spend performance
> > > aggressively policing APIs.
> > >
> > > mlx5 and other drivers already have interfaces almost exactly like this.
> > Which is not to say that it's a good idea.
>
> Thank you for the feedback, and apologies for the delay. This discussion
> prompted a thorough internal review.
> Although a precedent for similar interfaces exists in other RDMA drivers,
> the point is well-taken and we understand the concern about a wide API. To
> address this, two potential approaches are being considered,
> 1. The function can be documented as a privileged, clarifying that it
> performs no input sanitization and making the caller responsible for device
> access.
> 2. Alternatively, a new, narrower function could be introduced specifically
> for RDMA use that validates commands against an explicit allow list.
>
> We are open to either approach and would appreciate a guidance on the
> preferred direction.
I suggest you to take standard kernel coding pattern and create
in-kernel API which suits your "in-kernel customers". There is no
need in any "allow list" for in-kernel APIs. Let's don't bring
complexity and defense programming style where it is not needed
and here it is not needed.
Thanks
>
> Abhijit
>
>
next prev parent reply other threads:[~2025-08-06 17:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 17:31 [PATCH v4 00/14] Introduce AMD Pensando RDMA driver Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 01/14] net: ionic: Create an auxiliary device for rdma driver Abhijit Gangurde
2025-07-23 18:11 ` Shannon Nelson
2025-07-28 10:17 ` Abhijit Gangurde
2025-08-01 21:15 ` Christophe JAILLET
2025-08-06 8:14 ` Abhijit Gangurde
2025-08-09 10:58 ` Christophe JAILLET
2025-07-23 17:31 ` [PATCH v4 02/14] net: ionic: Update LIF identity with additional RDMA capabilities Abhijit Gangurde
2025-07-25 16:29 ` Simon Horman
2025-07-23 17:31 ` [PATCH v4 03/14] net: ionic: Export the APIs from net driver to support device commands Abhijit Gangurde
2025-07-25 16:41 ` Simon Horman
2025-08-01 17:00 ` Jason Gunthorpe
2025-08-01 20:21 ` Jakub Kicinski
2025-08-06 7:54 ` Abhijit Gangurde
2025-08-06 17:58 ` Leon Romanovsky [this message]
2025-07-23 17:31 ` [PATCH v4 04/14] net: ionic: Provide RDMA reset support for the RDMA driver Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 05/14] net: ionic: Provide interrupt allocation " Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 06/14] net: ionic: Provide doorbell and CMB region information Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 07/14] RDMA: Add IONIC to rdma_driver_id definition Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 08/14] RDMA/ionic: Register auxiliary module for ionic ethernet adapter Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 09/14] RDMA/ionic: Create device queues to support admin operations Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 10/14] RDMA/ionic: Register device ops for control path Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 11/14] RDMA/ionic: Register device ops for datapath Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 12/14] RDMA/ionic: Register device ops for miscellaneous functionality Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 13/14] RDMA/ionic: Implement device stats ops Abhijit Gangurde
2025-07-23 17:31 ` [PATCH v4 14/14] RDMA/ionic: Add Makefile/Kconfig to kernel build environment Abhijit Gangurde
2025-07-23 18:10 ` Randy Dunlap
2025-07-30 5:12 ` Abhijit Gangurde
2025-07-23 18:13 ` Shannon Nelson
2025-07-28 10:25 ` Abhijit Gangurde
2025-07-24 15:49 ` kernel test robot
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=20250806175818.GV402218@unreal \
--to=leon@kernel.org \
--cc=abhijit.gangurde@amd.com \
--cc=allen.hubbe@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.agarwal@amd.com \
--cc=pabeni@redhat.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).