Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111751
b: refs/heads/master
c: ceade96
h: refs/heads/master
i:
  111749: 751c73e
  111747: 5429041
  111743: 3a40b7e
v: v3
  • Loading branch information
David S. Miller committed Sep 22, 2008
1 parent 06e2493 commit b0766b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 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: 43f59c89399fd76883a06c551f24794e98409432
refs/heads/master: ceade961c4c8d8bc033dc7907047818c9525c326
32 changes: 9 additions & 23 deletions trunk/drivers/atm/idt77252.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)

rpp = &vc->rcv.rx_pool;

__skb_queue_tail(&rpp->queue, skb);
rpp->len += skb->len;
if (!rpp->count++)
rpp->first = skb;
*rpp->last = skb;
rpp->last = &skb->next;

if (stat & SAR_RSQE_EPDU) {
unsigned char *l1l2;
Expand All @@ -1145,7 +1142,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
atomic_inc(&vcc->stats->rx_err);
return;
}
if (rpp->count > 1) {
if (skb_queue_len(&rpp->queue) > 1) {
struct sk_buff *sb;

skb = dev_alloc_skb(rpp->len);
Expand All @@ -1161,12 +1158,9 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
dev_kfree_skb(skb);
return;
}
sb = rpp->first;
for (i = 0; i < rpp->count; i++) {
skb_queue_walk(&rpp->queue, sb)
memcpy(skb_put(skb, sb->len),
sb->data, sb->len);
sb = sb->next;
}

recycle_rx_pool_skb(card, rpp);

Expand All @@ -1180,7 +1174,6 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
return;
}

skb->next = NULL;
flush_rx_pool(card, rpp);

if (!atm_charge(vcc, skb->truesize)) {
Expand Down Expand Up @@ -1918,25 +1911,18 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb)
static void
flush_rx_pool(struct idt77252_dev *card, struct rx_pool *rpp)
{
skb_queue_head_init(&rpp->queue);
rpp->len = 0;
rpp->count = 0;
rpp->first = NULL;
rpp->last = &rpp->first;
}

static void
recycle_rx_pool_skb(struct idt77252_dev *card, struct rx_pool *rpp)
{
struct sk_buff *skb, *next;
int i;
struct sk_buff *skb, *tmp;

skb = rpp->first;
for (i = 0; i < rpp->count; i++) {
next = skb->next;
skb->next = NULL;
skb_queue_walk_safe(&rpp->queue, skb, tmp)
recycle_rx_skb(card, skb);
skb = next;
}

flush_rx_pool(card, rpp);
}

Expand Down Expand Up @@ -2537,7 +2523,7 @@ idt77252_close(struct atm_vcc *vcc)
waitfor_idle(card);
spin_unlock_irqrestore(&card->cmd_lock, flags);

if (vc->rcv.rx_pool.count) {
if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) {
DPRINTK("%s: closing a VC with pending rx buffers.\n",
card->name);

Expand Down Expand Up @@ -2970,7 +2956,7 @@ close_card_oam(struct idt77252_dev *card)
waitfor_idle(card);
spin_unlock_irqrestore(&card->cmd_lock, flags);

if (vc->rcv.rx_pool.count) {
if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) {
DPRINTK("%s: closing a VC "
"with pending rx buffers.\n",
card->name);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/atm/idt77252.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ struct scq_info
};

struct rx_pool {
struct sk_buff *first;
struct sk_buff **last;
struct sk_buff_head queue;
unsigned int len;
unsigned int count;
};

struct aal1 {
Expand Down

0 comments on commit b0766b3

Please sign in to comment.