]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: Support filter links with no VF info
authorrenmingshuai <renmingshuai@huawei.com>
Thu, 11 Apr 2024 02:43:19 +0000 (10:43 +0800)
committerDavid Ahern <dsahern@kernel.org>
Sat, 13 Apr 2024 16:30:07 +0000 (16:30 +0000)
commit806b751a683f7739d98e92f76f07f7e6a090fdc7
tree41ebda2d799c1aa870ba6eb23405f0fc79e3494c
parent7a6d30c95da98fbb375e7f1520fad34c1e959441
ip: Support filter links with no VF info

Kernel has add IFLA_EXT_MASK attribute for indicating that certain
extended ifinfo values are requested by the user application. The ip
link show cmd always request VFs extended ifinfo.

In this case, RTM_GETLINK for greater than about 220 VFs truncates
IFLA_VFINFO_LIST due to the maximum reach of nlattr's nla_len being
exceeded. As a result, ip link show command only show the truncated
VFs info sucn as:

    #ip link show dev eth0
    1: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
        link/ether ...
        vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff ...
    Truncated VF list: eth0

This patch add novf to support filter links with no VF info:
ip link show novf

v2:
- use an one word option instead of an option with on/off.
- fix the issue that break changes made for the link filter
  already done for VF's.

v3:
- "novf" set vfinfo to 0 and the RTEXT_FILTER_VF flag is not added.

Signed-off-by: Mingshuai Ren <renmingshuai@huawei.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ip_common.h
ip/ipaddress.c
ip/iplink.c
man/man8/ip-link.8.in