Thread (23 messages) flat view 23 messages, 5 authors, 2026-03-11

Re: [RFC net-next v2 2/6] ethtool: Add loopback GET/SET netlink implementation

From: Björn Töpel <bjorn@kernel.org>
Date: 2026-03-09 08:21:14
Also in: linux-rdma, lkml

Maxime Chevallier [off-list ref] writes:
Hi Björn,

On 08/03/2026 13:40, Björn Töpel wrote:
quoted
Add the kernel-side ETHTOOL_MSG_LOOPBACK_GET,
ETHTOOL_MSG_LOOPBACK_SET, and ETHTOOL_MSG_LOOPBACK_NTF handlers using
the standard ethnl_request_ops infrastructure.

GET collects loopback entries from per-component helpers via
loopback_get_entries(). SET parses the nested entry attributes,
dispatches each to loopback_set_one(), and only sends a notification
when the state is changed.

No components are wired yet.

Signed-off-by: Björn Töpel <bjorn@kernel.org>
At a first glance, what I see is that you're using the GET ->doit method
to retrieve an array of loopback entries. The pefered approach in that
case is to use the GET ->dumpit command instead, issueing a netlink DUMP
request to list all available loopback entities on a given netdev.

If you want some reference on that, take a look at the phy.c + the
'perphy' helpers in net/ethtool/netlink.c

The idea is that you can pass a netdev ifindex in the header of the DUMP
request, which you can use to dump all loopbacks the passed netdev.

You can also check the ethtool code itself, you'll see that when you use
the "ethtool --show-phys eth0" command for example, it issues a DUMP
request to the kernel.
Ah, got it! Thanks!
I'll continue the review w.r.t the actual content of the messages :)
...and thank you!


Björn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help