--- zzzz-none-000/linux-2.4.17/net/bridge/br_forward.c 2001-08-15 08:54:35.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/net/bridge/br_forward.c 2004-11-24 13:22:09.000000000 +0000 @@ -5,7 +5,7 @@ * Authors: * Lennert Buytenhek * - * $Id: br_forward.c,v 1.4 2001/08/14 22:05:57 davem Exp $ + * $Id: br_forward.c,v 1.1.1.1 2003/06/23 22:18:44 jharrell Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -32,10 +33,63 @@ static int __dev_queue_push_xmit(struct sk_buff *skb) { +#if defined (CONFIG_MIPS_AVALANCHE_FAST_BRIDGE) + struct net_device *dev = skb->dev; +#endif + struct net_bridge_port *p; + struct net_bridge *br; + int result = 0; + + p = skb->dev->br_port; + br = p->br; + + if (br->br_filter_active) { + result = br_filter_frame(skb); + + if(result) + goto throw_out; + else + goto pushthru; + } + +pushthru: skb_push(skb, ETH_HLEN); - dev_queue_xmit(skb); +#if defined (CONFIG_MIPS_AVALANCHE_FAST_BRIDGE) + if((dev->flags && IFF_UP) && + !( (netif_queue_stopped(dev)) || (skb_shinfo(skb)->frag_list) || (skb_shinfo(skb)->nr_frags) + || (netdev_nit))) + { + int cpu = smp_processor_id( ); + + if(dev->xmit_lock_owner == cpu) + goto dev_queue_xmit_lb; + + spin_lock(&dev->xmit_lock); + dev->xmit_lock_owner = cpu; + + if(dev->hard_start_xmit(skb,dev)) + { + dev->xmit_lock_owner = -1; + spin_unlock(&dev->xmit_lock); + goto dev_queue_xmit_lb; + } + + dev->xmit_lock_owner = -1; + spin_unlock(&dev->xmit_lock); + return 0; + } + +dev_queue_xmit_lb: +#endif + dev_queue_xmit(skb); return 0; + +throw_out: + printk(KERN_INFO "dropping frame ...\n"); + kfree_skb(skb); + return 0; + } static int __br_forward_finish(struct sk_buff *skb)