From: Leon Romanovsky <leon@kernel.org>
To: Edwin Peer <edwin.peer@broadcom.com>
Cc: Ido Schimmel <idosch@idosch.org>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Ido Schimmel <idosch@mellanox.com>,
Jiri Pirko <jiri@mellanox.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.com,
Michael Chan <michael.chan@broadcom.com>
Subject: Re: [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device
Date: Tue, 26 Oct 2021 22:22:31 +0300 [thread overview]
Message-ID: <YXhVd16heaHCegL1@unreal> (raw)
In-Reply-To: <CAKOOJTyrzosizeKpfYcu4jMn6SRYrqxU0BzMf8qudAk5e74R9g@mail.gmail.com>
On Tue, Oct 26, 2021 at 10:34:39AM -0700, Edwin Peer wrote:
> On Mon, Oct 25, 2021 at 10:56 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> > > Could we also revert 82465bec3e97 ("devlink: Delete reload
> > > enable/disable interface")?
> >
> > Absolutely not.
>
> Although the following patch doesn't affect bnxt_en directly, I
> believe the change that will ultimately cause regressions are the
> patches of the form:
>
> 64ea2d0e7263 ("net/mlx5: Accept devlink user input after driver
> initialization complete")
>
> Removing the reload enable interface is merely the reason you're
> moving devlink_register() later here, but it's the swapping of the
> relative order of devlinqk_register() and register_netdev() which is
> the problem.
At least in mlx5 case, reload_enable() was before register_netdev().
It stayed like this after swapping it with devlink_register().
>
> Our proposed devlink reload depends on the netdev being registered.
> This was previously gated by reload enable, but that is a secondary
> issue. The real question is whether you now require devlink_register()
> to go last in general? If so, that's a problem because we'll race with
> user space. User visible regressions will definitely follow.
No, it is not requirement, but my suggestion. You need to be aware that
after call to devlink_register(), the device will be fully open for devlink
netlink access. So it is strongly advised to put devlink_register to be the
last command in PCI initialization sequence.
It is exactly like it was before, but instead of one _reload_ interface
which had extra enable/disable logic, we are protecting all other set/get
commands. Before the change, you was able to send any devlink netlink commands
and crash unprotected driver.
>
> The bnxt_en driver was only saved from such regressions because you
> did not carry out the same change there as you've done here.
> Otherwise, you would have broken bnxt_en as a consequence. I'm
> obviously not as familiar with mlx5, but I think you may have already
> broken it. I imagine the only reason customers haven't complained
> about this change yet is that few, if any, are running the net-next
> code.
This is not how mlx5 is implemented at all. We use auxiliary bus to
separate PCI core driver and eth netdev driver.
And yes, we have customers who rely on upstream code and test it
methodically.
>
> > In a nutshell, latest devlink_register() implementation is better
> > implementation of previously existed "reload enable/disable" boolean.
> >
> > You don't need to reorder whole devlink logic, just put a call to
> > devlink_register() in the place where you wanted to put your
> > devlink_reload_enable().
>
> We can't though, because of the two patches I pointed out previously.
> Moving devlink_register() to the existing devlink_reload_enable()
> location puts it after register_netdev(). That will cause a regression
> with udev and phys port name. We already have the failing test case
> and customer bug report for this. That is why devlink_register() was
> moved earlier in bnxt_en. We can't now do the opposite and move it
> later.
You obviously need to fix your code. Upstream version of bnxt driver
doesn't have reload_* support, so all this regression blaming it not
relevant here.
In upstream code, devlink_register() doesn't accept ops like it was
before and position of that call does only one thing - opens devlink
netlink access. All kernel devlink APIs continue to be accessible even
before devlink_register.
It looks like your failure is in backport code.
Thanks
next prev parent reply other threads:[~2021-10-26 19:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-24 8:42 [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device Leon Romanovsky
2021-10-24 9:05 ` Ido Schimmel
2021-10-24 9:54 ` Leon Romanovsky
2021-10-24 10:48 ` Ido Schimmel
2021-10-25 5:34 ` Leon Romanovsky
2021-10-25 8:08 ` Ido Schimmel
2021-10-25 10:56 ` Leon Romanovsky
2021-10-26 6:51 ` Ido Schimmel
2021-10-26 7:18 ` Leon Romanovsky
2021-10-26 14:09 ` Ido Schimmel
2021-10-26 16:14 ` Leon Romanovsky
2021-10-26 19:02 ` Jakub Kicinski
2021-10-26 19:30 ` Leon Romanovsky
2021-10-26 19:56 ` Jakub Kicinski
2021-10-27 5:56 ` Leon Romanovsky
2021-10-27 14:17 ` Jakub Kicinski
2021-10-27 15:17 ` Leon Romanovsky
2021-10-27 19:15 ` Leon Romanovsky
2021-10-27 19:28 ` Jakub Kicinski
2021-10-25 18:24 ` Jakub Kicinski
2021-10-25 19:12 ` Leon Romanovsky
2021-10-25 23:19 ` Edwin Peer
2021-10-26 5:56 ` Leon Romanovsky
2021-10-26 17:34 ` Edwin Peer
2021-10-26 19:22 ` Leon Romanovsky [this message]
2021-10-26 20:03 ` Edwin Peer
2021-10-27 6:43 ` Leon Romanovsky
2021-10-27 8:46 ` Edwin Peer
2021-10-27 9:43 ` Leon Romanovsky
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=YXhVd16heaHCegL1@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edwin.peer@broadcom.com \
--cc=idosch@idosch.org \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.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).