From: Feng Zhou <zhoufeng.zf@bytedance.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
Nikolay Aleksandrov <razor@blackwall.org>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, yangzhenze@bytedance.com,
wangdongdong.6@bytedance.com, tangchen.1@bytedance.com
Subject: Re: Re: [PATCH bpf-next] netkit: Add some ethtool ops to provide information to user
Date: Thu, 7 Dec 2023 17:56:52 +0800 [thread overview]
Message-ID: <bb6c65de-1788-46a4-b913-5b1afa9c5cd7@bytedance.com> (raw)
In-Reply-To: <d75ffdd9-203a-94a3-57c1-69b1561d808e@iogearbox.net>
在 2023/12/6 18:57, Daniel Borkmann 写道:
> On 12/6/23 7:59 AM, Feng Zhou wrote:
>> 在 2023/12/4 23:22, Daniel Borkmann 写道:
>>> Thanks, so the netkit_get_link_ksettings is optional.
>>
>> Yes, netkit_get_link_ksettings really not necessary, I just added it
>> in line with veth.
>>
>> I don't quite
>>> follow what you
>>> mean with regards to your business logic in veth to obtain peer
>>> ifindex. What does
>>> the script do exactly with the peer ifindex (aka /why/ is it needed),
>>> could you
>>> elaborate some more - it's still somewhat too vague? 🙂 E.g. why it
>>> does not suffice
>>> to look at the device type or other kind of attributes?
>>
>> The scripting logic of the business colleagues should just be simple
>> logging records, using ethtool. Then they saw that netkit has this
>> missing, so raised this requirement, so I sent this patch, wanting to
>> hear your opinions. If you don't think it's necessary, let the
>> business colleagues modify it.
>
> So it is basically only logging the peer_ifindex data from ethtool but
> nothing
> more is done with it? Meaning, this was raised as a requirement because
> this was
> missing from the logging data, or was there anything more to it?
>
> The peer ifindex is already available via IFLA_LINK (which does
> dev_get_iflink()
> internally to fetch the peer's ifindex). This is also what you see in
> iproute2:
>
> # ip l
> [...]
> 163: nk0@nk1: <BROADCAST,MULTICAST,NOARP,M-DOWN> mtu 1500 qdisc noop
> state DOWN group default qlen 1000
> link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
> 164: nk1@nk0: <BROADCAST,MULTICAST,NOARP,M-DOWN> mtu 1500 qdisc noop
> state DOWN group default qlen 1000
> link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
> [...]
> # ip netns add blue
> # ip link set nk1 netns blue
> # ip l
> [...]
> 163: nk0@if164: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state
> DOWN group default qlen 1000
> link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff link-netns blue
> [...]
>
> The `if164` denotes the peer's ifindex and `link-netns blue` provides
> info on the netns of the peer.
> This is much better and more generic than the ethtool hack. I would
> suggest changing the logic to
> rather look at data populated by rtnl_fill_link_netnsid() instead.
>
> Thanks,
> Daniel
Yes, if veth supports ethtool -S to get the function of peer's ifindex,
it is not necessary for netkit and can be replaced by other ways.
prev parent reply other threads:[~2023-12-07 9:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 7:58 Feng zhou
2023-11-30 9:06 ` Nikolay Aleksandrov
2023-11-30 9:24 ` [External] " Feng Zhou
2023-11-30 10:56 ` Daniel Borkmann
2023-12-01 8:42 ` Feng Zhou
2023-12-04 15:22 ` Daniel Borkmann
2023-12-06 6:59 ` Feng Zhou
2023-12-06 10:57 ` Daniel Borkmann
2023-12-07 9:56 ` Feng Zhou [this message]
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=bb6c65de-1788-46a4-b913-5b1afa9c5cd7@bytedance.com \
--to=zhoufeng.zf@bytedance.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=tangchen.1@bytedance.com \
--cc=wangdongdong.6@bytedance.com \
--cc=yangzhenze@bytedance.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
all inboxes | Powered by JetHome®