iplink: filter stats using RTEXT_FILTER_SKIP_STATS
Subsystems (2)
PATCH 1/1 iplink: filter stats using RTEXT_FILTER_SKIP_STATS
From: Edwin Peer <[email protected]>
Don't request statistics we do not intend to render. This avoids the possibility of a truncated IFLA_VFINFO_LIST when statistics are not requested as well as the fetching of unnecessary data.
---
Userspace side for kernel submission:
https://lore.kernel.org/all/[email protected]/
It is only a partial "fix", but increases the number of VFs presented before the truncation occurs.
--- ip/ipaddress.c | 6 +++++- ip/iplink.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-)
ip/ipaddress.c +5 -1
@@ -2031,9 +2031,13 @@ static int ipaddr_flush(void)static int iplink_filter_req (struct nlmsghdr *nlh,int reqlen) { +__u32 filt_mask;int err; - err =addattr32 (nlh, reqlen,IFLA_EXT_MASK ,RTEXT_FILTER_VF ); + filt_mask =RTEXT_FILTER_VF ; +if (!show_stats) + filt_mask |=RTEXT_FILTER_SKIP_STATS ; + err =addattr32 (nlh, reqlen,IFLA_EXT_MASK , filt_mask);if (err)return err;
ip/iplink.c +3 -0
@@ -1166,6 +1166,9 @@ int iplink_get(char *name, __u32 filt_mask) !check_ifname (name) ?IFLA_IFNAME :IFLA_ALT_IFNAME , name, strlen(name) + 1); } + +if (!show_stats) + filt_mask |=RTEXT_FILTER_SKIP_STATS ;addattr32 (&req.n,sizeof (req),IFLA_EXT_MASK , filt_mask);if (rtnl_talk (&rth, &req.n, &answer) <0 )
Signature · 1 line
2.39.1
Quoted 9 lines · Gal Pressman
From: Edwin Peer <[email protected]>
Don't request statistics we do not intend to render. This avoids the possibility of a truncated
IFLA_VFINFO_LISTwhen statistics are not requested as well as the fetching of unnecessary data.Signed-off-by Edwin Peer <[email protected]>Cc Edwin Peer <[email protected]>Signed-off-by Gal Pressman <[email protected]>
Quoted 6 lines
---
Userspace side for kernel submission:
https://lore.kernel.org/all/[email protected]/It is only a partial "fix", but increases the number of VFs presented before the truncation occurs.
Kernel side was applied.
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:
Quoted 11 lines · On Sun, 11 Jun 2023 13:57:38 +0300 you wrote:
From: Edwin Peer <[email protected]>
Don't request statistics we do not intend to render. This avoids the possibility of a truncated
IFLA_VFINFO_LISTwhen statistics are not requested as well as the fetching of unnecessary data.Signed-off-by Edwin Peer <[email protected]>Cc Edwin Peer <[email protected]>Signed-off-by Gal Pressman <[email protected]>[...]
Here is the summary with links:
- [iproute2-next] iplink: filter stats using RTEXT_FILTER_SKIP_STATS
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=bbb1238123a8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html