• Petr Machata's avatar
    net: rtnetlink: Stop assuming that IFLA_OFFLOAD_XSTATS_* are dev-backed · f6e0fb81
    Petr Machata authored
    The IFLA_STATS_LINK_OFFLOAD_XSTATS attribute is a nest whose child
    attributes carry various special hardware statistics. The code that handles
    this nest was written with the idea that all these statistics would be
    exposed by the device driver of a physical netdevice.
    
    In the following patches, a new attribute is added to the abovementioned
    nest, which however can be defined for some soft netdevices. The NDO-based
    approach to querying these does not work, because it is not the soft
    netdevice driver that exposes these statistics, but an offloading NIC
    driver that does so.
    
    The current code does not scale well to this usage. Simply rewrite it back
    to the pattern seen in other fill-like and get_size-like functions
    elsewhere.
    
    Extract to helpers the code that is concerned with handling specifically
    NDO-backed statistics so that it can be easily reused should more such
    statistics be added.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f6e0fb81
rtnetlink.c 138 KB