Anthony Harivel b3f5422a3b
link: add support for IFLA_VFINFO_LIST and IFLA_VF_STATS (#295)
Add support for decoding Virtual Function (VF) information from netlink
messages. This enables users to retrieve SR-IOV VF details when querying
network interfaces.

The implementation adds:
- VFStats struct containing per-VF traffic statistics (packets, bytes,
  broadcast, multicast, dropped counters for both RX and TX)
- VFInfo struct containing VF configuration (MAC address, VLAN, QoS,
  TX rate limits, spoof check, link state, RSS query, trust settings)
- VFLinkState type with Auto/Enable/Disable constants
- NumVF and VFInfoList fields to LinkAttributes
- Decoding logic for IFLA_NUM_VF and IFLA_VFINFO_LIST nested attributes

The VF information follows the kernel's nested attribute structure.

This is useful for monitoring and managing SR-IOV enabled network
interfaces where the Physical Function (PF) exposes multiple Virtual
Functions to guest VMs or containers.

Signed-off-by: Anthony Harivel <aharivel@redhat.com>
2026-02-08 12:50:40 +01:00
..