Commit 81563af3 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Fix hard freeze with QoS in 2.6.10-rc3

The problem is in tcf_action_copy_stats, it assumes a->priv has
the same layout as struct tcf_act_hdr, which is not true for
struct tcf_police. This patch rearranges struct tcf_police to
match tcf_act_hdr.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7149bf75
...@@ -8,15 +8,23 @@ ...@@ -8,15 +8,23 @@
#include <net/sch_generic.h> #include <net/sch_generic.h>
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
#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_police struct tcf_police
{ {
struct tcf_police *next; tca_gen(police);
int refcnt;
#ifdef CONFIG_NET_CLS_ACT
int bindcnt;
#endif
u32 index;
int action;
int result; int result;
u32 ewma_rate; u32 ewma_rate;
u32 burst; u32 burst;
...@@ -24,33 +32,14 @@ struct tcf_police ...@@ -24,33 +32,14 @@ struct tcf_police
u32 toks; u32 toks;
u32 ptoks; u32 ptoks;
psched_time_t t_c; psched_time_t t_c;
spinlock_t lock;
struct qdisc_rate_table *R_tab; struct qdisc_rate_table *R_tab;
struct qdisc_rate_table *P_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 #ifdef CONFIG_NET_CLS_ACT
#define ACT_P_CREATED 1 #define ACT_P_CREATED 1
#define ACT_P_DELETED 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 struct tcf_act_hdr
{ {
......
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