diff options
author | Andreas Eversberg <andreas@eversberg.eu> | 2008-08-06 13:13:07 -0400 |
---|---|---|
committer | Karsten Keil <kkeil@suse.de> | 2009-01-09 16:44:23 -0500 |
commit | 11618496d03d9e1ad70ac68afbfa7df9b5fc19d1 (patch) | |
tree | f52f3a4e49c53a87803c803413310c4710859d05 /drivers/isdn/mISDN | |
parent | 190f71d9d8516fea4db01ba86ddfad5738a92703 (diff) |
mISDN: Fix queue limit counting problem
If received frames are not handled in time, purge them.
Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r-- | drivers/isdn/mISDN/hwchannel.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/isdn/mISDN/hwchannel.c b/drivers/isdn/mISDN/hwchannel.c index 2596fba4e614..535ceacc05b9 100644 --- a/drivers/isdn/mISDN/hwchannel.c +++ b/drivers/isdn/mISDN/hwchannel.c | |||
@@ -50,9 +50,6 @@ bchannel_bh(struct work_struct *ws) | |||
50 | 50 | ||
51 | if (test_and_clear_bit(FLG_RECVQUEUE, &bch->Flags)) { | 51 | if (test_and_clear_bit(FLG_RECVQUEUE, &bch->Flags)) { |
52 | while ((skb = skb_dequeue(&bch->rqueue))) { | 52 | while ((skb = skb_dequeue(&bch->rqueue))) { |
53 | if (bch->rcount >= 64) | ||
54 | printk(KERN_WARNING "B-channel %p receive " | ||
55 | "queue if full, but empties...\n", bch); | ||
56 | bch->rcount--; | 53 | bch->rcount--; |
57 | if (likely(bch->ch.peer)) { | 54 | if (likely(bch->ch.peer)) { |
58 | err = bch->ch.recv(bch->ch.peer, skb); | 55 | err = bch->ch.recv(bch->ch.peer, skb); |
@@ -177,8 +174,10 @@ recv_Bchannel(struct bchannel *bch) | |||
177 | hh->prim = PH_DATA_IND; | 174 | hh->prim = PH_DATA_IND; |
178 | hh->id = MISDN_ID_ANY; | 175 | hh->id = MISDN_ID_ANY; |
179 | if (bch->rcount >= 64) { | 176 | if (bch->rcount >= 64) { |
180 | dev_kfree_skb(bch->rx_skb); | 177 | printk(KERN_WARNING "B-channel %p receive queue overflow, " |
181 | bch->rx_skb = NULL; | 178 | "fushing!\n", bch); |
179 | skb_queue_purge(&bch->rqueue); | ||
180 | bch->rcount = 0; | ||
182 | return; | 181 | return; |
183 | } | 182 | } |
184 | bch->rcount++; | 183 | bch->rcount++; |
@@ -200,8 +199,10 @@ void | |||
200 | recv_Bchannel_skb(struct bchannel *bch, struct sk_buff *skb) | 199 | recv_Bchannel_skb(struct bchannel *bch, struct sk_buff *skb) |
201 | { | 200 | { |
202 | if (bch->rcount >= 64) { | 201 | if (bch->rcount >= 64) { |
203 | dev_kfree_skb(skb); | 202 | printk(KERN_WARNING "B-channel %p receive queue overflow, " |
204 | return; | 203 | "fushing!\n", bch); |
204 | skb_queue_purge(&bch->rqueue); | ||
205 | bch->rcount = 0; | ||
205 | } | 206 | } |
206 | bch->rcount++; | 207 | bch->rcount++; |
207 | skb_queue_tail(&bch->rqueue, skb); | 208 | skb_queue_tail(&bch->rqueue, skb); |
@@ -245,8 +246,12 @@ confirm_Bsend(struct bchannel *bch) | |||
245 | { | 246 | { |
246 | struct sk_buff *skb; | 247 | struct sk_buff *skb; |
247 | 248 | ||
248 | if (bch->rcount >= 64) | 249 | if (bch->rcount >= 64) { |
249 | return; | 250 | printk(KERN_WARNING "B-channel %p receive queue overflow, " |
251 | "fushing!\n", bch); | ||
252 | skb_queue_purge(&bch->rqueue); | ||
253 | bch->rcount = 0; | ||
254 | } | ||
250 | skb = _alloc_mISDN_skb(PH_DATA_CNF, mISDN_HEAD_ID(bch->tx_skb), | 255 | skb = _alloc_mISDN_skb(PH_DATA_CNF, mISDN_HEAD_ID(bch->tx_skb), |
251 | 0, NULL, GFP_ATOMIC); | 256 | 0, NULL, GFP_ATOMIC); |
252 | if (!skb) { | 257 | if (!skb) { |