netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Larysa Zaremba <larysa.zaremba@intel.com>,
	intel-wired-lan@lists.osuosl.org,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Lee Trager <lee@trager.us>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Mateusz Polchlopek <mateusz.polchlopek@intel.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Karlsson,
	Magnus" <magnus.karlsson@intel.com>,
	Emil Tantilov <emil.s.tantilov@intel.com>,
	Madhu Chittim <madhu.chittim@intel.com>,
	Josh Hay <joshua.a.hay@intel.com>,
	Milena Olech <milena.olech@intel.com>,
	pavan.kumar.linga@intel.com, "Singhai,
	Anjali" <anjali.singhai@intel.com>,
	Phani R Burra <phani.r.burra@intel.com>
Subject: Re: [PATCH iwl-next 05/14] libeth: add control queue support
Date: Thu, 10 Apr 2025 16:58:43 +0300	[thread overview]
Message-ID: <20250410135843.GV199604@unreal> (raw)
In-Reply-To: <7e3f2eb8-b668-4ac5-8b49-43eebff2b3e0@intel.com>

On Thu, Apr 10, 2025 at 03:33:40PM +0200, Alexander Lobakin wrote:
> From: Leon Romanovsky <leon@kernel.org>
> Date: Thu, 10 Apr 2025 16:27:06 +0300
> 
> > On Thu, Apr 10, 2025 at 02:58:28PM +0200, Larysa Zaremba wrote:
> >> On Thu, Apr 10, 2025 at 02:23:49PM +0300, Leon Romanovsky wrote:
> >>> On Thu, Apr 10, 2025 at 12:44:33PM +0200, Larysa Zaremba wrote:
> >>>> On Thu, Apr 10, 2025 at 11:21:37AM +0300, Leon Romanovsky wrote:
> >>>>> On Tue, Apr 08, 2025 at 02:47:51PM +0200, Larysa Zaremba wrote:
> >>>>>> From: Phani R Burra <phani.r.burra@intel.com>
> >>>>>>
> >>>>>> Libeth will now support control queue setup and configuration APIs.
> >>>>>> These are mainly used for mailbox communication between drivers and
> >>>>>> control plane.
> >>>>>>
> >>>>>> Make use of the page pool support for managing controlq buffers.
> >>>>>
> >>>>> <...>
> >>>>>
> >>>>>>  libeth-y			:= rx.o
> >>>>>>  
> >>>>>> +obj-$(CONFIG_LIBETH_CP)		+= libeth_cp.o
> >>>>>> +
> >>>>>> +libeth_cp-y			:= controlq.o
> >>>>>
> >>>>> So why did you create separate module for it?
> >>>>> Now you have pci -> libeth -> libeth_cp -> ixd, with the potential races between ixd and libeth, am I right?
> >>>>>
> >>>>
> >>>> I am not sure what kind of races do you mean, all libeth modules themselves are 
> >>>> stateless and will stay this way [0], all used data is owned by drivers.
> >>>
> >>> Somehow such separation doesn't truly work. There are multiple syzkaller
> >>> reports per-cycle where module A tries to access module C, which already
> >>> doesn't exist because it was proxied through module B.
> >>
> >> Are there similar reports for libeth and libie modules when iavf is enabled?
> > 
> > To get such report, syzkaller should run on physical iavf, it looks like it doesn't.
> > Did I miss it here?
> > https://syzkaller.appspot.com/upstream/s/net
> > 
> >> It is basically the same hierarchy. (iavf uses both libeth and libie, libie 
> >> depends on libeth).
> >>
> >> I am just trying to understand, is this a regular situation or did I just mess 
> >> smth up?
> > 
> > My review comment was general one. It is almost impossible to review
> > this newly proposed architecture split for correctness.
> > 
> >>
> >>>
> >>>>
> >>>> As for the module separation, I think there is no harm in keeping it modular. 
> >>>
> >>> Syzkaller reports disagree with you. 
> >>>
> >>
> >> Could you please share them?
> > 
> > It is not an easy question to answer, because all these reports are complaining
> > about some wrong locking order or NULL-pointer access. You will never know if
> > it is because of programming or design error.
> > 
> > As an approximate example, see commits a27c6f46dcec ("RDMA/bnxt_re: Fix an issue in bnxt_re_async_notifier")
> > and f0df225d12fc ("RDMA/bnxt_re: Add sanity checks on rdev validity").
> > At the first glance, they look unrelated to our discussion, however
> > they can serve as an example or races between deinit/disable paths in
> > parent module vs. child.
> 
> Unrelated. At first, you were talking about module dependencies, now
> you're talking about struct device etc dependencies, which is a
> completely different thing.
> 
> As already said, libeth is stateless, so the latter one can't happen.
> The former one is impossible at all. As long as at least 1 child module
> is loaded, you can't unload the parent. And load/unload is serialized,
> see module core code.

