Commit 13d3a888 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: ipt: use gnet_stats for action stats

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9304f65d
...@@ -218,9 +218,8 @@ tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ov ...@@ -218,9 +218,8 @@ tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ov
*/ */
p->tm.install = jiffies; p->tm.install = jiffies;
#ifdef CONFIG_NET_ESTIMATOR #ifdef CONFIG_NET_ESTIMATOR
if (est) { if (est)
qdisc_new_estimator(&p->stats, p->stats_lock, est); gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est);
}
#endif #endif
h = tcf_hash(p->index); h = tcf_hash(p->index);
write_lock_bh(&ipt_lock); write_lock_bh(&ipt_lock);
...@@ -258,8 +257,8 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a) ...@@ -258,8 +257,8 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a)
spin_lock(&p->lock); spin_lock(&p->lock);
p->tm.lastuse = jiffies; p->tm.lastuse = jiffies;
p->stats.bytes += skb->len; p->bstats.bytes += skb->len;
p->stats.packets++; p->bstats.packets++;
if (skb_cloned(skb) ) { if (skb_cloned(skb) ) {
if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
...@@ -278,7 +277,7 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a) ...@@ -278,7 +277,7 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a)
break; break;
case NF_DROP: case NF_DROP:
result = TC_ACT_SHOT; result = TC_ACT_SHOT;
p->stats.drops++; p->qstats.drops++;
break; break;
case IPT_CONTINUE: case IPT_CONTINUE:
result = TC_ACT_PIPE; result = TC_ACT_PIPE;
...@@ -346,17 +345,6 @@ tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) ...@@ -346,17 +345,6 @@ tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
return -1; return -1;
} }
int
tcf_ipt_stats(struct sk_buff *skb, struct tc_action *a)
{
struct tcf_ipt *p;
p = PRIV(a,ipt);
if (NULL != p)
return qdisc_copy_stats(skb, &p->stats, p->stats_lock);
return 1;
}
struct tc_action_ops act_ipt_ops = { struct tc_action_ops act_ipt_ops = {
.next = NULL, .next = NULL,
.kind = "ipt", .kind = "ipt",
...@@ -364,7 +352,6 @@ struct tc_action_ops act_ipt_ops = { ...@@ -364,7 +352,6 @@ struct tc_action_ops act_ipt_ops = {
.capab = TCA_CAP_NONE, .capab = TCA_CAP_NONE,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.act = tcf_ipt, .act = tcf_ipt,
.get_stats = tcf_ipt_stats,
.dump = tcf_ipt_dump, .dump = tcf_ipt_dump,
.cleanup = tcf_ipt_cleanup, .cleanup = tcf_ipt_cleanup,
.lookup = tcf_hash_search, .lookup = tcf_hash_search,
......
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