aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
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 /net/core/dev.c
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 'net/core/dev.c')
-rw-r--r--net/core/dev.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ca4cdef74a1b..876b1112d5ba 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2646,6 +2646,55 @@ void netif_nit_deliver(struct sk_buff *skb)
2646 rcu_read_unlock(); 2646 rcu_read_unlock();
2647} 2647}
2648 2648
2649static inline void skb_bond_set_mac_by_master(struct sk_buff *skb,
2650 struct net_device *master)
2651{
2652 if (skb->pkt_type == PACKET_HOST) {
2653 u16 *dest = (u16 *) eth_hdr(skb)->h_dest;
2654
2655 memcpy(dest, master->dev_addr, ETH_ALEN);
2656 }
2657}
2658
2659/* On bonding slaves other than the currently active slave, suppress
2660 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
2661 * ARP on active-backup slaves with arp_validate enabled.
2662 */
2663int __skb_bond_should_drop(struct sk_buff *skb, struct net_device *master)
2664{
2665 struct net_device *dev = skb->dev;
2666
2667 if (master->priv_flags & IFF_MASTER_ARPMON)
2668 dev->last_rx = jiffies;
2669
2670 if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) {
2671 /* Do address unmangle. The local destination address
2672 * will be always the one master has. Provides the right
2673 * functionality in a bridge.
2674 */
2675 skb_bond_set_mac_by_master(skb, master);
2676 }
2677
2678 if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
2679 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
2680 skb->protocol == __cpu_to_be16(ETH_P_ARP))
2681 return 0;
2682
2683 if (master->priv_flags & IFF_MASTER_ALB) {
2684 if (skb->pkt_type != PACKET_BROADCAST &&
2685 skb->pkt_type != PACKET_MULTICAST)
2686 return 0;
2687 }
2688 if (master->priv_flags & IFF_MASTER_8023AD &&
2689 skb->protocol == __cpu_to_be16(ETH_P_SLOW))
2690 return 0;
2691
2692 return 1;
2693 }
2694 return 0;
2695}
2696EXPORT_SYMBOL(__skb_bond_should_drop);
2697
2649static int __netif_receive_skb(struct sk_buff *skb) 2698static int __netif_receive_skb(struct sk_buff *skb)
2650{ 2699{
2651 struct packet_type *ptype, *pt_prev; 2700 struct packet_type *ptype, *pt_prev;