Skip to content

Commit 53cd4d8

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
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 <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 6cb1937 commit 53cd4d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/linux/if_macvlan.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,12 @@ static inline bool macvlan_supports_dest_filter(struct net_device *dev)
9797
macvlan->mode == MACVLAN_MODE_VEPA ||
9898
macvlan->mode == MACVLAN_MODE_BRIDGE;
9999
}
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+
}
100108
#endif /* _LINUX_IF_MACVLAN_H */

0 commit comments

Comments
 (0)