From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Duyck Subject: [iwl next-queue PATCH 07/10] macvlan: Provide function for interfaces to release HW offload Date: Tue, 03 Apr 2018 17:16:30 -0400 Message-ID: <20180403211630.7880.85594.stgit@ahduyck-green-test.jf.intel.com> References: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com Return-path: Received: from mga01.intel.com ([192.55.52.88]:11707 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753842AbeDCVXG (ORCPT ); Tue, 3 Apr 2018 17:23:06 -0400 In-Reply-To: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- include/linux/if_macvlan.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 0221390..2e55e4c 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -97,4 +97,12 @@ static inline bool macvlan_supports_dest_filter(struct net_device *dev) macvlan->mode == MACVLAN_MODE_VEPA || macvlan->mode == MACVLAN_MODE_BRIDGE; } + +static inline int macvlan_release_l2fw_offload(struct net_device *dev) +{ + struct macvlan_dev *macvlan = netdev_priv(dev); + + macvlan->accel_priv = NULL; + return dev_uc_add(macvlan->lowerdev, dev->dev_addr); +} #endif /* _LINUX_IF_MACVLAN_H */