DORMANTno replies

[RFC PATCH 2/4] netdev: new feature flag NETIF_F_HW_OFFLOAD to indicate netdev object offload to hardware

From: <hidden>
Date: 2014-11-21 22:49:38
Subsystem: networking drivers, networking [general], the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Roopa Prabhu <redacted>

This patch adds a new NETIF_F_HW_OFFLOAD feature flag to offload logical
interfaces to hw.

Useful in cases of bridges, bonds etc where you want to offload the
logical interface attributes to hw.
---
 include/linux/netdev_features.h |    1 +
 net/core/rtnetlink.c            |    7 +++++++
 2 files changed, 8 insertions(+)
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 8e30685..09da213 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -66,6 +66,7 @@ enum {
 	NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
 	NETIF_F_HW_L2FW_DOFFLOAD_BIT,	/* Allow L2 Forwarding in Hardware */
 	NETIF_F_BUSY_POLL_BIT,		/* Busy poll */
+	NETIF_F_HW_OFFLOAD,			/* generic hw offload */
 
 	/*
 	 * Add your fresh new feature above and remember to update
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index f839354..97b8f48 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2106,6 +2106,13 @@ replay:
 			goto out;
 		}
 
+		/*
+		 * If the newlink request came in with a HW_OFFLOAD
+		 * flag, then set hw offload feature flag
+		 */
+		if (nlh->nlmsg_flags & NLM_F_HW_OFFLOAD)
+			dev->features |= NETIF_F_HW_OFFLOAD;
+
 		dev->ifindex = ifm->ifi_index;
 
 		if (ops->newlink) {
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help