lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241104190610.391b784a@kernel.org>
Date: Mon, 4 Nov 2024 19:06:10 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 <netdev@...r.kernel.org>, Ido Schimmel <idosch@...dia.com>, Amit Cohen
 <amcohen@...dia.com>, Vladimir Oltean <vladimir.oltean@....com>, "Andy
 Roulin" <aroulin@...dia.com>, <mlxsw@...dia.com>
Subject: Re: [PATCH net-next v2 0/8] net: Shift responsibility for FDB
 notifications to drivers

On Mon, 4 Nov 2024 12:43:11 +0100 Petr Machata wrote:
> > On Thu, 24 Oct 2024 18:57:35 +0200 Petr Machata wrote:  
> >> Besides this approach, we considered just passing a boolean back from the
> >> driver, which would indicate whether the notification was done. But the
> >> approach presented here seems cleaner.  
> >
> > Oops, I missed the v2, same question:
> >
> >   What about adding a bit to the ops struct to indicate that 
> >   the driver will generate the notification? Seems smaller in 
> >   terms of LoC and shifts the responsibility of doing extra
> >   work towards more complex users.
> >
> > https://lore.kernel.org/all/20241029121619.1a710601@kernel.org/  
> 
> Sorry for only responding now, I was out of office last week.
> 
> The reason I went with outright responsibility shift is that the
> alternatives are more complex.
> 
> For the flag in particular, first there's no place to set the flag
> currently, we'd need a field in struct net_device_ops. But mainly, then
> you have a code that needs to corrently handle both states of the flag,
> and new-style drivers need to remember to set the flag, which is done in
> a different place from the fdb_add/del themselves. It might be fewer
> LOCs, but it's a harder to understand system.
> 
> Responsibility shift is easy. "Thou shalt notify." Done, easy to
> understand, easy to document. When cut'n'pasting, you won't miss it.

Makes sense for real proto drivers, but we also need to touch 4
Ethernet drivers. While we can trust proto drivers to do the right
thing, HW driver devs on average are average. And I can't think of
another case where driver would send netlink notifications directly.

> Let me know what you think.

Mild preference towards keeping the expectations from HW drivers as low
as possible. But I don't feel strongly. Let me revive the series in PW
so it is top of the list for Paolo tomorrow.. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