Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66686
b: refs/heads/master
c: 8236632
h: refs/heads/master
v: v3
  • Loading branch information
Jamal Hadi Salim authored and David S. Miller committed Oct 10, 2007
1 parent 79c8000 commit 463afdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 854d8363f37491c955b0edc60d37b62f3d71bb67
refs/heads/master: 8236632fb3532188c75656421e29f5ab51b47db7
19 changes: 2 additions & 17 deletions trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,34 +134,19 @@ static inline int qdisc_restart(struct net_device *dev)
{
struct Qdisc *q = dev->qdisc;
struct sk_buff *skb;
unsigned lockless;
int ret;

/* Dequeue packet */
if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL))
return 0;

/*
* When the driver has LLTX set, it does its own locking in
* start_xmit. These checks are worth it because even uncongested
* locks can be quite expensive. The driver can do a trylock, as
* is being done here; in case of lock contention it should return
* NETDEV_TX_LOCKED and the packet will be requeued.
*/
lockless = (dev->features & NETIF_F_LLTX);

if (!lockless && !netif_tx_trylock(dev)) {
/* Another CPU grabbed the driver tx lock */
return handle_dev_cpu_collision(skb, dev, q);
}

/* And release queue */
spin_unlock(&dev->queue_lock);

HARD_TX_LOCK(dev, smp_processor_id());
ret = dev_hard_start_xmit(skb, dev);

if (!lockless)
netif_tx_unlock(dev);
HARD_TX_UNLOCK(dev);

spin_lock(&dev->queue_lock);
q = dev->qdisc;
Expand Down

0 comments on commit 463afdb

Please sign in to comment.