aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-04-11 02:56:11 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-13 06:32:42 -0400
commitacbbc07145b919248c410e1852b953d385be5c97 (patch)
treebafccb1c98540a2e6758df44ef72b6c2d55a2a78 /include/linux/netdevice.h
parent829e0015431537176e38812f88fffe1d3250083e (diff)
net: uninline skb_bond_should_drop()
skb_bond_should_drop() is too big to be inlined. This patch reduces kernel text size, and its compilation time as well (shrinking include/linux/netdevice.h) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h48
1 files changed, 4 insertions, 44 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d1a21b576a40..470f7c951afb 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2089,54 +2089,14 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
2089 dev->gso_max_size = size; 2089 dev->gso_max_size = size;
2090} 2090}
2091 2091
2092static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, 2092extern int __skb_bond_should_drop(struct sk_buff *skb,
2093 struct net_device *master) 2093 struct net_device *master);
2094{
2095 if (skb->pkt_type == PACKET_HOST) {
2096 u16 *dest = (u16 *) eth_hdr(skb)->h_dest;
2097
2098 memcpy(dest, master->dev_addr, ETH_ALEN);
2099 }
2100}
2101 2094
2102/* On bonding slaves other than the currently active slave, suppress
2103 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
2104 * ARP on active-backup slaves with arp_validate enabled.
2105 */
2106static inline int skb_bond_should_drop(struct sk_buff *skb, 2095static inline int skb_bond_should_drop(struct sk_buff *skb,
2107 struct net_device *master) 2096 struct net_device *master)
2108{ 2097{
2109 if (master) { 2098 if (master)
2110 struct net_device *dev = skb->dev; 2099 return __skb_bond_should_drop(skb, master);
2111
2112 if (master->priv_flags & IFF_MASTER_ARPMON)
2113 dev->last_rx = jiffies;
2114
2115 if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) {
2116 /* Do address unmangle. The local destination address
2117 * will be always the one master has. Provides the right
2118 * functionality in a bridge.
2119 */
2120 skb_bond_set_mac_by_master(skb, master);
2121 }
2122
2123 if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
2124 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
2125 skb->protocol == __cpu_to_be16(ETH_P_ARP))
2126 return 0;
2127
2128 if (master->priv_flags & IFF_MASTER_ALB) {
2129 if (skb->pkt_type != PACKET_BROADCAST &&
2130 skb->pkt_type != PACKET_MULTICAST)
2131 return 0;
2132 }
2133 if (master->priv_flags & IFF_MASTER_8023AD &&
2134 skb->protocol == __cpu_to_be16(ETH_P_SLOW))
2135 return 0;
2136
2137 return 1;
2138 }
2139 }
2140 return 0; 2100 return 0;
2141} 2101}
2142 2102