netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Josip Rodin <joy@entuzijast.net>
Cc: Patrick McHardy <kaber@trash.net>,
	David Miller <davem@davemloft.net>,
	mchan@broadcom.com, billfink@mindspring.com,
	bhutchings@solarflare.com, netdev@vger.kernel.org,
	mirrors@debian.org, devik@cdi.cz
Subject: Re: bnx2_poll panicking kernel
Date: Mon, 14 Jul 2008 23:22:23 +0200	[thread overview]
Message-ID: <20080714212223.GA4849@ami.dom.local> (raw)
In-Reply-To: <20080714202151.GA28622@orion.carnet.hr>

On Mon, Jul 14, 2008 at 10:21:51PM +0200, Josip Rodin wrote:
> On Mon, Jul 14, 2008 at 07:20:55PM +0200, Jarek Poplawski wrote:
...
> > BTW, I wonder how Josip's testing?
> 
> Do you want me to try out David's patch? I was hoping to get a definite okay
> from someone before applying it, given that this is a production machine
> for us and we do need it in *some* kind of an operational state.

Hmm... if you trust me more than David?! As a matter of fact, I thought
it's under testing already, but since I've some doubts, I attach below
my version of David's patch. IMHO, it looks safe, but never knows...

> I've got many more tens of kilobytes of logs from the previous debugging
> patches, if you want I can send them over.

This debugging, I guess, shows corrupted data, but the reason is hard
to find. David found one of possible reasons and it needs checking. I
don't think this patch in any version can do more damage than doing
nothing - unless you prefer to use Michael's patch to next kernels
(BTW, don't remove this patch yet).

Thanks,
Jarek P.

---

diff -Nurp 2.6.25.4-/net/sched/sch_htb.c 2.6.25.4+/net/sched/sch_htb.c
--- 2.6.25.4-/net/sched/sch_htb.c	2008-05-17 19:23:44.000000000 +0200
+++ 2.6.25.4+/net/sched/sch_htb.c	2008-07-14 22:39:28.000000000 +0200
@@ -576,6 +576,7 @@ static int htb_enqueue(struct sk_buff *s
 		if (q->direct_queue.qlen < q->direct_qlen) {
 			__skb_queue_tail(&q->direct_queue, skb);
 			q->direct_pkts++;
+			ret = NET_XMIT_SUCCESS;
 		} else {
 			kfree_skb(skb);
 			sch->qstats.drops++;
@@ -588,22 +589,27 @@ static int htb_enqueue(struct sk_buff *s
 		kfree_skb(skb);
 		return ret;
 #endif
-	} else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) !=
-		   NET_XMIT_SUCCESS) {
-		sch->qstats.drops++;
-		cl->qstats.drops++;
-		return NET_XMIT_DROP;
 	} else {
-		cl->bstats.packets +=
-			skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
-		cl->bstats.bytes += skb->len;
-		htb_activate(q, cl);
+		ret = cl->un.leaf.q->enqueue(skb, cl->un.leaf.q);
+		if (ret == NET_XMIT_DROP) {
+			sch->qstats.drops++;
+			cl->qstats.drops++;
+		} else {
+			cl->bstats.packets +=
+				skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
+			cl->bstats.bytes += skb->len;
+			if (ret == NET_XMIT_SUCCESS)
+				htb_activate(q, cl);
+		}
 	}
 
-	sch->q.qlen++;
-	sch->bstats.packets += skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
-	sch->bstats.bytes += skb->len;
-	return NET_XMIT_SUCCESS;
+	if (ret == NET_XMIT_SUCCESS) {
+		sch->q.qlen++;
+		sch->bstats.packets +=
+			skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
+		sch->bstats.bytes += skb->len;
+	}
+	return ret;
 }
 
 /* TODO: requeuing packet charges it to policers again !! */
