netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: 802.1q: make vlan_hwaccel_do_receive() return void
@ 2010-08-22 23:31 Changli Gao
  2010-08-23  4:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Changli Gao @ 2010-08-22 23:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: Patrick McHardy, netdev, Changli Gao

vlan_hwaccel_do_receive() always returns 0, so make it return void.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 include/linux/if_vlan.h |    5 ++---
 net/8021q/vlan_core.c   |    3 +--
 net/core/dev.c          |    4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 3d870fd..a523207 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -119,7 +119,7 @@ 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 int vlan_hwaccel_do_receive(struct sk_buff *skb);
+extern void 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);
@@ -147,9 +147,8 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
 	return NET_XMIT_SUCCESS;
 }
 
-static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
+static inline void vlan_hwaccel_do_receive(struct sk_buff *skb)
 {
-	return 0;
 }
 
 static inline gro_result_t
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 01ddb04..07eeb5b 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -35,7 +35,7 @@ drop:
 }
 EXPORT_SYMBOL(__vlan_hwaccel_rx);
 
-int vlan_hwaccel_do_receive(struct sk_buff *skb)
+void vlan_hwaccel_do_receive(struct sk_buff *skb)
 {
 	struct net_device *dev = skb->dev;
 	struct vlan_rx_stats     *rx_stats;
@@ -69,7 +69,6 @@ int vlan_hwaccel_do_receive(struct sk_buff *skb)
 		break;
 	}
 	u64_stats_update_end(&rx_stats->syncp);
-	return 0;
 }
 
 struct net_device *vlan_dev_real_dev(const struct net_device *dev)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7cd5237..d569f88 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2841,8 +2841,8 @@ static int __netif_receive_skb(struct sk_buff *skb)
 	if (!netdev_tstamp_prequeue)
 		net_timestamp_check(skb);
 
-	if (vlan_tx_tag_present(skb) && vlan_hwaccel_do_receive(skb))
-		return NET_RX_SUCCESS;
+	if (vlan_tx_tag_present(skb))
+		vlan_hwaccel_do_receive(skb);
 
 	/* if we've gotten here through NAPI, check netpoll */
 	if (netpoll_receive_skb(skb))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: 802.1q: make vlan_hwaccel_do_receive() return void
  2010-08-22 23:31 [PATCH] net: 802.1q: make vlan_hwaccel_do_receive() return void Changli Gao
@ 2010-08-23  4:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-08-23  4:03 UTC (permalink / raw)
  To: xiaosuo; +Cc: kaber, netdev, herbert

From: Changli Gao <xiaosuo@gmail.com>
Date: Mon, 23 Aug 2010 07:31:58 +0800

> @@ -2841,8 +2841,8 @@ static int __netif_receive_skb(struct sk_buff *skb)
>  	if (!netdev_tstamp_prequeue)
>  		net_timestamp_check(skb);
>  
> -	if (vlan_tx_tag_present(skb) && vlan_hwaccel_do_receive(skb))
> -		return NET_RX_SUCCESS;
> +	if (vlan_tx_tag_present(skb))
> +		vlan_hwaccel_do_receive(skb);
>  

Ok, I see how this happened.  The code here first came from
Patrick:

commit 9b22ea560957de1484e6b3e8538f7eef202e3596
 ...
    net: fix packet socket delivery in rx irq handler

And back then vlan_hwaccel_do_receive() returned "-1" and freed the
packet if cb->dev was NULL.

Herbert then added the GRO containers in:

commit e1c096e251e52773afeffbbcb74d0a072be47ea3
 ...
    vlan: Add GRO interfaces

where skb->dev now stores what cb->dev used to, and the "-1"
return and cb->dev check were thus removed.

Anyways, with how things stand now this patch looks fine and
I'll apply it to net-next-2.6, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-23  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-22 23:31 [PATCH] net: 802.1q: make vlan_hwaccel_do_receive() return void Changli Gao
2010-08-23  4:03 ` David Miller

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).