Re: some tc commands fail on 2.6.29-rc6-git5, works on 2.6.28.7

Previous thread: [PATCH] [SK_BUFF]: '< 0' and '>= 0' test on unsigned by Roel Kluin on Sunday, March 1, 2009 - 3:00 pm. (2 messages)

Next thread: [PATCH]: ixgbe: Fix some compiler warnings. by David Miller on Sunday, March 1, 2009 - 9:33 pm. (2 messages)
From: Andrew Morton
Date: Sunday, March 1, 2009 - 5:57 pm

(cc netdev)


--

From: Jarek Poplawski
Date: Monday, March 2, 2009 - 11:44 am

Hi,

I've just repeated your commands (with eth0) on the current Linus' tree
and it works OK. Check your .config and &quot;modules_install&quot; again, and if
no result send gzipped .config and show &quot;lsmod&quot; and &quot;tc -V&quot; output after
these commands above.

Cheers,
Jarek P.
--

From: Joao Correia
Date: Tuesday, March 3, 2009 - 4:10 pm

Hello again

Sorry for taking so long, been busy with some unexpected work.

I have checked the .config and can not (to the extent of my not-guru
knowledge) find anything out of place. Excuse me if its obvious and it
didnt strike me yet.

The commands asked plus some others i remembered give the output at the bottom.
Where can i send the gzipped .config? Not the list, I imagine?

I have confirmed again that the exact same commands (as on the
original message), work flawlessly on 2.6.28.7 without a hitch, and,
AFAIK, work as intended. I have also tried the latest 2.6.29-rc6-git7
and it still fails like on git6.

It happens even with other NIC's (both a D-Link gigabit and an onboard
Atheros A1L gigabit (output of lspci -vv at the end of this message).

Thank you very much for your time,
Joao Correia


Output of the commands:
(big wall of text coming your way, beware)

[root@duron ~]# lsmod
Module                  Size  Used by
act_police              5028  0
sch_ingress             2236  2
cls_fw                  4636  1
cls_u32                 7196  6
sch_sfq                 5884  3
sch_cbq                16764  1
xt_ipp2p                8220  1
xt_MARK                 2012  1
xt_CONNMARK             2780  2
xt_dscp                 2268  3
xt_CLASSIFY             1468  7
ipt_MASQUERADE          2652  1
xt_connlimit            3876  6
xt_mac                  1500  18
xt_mark                 1628  18
xt_comment              1436  40
xt_time                 2652  42
xt_DELUDE               2524  1
xt_TARPIT               2876  2
xt_CHAOS                3412  1
compat_xtables          3196  3 xt_DELUDE,xt_TARPIT,xt_CHAOS
xt_limit                2016  5
iptable_raw             1980  0
iptable_mangle          2556  1
iptable_nat             4988  1
nf_nat                 16400  2 ipt_MASQUERADE,iptable_nat
ipt_ULOG                6948  3
autofs4                24448  2
it87                   20012  0
hwmon_vid               2940  1 it87
ipv6                  ...
From: Jarek Poplawski
Date: Tuesday, March 3, 2009 - 5:06 pm

...

Joao, you don't need to be sorry at all - on the contrary I'm
extremely sorry! I was so focused on the kernel version but ignored
updating iproute, and it looks like this matters here.

So you're right. Alas I'll not be able to look at it until &quot;tomorrow&quot;
in the evening.

Thanks for the report,
Jarek P.
--

From: John Dykstra
Date: Tuesday, March 3, 2009 - 7:50 pm

I have also reproduced this on Linus' latest 2.6.29-rc6 tree, using tc
version iproute2-ss071016 and a kernel config with all traffic control
features enabled.

The error reported by tc comes from the kernel-level check added by:

	commit c1b56878fb68e9c14070939ea4537ad4db79ffae
	Author: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
	Date:   Tue Nov 25 21:14:06 2008 -0800

    	tc: policing requires a rate estimator

    Found that while trying average rate policing, it was possible to
    request average rate policing without a rate estimator. This results
    in no policing which is harmless but incorrect.

    Since policing could be setup in two steps, need to check
    in the kernel.

    Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

