netdev
[Top] [All Lists]

Re: [PATCH] rtnetlink & address family problem

To: jamal <hadi@xxxxxxxxxx>
Subject: Re: [PATCH] rtnetlink & address family problem
From: Thomas Graf <tgraf@xxxxxxx>
Date: Tue, 7 Dec 2004 17:55:01 +0100
Cc: Michal Ludvig <mludvig@xxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, Stephen Hemminger <shemminger@xxxxxxxx>, netdev@xxxxxxxxxxx, Jan Kara <jack@xxxxxxx>
In-reply-to: <20041207141033.GD1371@xxxxxxxxxxxxxx>
References: <41B0A5B4.6060108@xxxxxxx> <20041206140214.GA749@xxxxxxxxxxxxxx> <1102386461.1093.26.camel@xxxxxxxxxxxxxxxx> <20041207124922.GA1371@xxxxxxxxxxxxxx> <1102424568.1089.120.camel@xxxxxxxxxxxxxxxx> <20041207131706.GB1371@xxxxxxxxxxxxxx> <1102425618.1089.133.camel@xxxxxxxxxxxxxxxx> <20041207141033.GD1371@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
* Thomas Graf <20041207141033.GD1371@xxxxxxxxxxxxxx> 2004-12-07 15:10
> * jamal <1102425618.1089.133.camel@xxxxxxxxxxxxxxxx> 2004-12-07 08:20
> > On Tue, 2004-12-07 at 08:17, Thomas Graf wrote:
> > 
> > > It's not really related to the gnet_stats code.  stats_lock isn't set
> > > in the action code when using an older iproute2. I haven't tested this
> > > case because it was marked as broken anyway. 
> > 
> > Can you ping my memory on this? Is this tc with initial support
> > for actions or something much older than that.
> 
> I'm not sure, I'm testing with a version having no action support at
> all. It should be fairly easy to find the bug once I have the time to
> really look into it. I'm still getting interrupted all the time at
> the moment.

One major problem is that the tc_dump_action path doesn't take
care of TCA_OLD_COMPAT resulting in calling tcf_action_copy_stats
for policers which is a bad thing since their a->priv is set to
tcf_police instead of the generic header and thus causes random
behaviour.

One solution would be to make tcf_police compatible to tca_gen.

Thoughts?


--- linux-2.6.10-rc2-bk13.orig/include/net/act_api.h    2004-11-30 
14:01:11.000000000 +0100
+++ linux-2.6.10-rc2-bk13/include/net/act_api.h 2004-12-07 17:49:50.000000000 
+0100
@@ -8,15 +8,42 @@
 #include <net/sch_generic.h>
 #include <net/pkt_sched.h>
 
+#ifdef CONFIG_NET_CLS_ACT
+
+#define ACT_P_CREATED 1
+#define ACT_P_DELETED 1
+#define tca_gen(name) \
+struct tcf_##name *next; \
+       u32 index; \
+       int refcnt; \
+       int bindcnt; \
+       u32 capab; \
+       int action; \
+       struct tcf_t tm; \
+       struct gnet_stats_basic bstats; \
+       struct gnet_stats_queue qstats; \
+       struct gnet_stats_rate_est rate_est; \
+       spinlock_t *stats_lock; \
+       spinlock_t lock
+
+#endif
+
 struct tcf_police
 {
+#ifdef CONFIG_NET_CLS_ACT
+       tca_gen(police);
+#else
        struct tcf_police *next;
        int             refcnt;
-#ifdef CONFIG_NET_CLS_ACT
-       int             bindcnt;
-#endif
        u32             index;
        int             action;
+       spinlock_t      lock;
+       struct gnet_stats_basic bstats;
+       struct gnet_stats_queue qstats;
+       struct gnet_stats_rate_est rate_est;
+       spinlock_t      *stats_lock;
+#endif
+
        int             result;
        u32             ewma_rate;
        u32             burst;
@@ -24,34 +51,12 @@
        u32             toks;
        u32             ptoks;
        psched_time_t   t_c;
-       spinlock_t      lock;
        struct qdisc_rate_table *R_tab;
        struct qdisc_rate_table *P_tab;
-
-       struct gnet_stats_basic bstats;
-       struct gnet_stats_queue qstats;
-       struct gnet_stats_rate_est rate_est;
-       spinlock_t      *stats_lock;
 };
 
 #ifdef CONFIG_NET_CLS_ACT
 
-#define ACT_P_CREATED 1
-#define ACT_P_DELETED 1
-#define tca_gen(name) \
-struct tcf_##name *next; \
-       u32 index; \
-       int refcnt; \
-       int bindcnt; \
-       u32 capab; \
-       int action; \
-       struct tcf_t tm; \
-       struct gnet_stats_basic bstats; \
-       struct gnet_stats_queue qstats; \
-       struct gnet_stats_rate_est rate_est; \
-       spinlock_t *stats_lock; \
-       spinlock_t lock
-
 struct tcf_act_hdr
 {
        tca_gen(act_hdr);

<Prev in Thread] Current Thread [Next in Thread>