aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/if_vlan.h25
-rw-r--r--include/linux/netdevice.h8
-rw-r--r--net/8021q/vlan_core.c16
-rw-r--r--net/core/dev.c38
4 files changed, 42 insertions, 45 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 71a4870c09a9..153f6b9e722c 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -120,10 +120,12 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
121 u16 vlan_tci, int polling); 121 u16 vlan_tci, int polling);
122extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 122extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
123extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 123extern gro_result_t
124 unsigned int vlan_tci, struct sk_buff *skb); 124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
125extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, 125 unsigned int vlan_tci, struct sk_buff *skb);
126 unsigned int vlan_tci); 126extern gro_result_t
127vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
128 unsigned int vlan_tci);
127 129
128#else 130#else
129static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) 131static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
@@ -150,17 +152,18 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
150 return 0; 152 return 0;
151} 153}
152 154
153static inline int vlan_gro_receive(struct napi_struct *napi, 155static inline gro_result_t
154 struct vlan_group *grp, 156vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
155 unsigned int vlan_tci, struct sk_buff *skb) 157 unsigned int vlan_tci, struct sk_buff *skb)
156{ 158{
157 return NET_RX_DROP; 159 return GRO_DROP;
158} 160}
159 161
160static inline int vlan_gro_frags(struct napi_struct *napi, 162static inline gro_result_t
161 struct vlan_group *grp, unsigned int vlan_tci) 163vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
164 unsigned int vlan_tci)
162{ 165{
163 return NET_RX_DROP; 166 return GRO_DROP;
164} 167}
165#endif 168#endif
166 169
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6e777efe149e..193b637889f9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1483,17 +1483,17 @@ extern int netif_receive_skb(struct sk_buff *skb);
1483extern void napi_gro_flush(struct napi_struct *napi); 1483extern void napi_gro_flush(struct napi_struct *napi);
1484extern gro_result_t dev_gro_receive(struct napi_struct *napi, 1484extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1485 struct sk_buff *skb); 1485 struct sk_buff *skb);
1486extern int napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1486extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1487extern int napi_gro_receive(struct napi_struct *napi, 1487extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1488 struct sk_buff *skb); 1488 struct sk_buff *skb);
1489extern void napi_reuse_skb(struct napi_struct *napi, 1489extern void napi_reuse_skb(struct napi_struct *napi,
1490 struct sk_buff *skb); 1490 struct sk_buff *skb);
1491extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1491extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1492extern int napi_frags_finish(struct napi_struct *napi, 1492extern gro_result_t napi_frags_finish(struct napi_struct *napi,
1493 struct sk_buff *skb, 1493 struct sk_buff *skb,
1494 gro_result_t ret); 1494 gro_result_t ret);
1495extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); 1495extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
1496extern int napi_gro_frags(struct napi_struct *napi); 1496extern gro_result_t napi_gro_frags(struct napi_struct *napi);
1497 1497
1498static inline void napi_free_frags(struct napi_struct *napi) 1498static inline void napi_free_frags(struct napi_struct *napi)
1499{ 1499{
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 47a80d65c3b7..8d5ca2ac4f8d 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -102,11 +102,12 @@ drop:
102 return GRO_DROP; 102 return GRO_DROP;
103} 103}
104 104
105int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 105gro_result_t vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
106 unsigned int vlan_tci, struct sk_buff *skb) 106 unsigned int vlan_tci, struct sk_buff *skb)
107{ 107{
108 if (netpoll_rx_on(skb)) 108 if (netpoll_rx_on(skb))
109 return vlan_hwaccel_receive_skb(skb, grp, vlan_tci); 109 return vlan_hwaccel_receive_skb(skb, grp, vlan_tci)
110 ? GRO_DROP : GRO_NORMAL;
110 111
111 skb_gro_reset_offset(skb); 112 skb_gro_reset_offset(skb);
112 113
@@ -114,17 +115,18 @@ int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
114} 115}
115EXPORT_SYMBOL(vlan_gro_receive); 116EXPORT_SYMBOL(vlan_gro_receive);
116 117
117int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, 118gro_result_t vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
118 unsigned int vlan_tci) 119 unsigned int vlan_tci)
119{ 120{
120 struct sk_buff *skb = napi_frags_skb(napi); 121 struct sk_buff *skb = napi_frags_skb(napi);
121 122
122 if (!skb) 123 if (!skb)
123 return NET_RX_DROP; 124 return GRO_DROP;
124 125
125 if (netpoll_rx_on(skb)) { 126 if (netpoll_rx_on(skb)) {
126 skb->protocol = eth_type_trans(skb, skb->dev); 127 skb->protocol = eth_type_trans(skb, skb->dev);
127 return vlan_hwaccel_receive_skb(skb, grp, vlan_tci); 128 return vlan_hwaccel_receive_skb(skb, grp, vlan_tci)
129 ? GRO_DROP : GRO_NORMAL;
128 } 130 }
129 131
130 return napi_frags_finish(napi, skb, 132 return napi_frags_finish(napi, skb,
diff --git a/net/core/dev.c b/net/core/dev.c
index 1dc13744684c..631cc40da197 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2586,18 +2586,15 @@ __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2586 return dev_gro_receive(napi, skb); 2586 return dev_gro_receive(napi, skb);
2587} 2587}
2588 2588
2589int napi_skb_finish(gro_result_t ret, struct sk_buff *skb) 2589gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
2590{ 2590{
2591 int err = NET_RX_SUCCESS;
2592
2593 switch (ret) { 2591 switch (ret) {
2594 case GRO_NORMAL: 2592 case GRO_NORMAL:
2595 return netif_receive_skb(skb); 2593 if (netif_receive_skb(skb))
2594 ret = GRO_DROP;
2595 break;
2596 2596
2597 case GRO_DROP: 2597 case GRO_DROP:
2598 err = NET_RX_DROP;
2599 /* fall through */
2600
2601 case GRO_MERGED_FREE: 2598 case GRO_MERGED_FREE:
2602 kfree_skb(skb); 2599 kfree_skb(skb);
2603 break; 2600 break;
@@ -2607,7 +2604,7 @@ int napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
2607 break; 2604 break;
2608 } 2605 }
2609 2606
2610 return err; 2607 return ret;
2611} 2608}
2612EXPORT_SYMBOL(napi_skb_finish); 2609EXPORT_SYMBOL(napi_skb_finish);
2613 2610
@@ -2627,7 +2624,7 @@ void skb_gro_reset_offset(struct sk_buff *skb)
2627} 2624}
2628EXPORT_SYMBOL(skb_gro_reset_offset); 2625EXPORT_SYMBOL(skb_gro_reset_offset);
2629 2626
2630int napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) 2627gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2631{ 2628{
2632 skb_gro_reset_offset(skb); 2629 skb_gro_reset_offset(skb);
2633 2630
@@ -2657,26 +2654,21 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
2657} 2654}
2658EXPORT_SYMBOL(napi_get_frags); 2655EXPORT_SYMBOL(napi_get_frags);
2659 2656
2660int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, 2657gro_result_t napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb,
2661 gro_result_t ret) 2658 gro_result_t ret)
2662{ 2659{
2663 int err = NET_RX_SUCCESS;
2664
2665 switch (ret) { 2660 switch (ret) {
2666 case GRO_NORMAL: 2661 case GRO_NORMAL:
2667 case GRO_HELD: 2662 case GRO_HELD:
2668 skb->protocol = eth_type_trans(skb, napi->dev); 2663 skb->protocol = eth_type_trans(skb, napi->dev);
2669 2664
2670 if (ret == GRO_NORMAL) 2665 if (ret == GRO_HELD)
2671 return netif_receive_skb(skb); 2666 skb_gro_pull(skb, -ETH_HLEN);
2672 2667 else if (netif_receive_skb(skb))
2673 skb_gro_pull(skb, -ETH_HLEN); 2668 ret = GRO_DROP;
2674 break; 2669 break;
2675 2670
2676 case GRO_DROP: 2671 case GRO_DROP:
2677 err = NET_RX_DROP;
2678 /* fall through */
2679
2680 case GRO_MERGED_FREE: 2672 case GRO_MERGED_FREE:
2681 napi_reuse_skb(napi, skb); 2673 napi_reuse_skb(napi, skb);
2682 break; 2674 break;
@@ -2685,7 +2677,7 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb,
2685 break; 2677 break;
2686 } 2678 }
2687 2679
2688 return err; 2680 return ret;
2689} 2681}
2690EXPORT_SYMBOL(napi_frags_finish); 2682EXPORT_SYMBOL(napi_frags_finish);
2691 2683
@@ -2726,12 +2718,12 @@ out:
2726} 2718}
2727EXPORT_SYMBOL(napi_frags_skb); 2719EXPORT_SYMBOL(napi_frags_skb);
2728 2720
2729int napi_gro_frags(struct napi_struct *napi) 2721gro_result_t napi_gro_frags(struct napi_struct *napi)
2730{ 2722{
2731 struct sk_buff *skb = napi_frags_skb(napi); 2723 struct sk_buff *skb = napi_frags_skb(napi);
2732 2724
2733 if (!skb) 2725 if (!skb)
2734 return NET_RX_DROP; 2726 return GRO_DROP;
2735 2727
2736 return napi_frags_finish(napi, skb, __napi_gro_receive(napi, skb)); 2728 return napi_frags_finish(napi, skb, __napi_gro_receive(napi, skb));
2737} 2729}