Message ID | 200908311429.n7VETlTi000764@cmf.nrl.navy.mil |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: "Chas Williams (CONTRACTOR)" <chas@cmf.nrl.navy.mil> Date: Mon, 31 Aug 2009 10:29:47 -0400 > This patch removes the call to dev_kfree_skb() when the atm device is busy. > Calling dev_kfree_skb() causes heavy packet loss then the device is under > heavy load, the more correct behavior should be to stop the upper layers, > then when the lower device can queue packets again wake the upper layers. > > Signed-off-by: Karl Hiramoto <karl@hiramoto.org> > Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Applied to net-next-2.6, but Chas your email client corrupted the patch by breaking up long lines: > @@ -142,6 +142,22 @@ static struct net_device *br2684_find_dev(const struct br > 2684_if_spec *s) Like that. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
In message <20090902.232707.93089975.davem@davemloft.net>,David Miller writes: >Applied to net-next-2.6, but Chas your email client corrupted >the patch by breaking up long lines: grr.... i will fix it (again). thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 2912665..5c42225 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -69,7 +69,7 @@ struct br2684_vcc { struct net_device *device; /* keep old push, pop functions for chaining */ void (*old_push) (struct atm_vcc * vcc, struct sk_buff * skb); - /* void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); */ + void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); enum br2684_encaps encaps; struct list_head brvccs; #ifdef CONFIG_ATM_BR2684_IPFILTER @@ -142,6 +142,22 @@ static struct net_device *br2684_find_dev(const struct br 2684_if_spec *s) return NULL; } +/* chained vcc->pop function. Check if we should wake the netif_queue */ +static void br2684_pop(struct atm_vcc *vcc, struct sk_buff *skb) +{ + struct br2684_vcc *brvcc = BR2684_VCC(vcc); + struct net_device *net_dev = skb->dev; + + pr_debug("br2684_pop(vcc %p ; net_dev %p )\n", vcc, net_dev); + brvcc->old_pop(vcc, skb); + + if (!net_dev) + return; + + if (atm_may_send(vcc, 0)) + netif_wake_queue(net_dev); + +} /* * Send a packet out a particular vcc. Not to useful right now, but paves