It is not only module load/unload. It is bind/unbind, devlink operations
e.t.c, everything that can cause to reload driver in module C.

Thanks

  reply	other threads:[~2025-04-10 13:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 12:47 [PATCH iwl-next 00/14] Introduce iXD driver Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 01/14] virtchnl: create 'include/linux/intel' and move necessary header files Larysa Zaremba
2025-04-15 18:53   ` Tony Nguyen
2025-04-08 12:47 ` [PATCH iwl-next 02/14] virtchnl: introduce control plane version fields Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 03/14] libeth: add PCI device initialization helpers to libeth Larysa Zaremba
2025-04-21 14:08   ` Simon Horman
2025-04-08 12:47 ` [PATCH iwl-next 04/14] libeth: allow to create fill queues without NAPI Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 05/14] libeth: add control queue support Larysa Zaremba
2025-04-10  8:21   ` Leon Romanovsky
2025-04-10 10:44     ` Larysa Zaremba
2025-04-10 11:23       ` Leon Romanovsky
2025-04-10 12:58         ` Larysa Zaremba
2025-04-10 13:27           ` Leon Romanovsky
2025-04-10 13:33             ` Alexander Lobakin
2025-04-10 13:58               ` Leon Romanovsky [this message]
2025-04-10 14:04                 ` Alexander Lobakin
2025-04-10 13:05         ` Alexander Lobakin
2025-04-10 13:44           ` Leon Romanovsky
2025-04-10 13:59             ` Larysa Zaremba
2025-04-11 17:18               ` Leon Romanovsky
2025-04-10 14:00             ` [Intel-wired-lan] " Alexander Lobakin
2025-04-08 12:47 ` [PATCH iwl-next 06/14] libeth: add bookkeeping support for control queue messages Larysa Zaremba
2025-04-15 18:54   ` Tony Nguyen
2025-04-21 14:19   ` Simon Horman
2025-04-08 12:47 ` [PATCH iwl-next 07/14] idpf: remove 'vport_params_reqd' field Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 08/14] idpf: refactor idpf to use libeth controlq and Xn APIs Larysa Zaremba
2025-04-21 14:25   ` Simon Horman
2025-04-08 12:47 ` [PATCH iwl-next 09/14] idpf: make mbx_task queueing and cancelling more consistent Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 10/14] idpf: print a debug message and bail in case of non-event ctlq message Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 11/14] ixd: add basic driver framework for Intel(R) Control Plane Function Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 12/14] ixd: add reset checks and initialize the mailbox Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 13/14] ixd: add the core initialization Larysa Zaremba
2025-04-08 12:48 ` [PATCH iwl-next 14/14] ixd: add devlink support Larysa Zaremba
2025-04-15 18:54   ` Tony Nguyen
2025-04-16 15:49 ` [PATCH iwl-next 00/14] Introduce iXD driver Alexander Lobakin
2025-04-16 16:23   ` Keller, Jacob E

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=20250410135843.GV199604@unreal \
    --to=leon@kernel.org \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anjali.singhai@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@resnulli.us \
    --cc=joshua.a.hay@intel.com \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=maddy@linux.ibm.com \
    --cc=madhu.chittim@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=mateusz.polchlopek@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=milena.olech@intel.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.kumar.linga@intel.com \
    --cc=phani.r.burra@intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=tatyana.e.nikolova@intel.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).