@@ -618,6 +624,7 @@ static int htb_requeue(struct sk_buff *s
 		/* enqueue to helper queue */
 		if (q->direct_queue.qlen < q->direct_qlen) {
 			__skb_queue_head(&q->direct_queue, skb);
+			ret = NET_XMIT_SUCCESS;
 		} else {
 			__skb_queue_head(&q->direct_queue, skb);
 			tskb = __skb_dequeue_tail(&q->direct_queue);
@@ -632,17 +639,21 @@ static int htb_requeue(struct sk_buff *s
 		kfree_skb(skb);
 		return ret;
 #endif
-	} else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) !=
-		   NET_XMIT_SUCCESS) {
-		sch->qstats.drops++;
-		cl->qstats.drops++;
-		return NET_XMIT_DROP;
-	} else
-		htb_activate(q, cl);
-
-	sch->q.qlen++;
-	sch->qstats.requeues++;
-	return NET_XMIT_SUCCESS;
+	} else {
+		ret = cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q);
+		if (ret == NET_XMIT_DROP) {
+			sch->qstats.drops++;
+			cl->qstats.drops++;
+		} else if (ret == NET_XMIT_SUCCESS) {
+			htb_activate(q, cl);
+		}
+	}
+
+	if (ret == NET_XMIT_SUCCESS) {
+		sch->q.qlen++;
+		sch->qstats.requeues++;
+	}
+	return ret;
 }
 
 /**

  reply	other threads:[~2008-07-14 21:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16 12:57 bnx2_poll panicking kernel Josip Rodin
2008-06-16 14:04 ` Ben Hutchings
2008-06-16 15:52   ` Michael Chan
2008-06-16 19:13     ` Josip Rodin
2008-06-16 21:38       ` Josip Rodin
2008-06-16 21:48         ` Josip Rodin
2008-06-16 23:45           ` Michael Chan
2008-06-17 22:37             ` Josip Rodin
2008-06-17 22:47               ` Michael Chan
2008-06-21 11:18                 ` Josip Rodin
2008-06-21 15:34                   ` Bill Fink
2008-06-21 16:11                     ` Michael Chan
2008-06-23 18:04                       ` Josip Rodin
2008-06-23 21:36                         ` Josip Rodin
2008-06-23 22:48                           ` Michael Chan
2008-06-24 22:58                             ` Michael Chan
2008-06-25  0:04                               ` David Miller
2008-06-26 11:01                               ` Josip Rodin
2008-06-26 18:04                                 ` Michael Chan
2008-07-09 16:46                                   ` Josip Rodin
2008-07-09 16:57                                     ` Michael Chan
2008-07-09 23:46                                       ` David Miller
2008-07-10  9:45                                         ` Aviv Greenberg
2008-07-10 10:09                                           ` David Miller
2008-07-10 21:00                                         ` Michael Chan
2008-07-10 21:00                                           ` David Miller
2008-07-10 21:23                                           ` Josip Rodin
2008-07-10 21:38                                             ` Michael Chan
2008-07-10 22:00                                               ` Josip Rodin
2008-07-10 22:26                                                 ` Michael Chan
2008-07-10 22:31                                                   ` Josip Rodin
2008-07-10 23:20                                                     ` David Miller
2008-07-11  9:24                                                       ` Josip Rodin
2008-07-11  9:56                                                         ` David Miller
2008-07-11 12:19                                                           ` Patrick McHardy
2008-07-12  9:49                                                           ` Jarek Poplawski
2008-07-12 13:21                                                             ` Jarek Poplawski
2008-07-14 15:27                                                               ` Patrick McHardy
2008-07-14 17:20                                                                 ` Jarek Poplawski
2008-07-14 17:25                                                                   ` Jarek Poplawski
2008-07-14 20:21                                                                   ` Josip Rodin
2008-07-14 21:22                                                                     ` Jarek Poplawski [this message]
2008-07-14 21:26                                                                       ` Josip Rodin
2008-07-14 21:48                                                                         ` Jarek Poplawski
2008-07-17 21:30                                                                           ` Josip Rodin
2008-07-17 21:44                                                                             ` David Miller
2008-07-18  5:12                                                                               ` Jarek Poplawski
2008-08-02 12:28                                                                               ` bad htb_{en,re}queue return codes causing corrupt data in drivers [was Re: bnx2_poll panicking kernel] Josip Rodin
2008-08-03  7:06                                                                                 ` bad htb_{en,re}queue return codes causing corrupt data in drivers David Miller
2008-07-14 22:05                                                                         ` bnx2_poll panicking kernel Jarek Poplawski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080714212223.GA4849@ami.dom.local \
    --to=jarkao2@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=billfink@mindspring.com \
    --cc=davem@davemloft.net \
    --cc=devik@cdi.cz \
    --cc=joy@entuzijast.net \
    --cc=kaber@trash.net \
    --cc=mchan@broadcom.com \
    --cc=mirrors@debian.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).