netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Gross <jesse@nicira.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH v2 14/14] vlan: Remove accleration legacy functions.
Date: Wed, 20 Oct 2010 16:56:14 -0700	[thread overview]
Message-ID: <1287618974-4714-15-git-send-email-jesse@nicira.com> (raw)
In-Reply-To: <1287618974-4714-1-git-send-email-jesse@nicira.com>

This removes the explicit vlan accleration functions that acted
as shims in favor of the main receive functions that can now
handle vlans.

Signed-off-by: Jesse Gross <jesse@nicira.com>
--
This patch can only be applied once all drivers that use vlan acceleration
have been converted over to the new model.
---
 include/linux/if_vlan.h   |   63 +++------------------------------------------
 include/linux/netdevice.h |    8 -----
 net/8021q/vlan.c          |    7 +----
 net/8021q/vlan_core.c     |   25 ------------------
 4 files changed, 5 insertions(+), 98 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a0d9786..e607256 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -74,6 +74,10 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
 /* found in socket.c */
 extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
 
+#define vlan_tx_tag_present(__skb)	((__skb)->vlan_tci & VLAN_TAG_PRESENT)
+#define vlan_tx_tag_get(__skb)		((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
+
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 /* if this changes, algorithm will have to be reworked because this
  * depends on completely exhausting the VLAN identifier space.  Thus
  * it gives constant time look-up, but in many cases it wastes memory.
@@ -111,10 +115,6 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
 	array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
 }
 
-#define vlan_tx_tag_present(__skb)	((__skb)->vlan_tci & VLAN_TAG_PRESENT)
-#define vlan_tx_tag_get(__skb)		((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
-
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 /* Must be invoked with rcu_read_lock or with RTNL. */
 static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
 					       u16 vlan_id)
@@ -130,15 +130,7 @@ static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
 extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
 extern u16 vlan_dev_vlan_id(const struct net_device *dev);
 
-extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
-			     u16 vlan_tci, int polling);
 extern bool vlan_hwaccel_do_receive(struct sk_buff **skb);
-extern gro_result_t
-vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
-		 unsigned int vlan_tci, struct sk_buff *skb);
-extern gro_result_t
-vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
-	       unsigned int vlan_tci);
 
 #else
 static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
@@ -159,61 +151,14 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
 	return 0;
 }
 
-static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
-				    u16 vlan_tci, int polling)
-{
-	BUG();
-	return NET_XMIT_SUCCESS;
-}
-
 static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
 {
 	BUG();
 	return false;
 }
-
-static inline gro_result_t
-vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
-		 unsigned int vlan_tci, struct sk_buff *skb)
-{
-	return GRO_DROP;
-}
-
-static inline gro_result_t
-vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
-	       unsigned int vlan_tci)
-{
-	return GRO_DROP;
-}
 #endif
 
 /**
- * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration
- * @skb: buffer
- * @grp: vlan group
- * @vlan_tci: VLAN TCI as received from the card
- */
-static inline int vlan_hwaccel_rx(struct sk_buff *skb,
-				  struct vlan_group *grp,
-				  u16 vlan_tci)
-{
-	return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
-}
-
-/**
- * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
- * @skb: buffer
- * @grp: vlan group
- * @vlan_tci: VLAN TCI as received from the card
- */
-static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
-					   struct vlan_group *grp,
-					   u16 vlan_tci)
-{
-	return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
-}
-
-/**
  * __vlan_put_tag - regular VLAN tag inserting
  * @skb: skbuff to tag
  * @vlan_tci: VLAN TCI to insert
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ed7db7e..22c3c46 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -682,12 +682,6 @@ struct netdev_rx_queue {
  *	3. Update dev->stats asynchronously and atomically, and define
  *	   neither operation.
  *
- * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
- *	If device support VLAN receive accleration
- *	(ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
- *	when vlan groups for the device changes.  Note: grp is NULL
- *	if no vlan's groups are being used.
- *
  * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
  *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
  *	this function is called when a VLAN id is registered.
@@ -739,8 +733,6 @@ struct net_device_ops {
 						     struct rtnl_link_stats64 *storage);
 	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
 
-	void			(*ndo_vlan_rx_register)(struct net_device *dev,
-						        struct vlan_group *grp);
 	void			(*ndo_vlan_rx_add_vid)(struct net_device *dev,
 						       unsigned short vid);
 	void			(*ndo_vlan_rx_kill_vid)(struct net_device *dev,
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 05b867e..4e91db3 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -135,8 +135,6 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
 		vlan_gvrp_uninit_applicant(real_dev);
 
 		rcu_assign_pointer(real_dev->vlgrp, NULL);
-		if (ops->ndo_vlan_rx_register)
-			ops->ndo_vlan_rx_register(real_dev, NULL);
 
 		/* Free the group, after all cpu's are done. */
 		call_rcu(&grp->rcu, vlan_rcu_free);
@@ -207,11 +205,8 @@ int register_vlan_dev(struct net_device *dev)
 	vlan_group_set_device(grp, vlan_id, dev);
 	grp->nr_vlans++;
 
