Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144579
b: refs/heads/master
c: 1319eba
h: refs/heads/master
i:
  144577: c2ddf62
  144575: 5cac01f
v: v3
  • Loading branch information
Lennert Buytenhek authored and David S. Miller committed Apr 30, 2009
1 parent ca2d224 commit 97add3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 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: ddc9f824b09d790e93a800ba29ff3462f8fb5d0b
refs/heads/master: 1319ebadf185933e6b7ff95211d3cef9004e9754
22 changes: 13 additions & 9 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ struct mv643xx_eth_private {
struct work_struct tx_timeout_task;

struct napi_struct napi;
u8 oom;
u8 work_link;
u8 work_tx;
u8 work_tx_end;
u8 work_rx;
u8 work_rx_refill;
u8 work_rx_oom;

int skb_size;
struct sk_buff_head rx_recycle;
Expand Down Expand Up @@ -661,7 +661,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
dma_get_cache_alignment() - 1);

if (skb == NULL) {
mp->work_rx_oom |= 1 << rxq->index;
mp->oom = 1;
goto oom;
}

Expand Down Expand Up @@ -2167,8 +2167,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)

mp = container_of(napi, struct mv643xx_eth_private, napi);

mp->work_rx_refill |= mp->work_rx_oom;
mp->work_rx_oom = 0;
if (unlikely(mp->oom)) {
mp->oom = 0;
del_timer(&mp->rx_oom);
}

work_done = 0;
while (work_done < budget) {
Expand All @@ -2182,8 +2184,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
continue;
}

queue_mask = mp->work_tx | mp->work_tx_end |
mp->work_rx | mp->work_rx_refill;
queue_mask = mp->work_tx | mp->work_tx_end | mp->work_rx;
if (likely(!mp->oom))
queue_mask |= mp->work_rx_refill;

if (!queue_mask) {
if (mv643xx_eth_collect_events(mp))
continue;
Expand All @@ -2204,15 +2208,15 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
txq_maybe_wake(mp->txq + queue);
} else if (mp->work_rx & queue_mask) {
work_done += rxq_process(mp->rxq + queue, work_tbd);
} else if (mp->work_rx_refill & queue_mask) {
} else if (!mp->oom && (mp->work_rx_refill & queue_mask)) {
work_done += rxq_refill(mp->rxq + queue, work_tbd);
} else {
BUG();
}
}

if (work_done < budget) {
if (mp->work_rx_oom)
if (mp->oom)
mod_timer(&mp->rx_oom, jiffies + (HZ / 10));
napi_complete(napi);
wrlp(mp, INT_MASK, INT_TX_END | INT_RX | INT_EXT);
Expand Down Expand Up @@ -2372,7 +2376,7 @@ static int mv643xx_eth_open(struct net_device *dev)
rxq_refill(mp->rxq + i, INT_MAX);
}

if (mp->work_rx_oom) {
if (mp->oom) {
mp->rx_oom.expires = jiffies + (HZ / 10);
add_timer(&mp->rx_oom);
}
Expand Down

0 comments on commit 97add3a

Please sign in to comment.