From: Michal Kubiak <michal.kubiak@intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jacob Keller <jacob.e.keller@intel.com>,
David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Wojciech Drewek <wojciech.drewek@intel.com>,
George Kuruvinakunnel <george.kuruvinakunnel@intel.com>,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Subject: Re: [PATCH net 4/8] i40e: Fix XDP program unloading while removing the driver
Date: Tue, 11 Jun 2024 20:52:57 +0200 [thread overview]
Message-ID: <ZmidCSuzHvV/b5B8@localhost.localdomain> (raw)
In-Reply-To: <20240606064328.70878e5f@kernel.org>
On Thu, Jun 06, 2024 at 06:43:28AM -0700, Jakub Kicinski wrote:
> On Thu, 6 Jun 2024 12:02:27 +0200 Michal Kubiak wrote:
> > > Apologizes for asking a question which can be answered by studying
> > > the code longer, but why do you need to rebuild internal data
> > > structures for a device which is *down*. Unregistering or not.
> >
> > Excuse me, but I don't understand why we should assume that a device is
> > *down* when that callback is being called?
> > Maybe I didn't make it clear, but the ndo_bpf can be called every time
> > when the userspace application wants to load or unload the XDP program.
> > It can happen when a device is *up* and also when the link is *up*.
>
> The patch was adding a special case for NETREG_UNREGISTERING,
> at that point the device will be closed. Calling ndo_close is one
> of the first things core does during unregistering.
> Simplifying the handling for when the device is closed would be
> better.
I think I'm getting your point but moving the code for
NETREG_UNREGISTERING to ndo_stop wouldn't be enough and it seems to be
against the current design of 'unregister_netdevice_many_notify()'.
In 'unregister_netdevice_many_notify()' we have the call to
'dev_close_many()' (which calls ndo_stop on i40e driver) and then
'dev_xdp_uninstall()' is called (where there is the call to ndo_bpf).
'dev_xdp_uninstall()' seems to be the right function where all
activities related to XDP program unloading during unregistering are
expected from the driver.
Anyway, I analyzed that code one more time and I agree that the special
case for NETREG_UNREGISTERING makes the code more complex and I can
implement it in a simpler way.
The root cause of the problem I'm trying to fix is that __I40E_IN_REMOVE
flag is handled in a wrong way.
I will post the v2 then.
Thanks,
Michal
next prev parent reply other threads:[~2024-06-11 18:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 22:06 [PATCH net 0/8] Intel Wired LAN Driver Updates 2024-05-28 (e1000e, i40e, ice) Jacob Keller
2024-05-28 22:06 ` [PATCH net 1/8] e1000e: move force SMBUS near the end of enable_ulp function Jacob Keller
2024-05-28 22:06 ` [PATCH net 2/8] i40e: factoring out i40e_suspend/i40e_resume Jacob Keller
2024-05-28 22:06 ` [PATCH net 3/8] i40e: Fully suspend and resume IO operations in EEH case Jacob Keller
2024-05-28 22:06 ` [PATCH net 4/8] i40e: Fix XDP program unloading while removing the driver Jacob Keller
2024-05-30 1:54 ` Jakub Kicinski
2024-05-30 16:38 ` Jacob Keller
2024-06-05 15:00 ` Michal Kubiak
2024-06-05 19:29 ` Jakub Kicinski
2024-06-06 10:02 ` Michal Kubiak
2024-06-06 13:43 ` Jakub Kicinski
2024-06-11 18:52 ` Michal Kubiak [this message]
2024-05-28 22:06 ` [PATCH net 5/8] ice: fix 200G PHY types to link speed mapping Jacob Keller
2024-05-28 22:06 ` [PATCH net 6/8] ice: implement AQ download pkg retry Jacob Keller
2024-05-30 1:51 ` Jakub Kicinski
2024-05-30 16:50 ` Jacob Keller
2024-05-31 8:25 ` Wojciech Drewek
2024-05-28 22:06 ` [PATCH net 7/8] ice: fix reads from NVM Shadow RAM on E830 and E825-C devices Jacob Keller
2024-05-28 22:06 ` [PATCH net 8/8] ice: check for unregistering correct number of devlink params Jacob Keller
2024-05-30 2:00 ` [PATCH net 0/8] Intel Wired LAN Driver Updates 2024-05-28 (e1000e, i40e, ice) patchwork-bot+netdevbpf
2024-05-30 16:45 ` Jacob Keller
2024-05-30 16:58 ` Jakub Kicinski
2024-05-30 17:04 ` Jacob Keller
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=ZmidCSuzHvV/b5B8@localhost.localdomain \
--to=michal.kubiak@intel.com \
--cc=davem@davemloft.net \
--cc=george.kuruvinakunnel@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=wojciech.drewek@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).