aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-08-14 20:08:36 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-08-17 19:29:46 -0400
commit7ea49ed73c8d0d0bdf7c11fc18c61572d2d22176 (patch)
tree09cf48c5f48bdee89b7a2579ba4c7b072ca842e9 /include/linux/netdevice.h
parent774bd8613d0188cda72408f8ffce258d73953cad (diff)
[VLAN]: Make sure bonding packet drop checks get done in hwaccel RX path.
Since __vlan_hwaccel_rx() is essentially bypassing the netif_receive_skb() call that would have occurred if we did the VLAN decapsulation in software, we are missing the skb_bond() call and the assosciated checks it does. Export those checks via an inline function, skb_bond_should_drop(), and use this in __vlan_hwaccel_rx(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 75f02d8c6ed3..c0c2b46face1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1012,6 +1012,30 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1012 unlikely(skb->ip_summed != CHECKSUM_HW)); 1012 unlikely(skb->ip_summed != CHECKSUM_HW));
1013} 1013}
1014 1014
1015/* On bonding slaves other than the currently active slave, suppress
1016 * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast.
1017 */
1018static inline int skb_bond_should_drop(struct sk_buff *skb)
1019{
1020 struct net_device *dev = skb->dev;
1021 struct net_device *master = dev->master;
1022
1023 if (master &&
1024 (dev->priv_flags & IFF_SLAVE_INACTIVE)) {
1025 if (master->priv_flags & IFF_MASTER_ALB) {
1026 if (skb->pkt_type != PACKET_BROADCAST &&
1027 skb->pkt_type != PACKET_MULTICAST)
1028 return 0;
1029 }
1030 if (master->priv_flags & IFF_MASTER_8023AD &&
1031 skb->protocol == __constant_htons(ETH_P_SLOW))
1032 return 0;
1033
1034 return 1;
1035 }
1036 return 0;
1037}
1038
1015#endif /* __KERNEL__ */ 1039#endif /* __KERNEL__ */
1016 1040
1017#endif /* _LINUX_DEV_H */ 1041#endif /* _LINUX_DEV_H */