Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macvlan: Provide function for interfaces to release HW offload

This patch provides a basic function to allow a lower device to disable
macvlan offload if it was previously enabled on a given macvlan. The idea
here is to allow for recovery from failure should the lowerdev run out of
resources.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Alexander Duyck and committed by
Jeff Kirsher
53cd4d8e 6cb1937d

+8
+8
include/linux/if_macvlan.h
··· 97 97 macvlan->mode == MACVLAN_MODE_VEPA || 98 98 macvlan->mode == MACVLAN_MODE_BRIDGE; 99 99 } 100 + 101 + static inline int macvlan_release_l2fw_offload(struct net_device *dev) 102 + { 103 + struct macvlan_dev *macvlan = netdev_priv(dev); 104 + 105 + macvlan->accel_priv = NULL; 106 + return dev_uc_add(macvlan->lowerdev, dev->dev_addr); 107 + } 100 108 #endif /* _LINUX_IF_MACVLAN_H */