Netdev List
 help / color / mirror / Atom feed
From: Larysa Zaremba <larysa.zaremba@intel.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <andrew+netdev@lunn.ch>,
	<netdev@vger.kernel.org>, <przemyslaw.kitszel@intel.com>,
	<aleksander.lobakin@intel.com>, <sridhar.samudrala@intel.com>,
	<anjali.singhai@intel.com>, <michal.swiatkowski@linux.intel.com>,
	<maciej.fijalkowski@intel.com>, <emil.s.tantilov@intel.com>,
	<madhu.chittim@intel.com>, <joshua.a.hay@intel.com>,
	<jacob.e.keller@intel.com>, <jayaprakash.shanmugam@intel.com>,
	<jiri@resnulli.us>, <horms@kernel.org>, <corbet@lwn.net>,
	<richardcochran@gmail.com>, <linux-doc@vger.kernel.org>,
	Bharath R <Bharath.r@intel.com>
Subject: Re: [PATCH net-next v4 15/15] ixd: add devlink support
Date: Mon, 13 Jul 2026 15:29:39 +0200	[thread overview]
Message-ID: <alToQ05TGlcM9c2M@soc-5CG4396X81.clients.intel.com> (raw)
In-Reply-To: <20260710215313.1475803-16-anthony.l.nguyen@intel.com>

Below is the answer to Sashiko feedback for this patch.

Sashiko says:
> commit d1a5268fa124e852cecef1e844a5c981bd3df46c
> Author: Amritha Nambiar <amritha.nambiar@intel.com>
> ixd: add devlink support
> This patch adds initial devlink support to the ixd driver, allocating a
> devlink instance per PCIe function and exposing serial number, device
> type, and virtchnl version through the info_get callback. Registration
> happens from the asynchronous init_task work item after virtchnl device
> init succeeds.
> > diff --git a/drivers/net/ethernet/intel/ixd/ixd.h b/drivers/net/ethernet/intel/ixd/ixd.h
> > index 8e3cd5bc5a84..343c5053045f 100644
> > --- a/drivers/net/ethernet/intel/ixd/ixd.h
> > +++ b/drivers/net/ethernet/intel/ixd/ixd.h
> > @@ -23,6 +23,7 @@ struct ixd_adapter {
> >  		struct delayed_work init_work;
> >  		u8 reset_retries;
> >  		u8 vc_retries;
> > +		bool success;
> >  	} init_task;
> Is encoding devlink registration state via this new success flag the
> right approach?
> The flag only exists to gate ixd_devlink_unregister():
>     static inline void ixd_devlink_unregister(struct ixd_adapter *adapter)
>     {
>         if (!adapter->init_task.success)
>             return;
>         devlink_unregister(priv_to_devlink(adapter));
>     }
> Devlink core already tracks registration state (devl_is_registered(),
> ASSERT_DEVLINK_NOT_REGISTERED). Any future code path that adds another
> devlink_register()/devlink_unregister() call site (for example a reset
> recovery or renegotiation flow) would have to remember to keep this
> flag in sync, and 'init succeeded' and 'devlink registered' may
> otherwise diverge over time.
> Would relying on the devlink core's own registration tracking be
> preferable here?
> 
devl_is_registered() is not accessible to drivers.
The idea here is that init_task can stop working correctly at any stage.
Once remove() cancels it, we should establish, what parts need to be undone.
In the future, enum could be of use for the consecutive stage, but a binary flag in enough for now.
> 
> > diff --git a/drivers/net/ethernet/intel/ixd/ixd_lib.c b/drivers/net/ethernet/intel/ixd/ixd_lib.c
> > index ce870aba143d..6f2b39cd985c 100644
> > --- a/drivers/net/ethernet/intel/ixd/ixd_lib.c
> > +++ b/drivers/net/ethernet/intel/ixd/ixd_lib.c
> > @@ -154,6 +155,8 @@ void ixd_init_task(struct work_struct *work)
> >  
> >  	if (!ixd_vc_dev_init(adapter)) {
> >  		adapter->init_task.vc_retries = 0;
> > +		adapter->init_task.success = true;
> > +		ixd_devlink_register(adapter);
> >  		return;
> >  	}
> Should devlink registration really be deferred to this asynchronous work
> callback and gated on virtchnl init success?
> If the device fails initialization permanently (reset never completes
> within 10 retries, or the virtchnl handshake fails after 5 retries in
> ixd_init_task()), the PCI device remains bound to the driver but no
> devlink instance is ever exposed. Users lose devlink dev show and
> devlink dev info visibility precisely in the failure modes where such
> diagnostics would be most useful.
> Sibling Intel drivers such as i40e and ice register devlink
> synchronously from probe() so the device is always visible.
> ixd_fill_device_name() already handles the uninitialized case by
> falling back to "UNKNOWN":
>     if (adapter->caps.device_type == cpu_to_le32(VIRTCHNL2_MEV_DEVICE))
>         snprintf(buf, buf_size, "%s", "MEV");
>     else
>         snprintf(buf, buf_size, "%s", "UNKNOWN");
> Could ixd_devlink_register() be moved into ixd_probe() so failed
> devices remain visible to devlink?
> 
We have nothing to expose, if have not yet initialized basic HW communication
ixd and idpf utilize async initialization, because e.g. after power cycle,
control plane can be unresponsive for some time

      reply	other threads:[~2026-07-13 13:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 21:52 [PATCH net-next v4 00/15][pull request] Introduce iXD driver Tony Nguyen
2026-07-10 21:52 ` [PATCH net-next v4 01/15] virtchnl: move virtchnl and virtchnl2 headers to 'include/linux/net/intel' Tony Nguyen
2026-07-10 21:52 ` [PATCH net-next v4 02/15] libie: add PCI device initialization helpers to libie Tony Nguyen
2026-07-13 14:55   ` Larysa Zaremba
2026-07-10 21:53 ` [PATCH net-next v4 03/15] libeth: allow to create fill queues without NAPI Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 04/15] libie: add control queue support Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 05/15] libie: add bookkeeping support for control queue messages Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 06/15] idpf: remove 'vport_params_reqd' field Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 07/15] idpf: remove unused code for getting RSS info from device Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 08/15] idpf: refactor idpf to use libie_pci APIs Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 09/15] idpf: refactor idpf to use libie control queues Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 10/15] idpf: make mbx_task queueing and cancelling more consistent Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 11/15] idpf: print a debug message and bail in case of non-event ctlq message Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 12/15] ixd: add basic driver framework for Intel(R) Control Plane Function Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 13/15] ixd: add reset checks and initialize the mailbox Tony Nguyen
2026-07-13 13:34   ` Larysa Zaremba
2026-07-10 21:53 ` [PATCH net-next v4 14/15] ixd: add the core initialization Tony Nguyen
2026-07-10 21:53 ` [PATCH net-next v4 15/15] ixd: add devlink support Tony Nguyen
2026-07-13 13:29   ` Larysa Zaremba [this message]

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=alToQ05TGlcM9c2M@soc-5CG4396X81.clients.intel.com \
    --to=larysa.zaremba@intel.com \
    --cc=Bharath.r@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=jacob.e.keller@intel.com \
    --cc=jayaprakash.shanmugam@intel.com \
    --cc=jiri@resnulli.us \
    --cc=joshua.a.hay@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=madhu.chittim@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=sridhar.samudrala@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