Re: [External] Re: [PATCH bpf-next] netkit: Add some ethtool ops to provide information to user
From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2023-11-30 10:57:21
Also in:
bpf, lkml
On 11/30/23 10:24 AM, Feng Zhou wrote:
在 2023/11/30 17:06, Nikolay Aleksandrov 写道:quoted
On 11/30/23 09:58, Feng zhou wrote:quoted
From: Feng Zhou <redacted> Add get_strings, get_sset_count, get_ethtool_stats to get peer ifindex. ethtool -S nk1 NIC statistics: peer_ifindex: 36 Add get_link, get_link_ksettings to get link stat. ethtool nk1 Settings for nk1: ... Link detected: yes Add get_ts_info. ethtool -T nk1 Time stamping parameters for nk1: ... Signed-off-by: Feng Zhou <redacted> --- drivers/net/netkit.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)Hi, I don't see any point in sending peer_ifindex through ethtool, even worse through ethtool stats. That is definitely the wrong place for it. You can already retrieve that through netlink. About the speed/duplex this one makes more sense, but this is the wrong way to do it. See how we did it for virtio_net (you are free to set speed/duplex to anything to please bonding for example). Although I doubt anyone will use netkit with bonding, so even that is questionable. :) Nacked-by: Nikolay Aleksandrov [off-list ref]We use netkit to replace veth to improve performance, veth can be used ethtool -S veth to get peer_ifindex, so this part is added, as long as it is to keep the netkit part and veth unified, to ensure the same usage habits, and to replace it without perception.
Could you elaborate some more on the use case why you need to retrieve it via ethtool, what alternatives were tried and don't work? Please also elaborate on the case for netkit_get_link_ksettings() and which concrete problem you are trying to address with this extension? The commit message only explains what is done but does not go into the detail of _why_ you need it. Thanks, Daniel