--- zzzz-none-000/linux-5.4.213/include/linux/if_macvlan.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/include/linux/if_macvlan.h 2024-08-14 09:02:08.000000000 +0000 @@ -15,6 +15,11 @@ #define MACVLAN_MC_FILTER_BITS 8 #define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) +/* + * Callback for updating interface statistics for macvlan flows offloaded from host CPU. + */ +typedef void (*macvlan_offload_stats_update_cb_t)(struct net_device *dev, struct rtnl_link_stats64 *stats, bool update_mcast_rx_stats); + struct macvlan_dev { struct net_device *dev; struct list_head list; @@ -33,6 +38,7 @@ #ifdef CONFIG_NET_POLL_CONTROLLER struct netpoll *netpoll; #endif + macvlan_offload_stats_update_cb_t offload_stats_update; }; static inline void macvlan_count_rx(const struct macvlan_dev *vlan, @@ -66,6 +72,24 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); #if IS_ENABLED(CONFIG_MACVLAN) +static inline void +macvlan_offload_stats_update(struct net_device *dev, + struct rtnl_link_stats64 *stats, + bool update_mcast_rx_stats) +{ + struct macvlan_dev *macvlan = netdev_priv(dev); + + macvlan->offload_stats_update(dev, stats, update_mcast_rx_stats); +} + +static inline enum +macvlan_mode macvlan_get_mode(struct net_device *dev) +{ + struct macvlan_dev *macvlan = netdev_priv(dev); + + return macvlan->mode; +} + static inline struct net_device * macvlan_dev_real_dev(const struct net_device *dev) {