-	if (ngrp) {
-		if (ops->ndo_vlan_rx_register)
-			ops->ndo_vlan_rx_register(real_dev, ngrp);
+	if (ngrp)
 		rcu_assign_pointer(real_dev->vlgrp, ngrp);
-	}
 	if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
 		ops->ndo_vlan_rx_add_vid(real_dev, vlan_id);
 
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 69b2f79..4d6a2b8 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -63,28 +63,3 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
 	return vlan_dev_info(dev)->vlan_id;
 }
 EXPORT_SYMBOL(vlan_dev_vlan_id);
-
-/* VLAN rx hw acceleration helper.  This acts like netif_{rx,receive_skb}(). */
-int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
-		      u16 vlan_tci, int polling)
-{
-	__vlan_hwaccel_put_tag(skb, vlan_tci);
-	return polling ? netif_receive_skb(skb) : netif_rx(skb);
-}
-EXPORT_SYMBOL(__vlan_hwaccel_rx);
-
-gro_result_t vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
-			      unsigned int vlan_tci, struct sk_buff *skb)
-{
-	__vlan_hwaccel_put_tag(skb, vlan_tci);
-	return napi_gro_receive(napi, skb);
-}
-EXPORT_SYMBOL(vlan_gro_receive);
-
-gro_result_t vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
-			    unsigned int vlan_tci)
-{
-	__vlan_hwaccel_put_tag(napi->skb, vlan_tci);
-	return napi_gro_frags(napi);
-}
-EXPORT_SYMBOL(vlan_gro_frags);
-- 
1.7.1


  parent reply	other threads:[~2010-10-20 23:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 23:56 [PATCH v2 00/14] Move vlan acceleration into networking core Jesse Gross
2010-10-20 23:56 ` [PATCH v2 01/14] ebtables: Allow filtering of hardware accelerated vlan frames Jesse Gross
2010-10-20 23:56 ` [PATCH v2 02/14] vlan: Rename VLAN_GROUP_ARRAY_LEN to VLAN_N_VID Jesse Gross
2010-10-20 23:56 ` [PATCH v2 03/14] vlan: Don't check for vlan group before vlan_tx_tag_present Jesse Gross
2010-10-20 23:56 ` [PATCH v2 04/14] vlan: Enable software emulation for vlan accleration Jesse Gross
2010-10-21  3:32   ` John Fastabend
2010-10-21 15:30   ` Ben Hutchings
2010-10-21 21:44     ` Jesse Gross
2010-10-22 14:12       ` [PATCH net-next-2.6] net: Fix some corner cases in dev_can_checksum() Ben Hutchings
2010-10-22 14:18         ` Ben Hutchings
2010-10-26  0:21         ` Jesse Gross
2010-10-26 13:29           ` Ben Hutchings
2010-10-26 18:11             ` Jesse Gross
2010-10-27 18:00         ` David Miller
2010-10-20 23:56 ` [PATCH v2 05/14] vlan: Avoid hash table lookup to find group Jesse Gross
2010-10-20 23:56 ` [PATCH v2 06/14] vlan: Centralize handling of hardware acceleration Jesse Gross
2010-10-20 23:56 ` [PATCH v2 07/14] ethtool: Add support for vlan accleration Jesse Gross
2010-10-21  3:27   ` John Fastabend
2010-10-21 19:43     ` Jesse Gross
2010-10-20 23:56 ` [PATCH v2 08/14] bridge: Add support for TX vlan offload Jesse Gross
2010-10-20 23:56 ` [PATCH v2 09/14] bnx2: Update bnx2 to use new vlan accleration Jesse Gross
2010-10-21 15:31   ` Ben Hutchings
2010-10-21 21:38     ` Jesse Gross
2010-10-20 23:56 ` [PATCH v2 10/14] ixgbe: Update ixgbe " Jesse Gross
2010-10-22 13:24   ` Michał Mirosław
2010-10-25 17:50     ` Peter P Waskiewicz Jr
2010-10-25 21:40       ` Michał Mirosław
2010-10-25 22:02         ` John Fastabend
2010-10-25 23:23           ` Michał Mirosław
2010-10-26  0:08             ` Jesse Gross
2010-10-20 23:56 ` [PATCH v2 11/14] bnx2x: Update bnx2x " Jesse Gross
2010-10-21 13:54   ` Vladislav Zolotarov
2010-10-21 14:02     ` Vladislav Zolotarov
2010-10-21 14:50       ` Vladislav Zolotarov
2010-10-21 21:36         ` Jesse Gross
2010-10-22  0:57           ` Dmitry Kravkov
2010-10-24  9:21           ` Vladislav Zolotarov
2010-10-24 10:11             ` Vladislav Zolotarov
2010-10-26  0:29               ` Jesse Gross
2010-10-26  9:14                 ` Vladislav Zolotarov
2010-10-26 17:57                   ` Jesse Gross
2010-10-21 21:34       ` Jesse Gross
2010-10-20 23:56 ` [PATCH v2 12/14] lro: Remove explicit vlan support Jesse Gross
2010-10-20 23:56 ` [PATCH v2 13/14] bonding: Update bonding for new vlan model Jesse Gross
2010-10-20 23:56 ` Jesse Gross [this message]
2010-10-21  2:02 ` [PATCH v2 00/14] Move vlan acceleration into networking core David Dillow
2010-10-21 19:32   ` Jesse Gross
2010-10-21  8:33 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287618974-4714-15-git-send-email-jesse@nicira.com \
    --to=jesse@nicira.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).