I got the same error when using the tc version iproute2-ss090115 built
this evening from the public git repository.

  -- John

--

From: Joao Correia
Date: Wednesday, March 4, 2009 - 7:09 am

Hello

Just to confirm that i also have all traffic control/shaping (QoS,
connection limits, scheduling, etc) enabled on the config i use.

Its not just the specific version of tc i posted, i tried one from
last year (october, but i didnt note the exact build) with the same
result.

Cheers,
Joao Correia
Centro de Informatica
Universidade da Beira Interior
Portugal

--

From: Denys Fedoryschenko
Date: Wednesday, March 4, 2009 - 10:59 am

Maybe good idea to use strace? (i dont know which flags useful, but usually i 
use &quot;-s 65536&quot;)
Just maybe it will give a bit more ideas what is happening.
But sure netdev developers can tell, if it is useful or not.



--

From: Jarek Poplawski
Date: Wednesday, March 4, 2009 - 4:34 pm

Very nice diagnose, thanks!
Jarek P.

PS: after upgrading iproute I couldn't reproduce this seemingly OK
test with older versions anymore...

-------------------&gt;
pkt_sched: act_police: Fix a rate estimator test.

A commit c1b56878fb68e9c14070939ea4537ad4db79ffae &quot;tc: policing requires
a rate estimator&quot; introduced a test which invalidates previously working
configs, based on examples from iproute2: doc/actions/actions-general.
This is too rigorous: a rate estimator is needed only when police's
&quot;avrate&quot; option is used.

Reported-by: Joao Correia &lt;joaomiguelcorreia@gmail.com&gt;
Diagnosed-by: John Dykstra &lt;john.dykstra1@gmail.com&gt;
Signed-off-by: Jarek Poplawski &lt;jarkao2@gmail.com&gt;
---

 net/sched/act_police.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 5c72a11..f8f047b 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -183,13 +183,6 @@ override:
 		if (R_tab == NULL)
 			goto failure;
 
-		if (!est &amp;&amp; (ret == ACT_P_CREATED ||
-			     !gen_estimator_active(&amp;police-&gt;tcf_bstats,
-						   &amp;police-&gt;tcf_rate_est))) {
-			err = -EINVAL;
-			goto failure;
-		}
-
 		if (parm-&gt;peakrate.rate) {
 			P_tab = qdisc_get_rtab(&amp;parm-&gt;peakrate,
 					       tb[TCA_POLICE_PEAKRATE]);
@@ -205,6 +198,12 @@ override:
 					    &amp;police-&gt;tcf_lock, est);
 		if (err)
 			goto failure_unlock;
+	} else if (tb[TCA_POLICE_AVRATE] &amp;&amp;
+		   (ret == ACT_P_CREATED ||
+		    !gen_estimator_active(&amp;police-&gt;tcf_bstats,
+					  &amp;police-&gt;tcf_rate_est))) {
+		err = -EINVAL;
+		goto failure_unlock;
 	}
 
 	/* No failure allowed after this point */
--

From: Joao Correia
Date: Wednesday, March 4, 2009 - 5:32 pm

Hello

Confirmed working now on latest 2.6.29-rc6 git.

Thank you very much all for the prompt answer and solution, really impressive.

Back to work on the ultimate custom firewall *evil laugh*.

Cheers,
Joao Correia
Centro de Informatica
Universidade da Beira Interior
Portugal

--

From: David Miller
Date: Wednesday, March 4, 2009 - 6:38 pm

From: Joao Correia &lt;joaomiguelcorreia@gmail.com&gt;

Applied, thanks everyone.
--

Previous thread: [PATCH] [SK_BUFF]: '< 0' and '>= 0' test on unsigned by Roel Kluin on Sunday, March 1, 2009 - 3:00 pm. (2 messages)

Next thread: [PATCH]: ixgbe: Fix some compiler warnings. by David Miller on Sunday, March 1, 2009 - 9:33 pm. (2 messages)