Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103395
b: refs/heads/master
c: 6fa9864
h: refs/heads/master
i:
  103393: cc55a10
  103391: f8008ac
v: v3
  • Loading branch information
David S. Miller committed Jul 9, 2008
1 parent d9c580b commit f271308
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 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: 3e745dd6950d72d19e4cb30dc44307e8d6671864
refs/heads/master: 6fa9864b53f0680e432a2c431c2cf2055daa3a88
8 changes: 8 additions & 0 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev)
return (q->q.qlen == 0);
}

/* Are any of the TX qdiscs changing? */
static inline bool qdisc_tx_changing(struct net_device *dev)
{
struct netdev_queue *txq = &dev->tx_queue;

return (txq->qdisc != txq->qdisc_sleeping);
}

static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff_head *list)
{
Expand Down
15 changes: 5 additions & 10 deletions trunk/net/core/link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ static void rfc2863_policy(struct net_device *dev)
}


static int linkwatch_urgent_event(struct net_device *dev)
static bool linkwatch_urgent_event(struct net_device *dev)
{
struct netdev_queue *txq = &dev->tx_queue;

return netif_running(dev) && netif_carrier_ok(dev) &&
txq->qdisc != txq->qdisc_sleeping;
qdisc_tx_changing(dev);
}


Expand Down Expand Up @@ -182,12 +180,9 @@ static void __linkwatch_run_queue(int urgent_only)

rfc2863_policy(dev);
if (dev->flags & IFF_UP) {
if (netif_carrier_ok(dev)) {
struct netdev_queue *txq = &dev->tx_queue;

WARN_ON(txq->qdisc_sleeping == &noop_qdisc);
if (netif_carrier_ok(dev))
dev_activate(dev);
} else
else
dev_deactivate(dev);

netdev_state_change(dev);
Expand Down Expand Up @@ -218,7 +213,7 @@ static void linkwatch_event(struct work_struct *dummy)

void linkwatch_fire_event(struct net_device *dev)
{
int urgent = linkwatch_urgent_event(dev);
bool urgent = linkwatch_urgent_event(dev);

if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) {
dev_hold(dev);
Expand Down

0 comments on commit f271308

Please sign in to comment.