Commit 11618496 authored by Andreas Eversberg's avatar Andreas Eversberg Committed by Karsten Keil

mISDN: Fix queue limit counting problem

If received frames are not handled in time, purge them.
Signed-off-by: default avatarAndreas Eversberg <andreas@eversberg.eu>
Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
parent 190f71d9
...@@ -50,9 +50,6 @@ bchannel_bh(struct work_struct *ws) ...@@ -50,9 +50,6 @@ bchannel_bh(struct work_struct *ws)
if (test_and_clear_bit(FLG_RECVQUEUE, &bch->Flags)) { if (test_and_clear_bit(FLG_RECVQUEUE, &bch->Flags)) {
while ((skb = skb_dequeue(&bch->rqueue))) { while ((skb = skb_dequeue(&bch->rqueue))) {
if (bch->rcount >= 64)
printk(KERN_WARNING "B-channel %p receive "
"queue if full, but empties...\n", bch);
bch->rcount--; bch->rcount--;
if (likely(bch->ch.peer)) { if (likely(bch->ch.peer)) {
err = bch->ch.recv(bch->ch.peer, skb); err = bch->ch.recv(bch->ch.peer, skb);
...@@ -177,8 +174,10 @@ recv_Bchannel(struct bchannel *bch) ...@@ -177,8 +174,10 @@ recv_Bchannel(struct bchannel *bch)
hh->prim = PH_DATA_IND; hh->prim = PH_DATA_IND;
hh->id = MISDN_ID_ANY; hh->id = MISDN_ID_ANY;
if (bch->rcount >= 64) { if (bch->rcount >= 64) {
dev_kfree_skb(bch->rx_skb); printk(KERN_WARNING "B-channel %p receive queue overflow, "
bch->rx_skb = NULL; "fushing!\n", bch);
skb_queue_purge(&bch->rqueue);
bch->rcount = 0;
return; return;
} }
bch->rcount++; bch->rcount++;
...@@ -200,8 +199,10 @@ void ...@@ -200,8 +199,10 @@ void
recv_Bchannel_skb(struct bchannel *bch, struct sk_buff *skb) recv_Bchannel_skb(struct bchannel *bch, struct sk_buff *skb)
{ {
if (bch->rcount >= 64) { if (bch->rcount >= 64) {
dev_kfree_skb(skb); printk(KERN_WARNING "B-channel %p receive queue overflow, "
return; "fushing!\n", bch);
skb_queue_purge(&bch->rqueue);
bch->rcount = 0;
} }
bch->rcount++; bch->rcount++;
skb_queue_tail(&bch->rqueue, skb); skb_queue_tail(&bch->rqueue, skb);
...@@ -245,8 +246,12 @@ confirm_Bsend(struct bchannel *bch) ...@@ -245,8 +246,12 @@ confirm_Bsend(struct bchannel *bch)
{ {
struct sk_buff *skb; struct sk_buff *skb;
if (bch->rcount >= 64) if (bch->rcount >= 64) {
return; printk(KERN_WARNING "B-channel %p receive queue overflow, "
"fushing!\n", bch);
skb_queue_purge(&bch->rqueue);
bch->rcount = 0;
}
skb = _alloc_mISDN_skb(PH_DATA_CNF, mISDN_HEAD_ID(bch->tx_skb), skb = _alloc_mISDN_skb(PH_DATA_CNF, mISDN_HEAD_ID(bch->tx_skb),
0, NULL, GFP_ATOMIC); 0, NULL, GFP_ATOMIC);
if (!skb) { if (!skb) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment