Netdev List
 help / color / mirror / Atom feed
* [RFC PATCH 2/4] netdev: new feature flag NETIF_F_HW_OFFLOAD to indicate netdev object offload to hardware
@ 2014-11-21 22:49 roopa
  0 siblings, 0 replies; only message in thread
From: roopa @ 2014-11-21 22:49 UTC (permalink / raw)
  To: jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
	linville, nhorman, nicolas.dichtel, vyasevic, f.fainelli, buytenh,
	aviadr
  Cc: netdev, davem, shrijeet, gospo, Roopa Prabhu

From: Roopa Prabhu <roopa@cumulusnetworks.com>

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-21 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21 22:49 [RFC PATCH 2/4] netdev: new feature flag NETIF_F_HW_OFFLOAD to indicate netdev object offload to hardware roopa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox