Re: [PATCH net-next v4 1/3] net: devlink: let the core report the driver name instead of the drivers

From
Ido Schimmel <idosch@nvidia.com>
Date
2022-11-28 11:49:38
Also in
intel-wired-lan, linux-crypto, linux-rdma, lkml
Reply to
Vincent Mailhol, 2022-11-28
On Mon, Nov 28, 2022 at 01:15:43PM +0900, Vincent Mailhol wrote:
The driver name is available in device_driver::name. Right now,
drivers still have to report this piece of information themselves in
their devlink_ops::info_get callback function.

In order to factorize code, make devlink_nl_info_fill() add the driver
name attribute.

nla_put() does not check if an attribute already exists and
unconditionally reserves new space, c.f. [1]. To avoid attribute
duplication, clean-up all the drivers which are currently reporting
the driver name in their callback.

[1] __nla_put() from lib/nlattr.c
Link: https://elixir.bootlin.com/linux/v6.0/source/lib/nlattr.c#L993

Signed-off-by: Vincent Mailhol <redacted>
For mlxsw:

Tested-by: Ido Schimmel <idosch@nvidia.com>

I don't see a difference in "devlink dev info" output before and after
the patchset. Tested with mlxsw_spectrum and mlxsw_minimal.
Thread (37 messages) 37 messages, 5 authors, last reply 2022-11-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help