From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Vitaly E. Lavrov" <lve@guap.ru>, netdev@vger.kernel.org
Cc: jhs@mojatatu.com
Subject: Re: [RFC PATCH] tc filter not show last u32 filter
Date: Tue, 21 Apr 2015 21:17:42 +0300 [thread overview]
Message-ID: <55369446.10806@cogentembedded.com> (raw)
In-Reply-To: <55368E7F.4030005@guap.ru>
Hello.
On 04/21/2015 08:53 PM, Vitaly E. Lavrov wrote:
> "tc filter show" does not show last U32 filter on 32-bit systems (tested on x86).
> Additional condition: filter does not have action and CONFIG_NET_CLS_ACT=y
> Example: tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip
> dst 10.200.2.2 flowid 1:20
> Function tcf_action_copy_stats() returns an error because the (struct
> tc_action *)a->priv is NULL (for 32bit systems).
> The sequence of calls:
> u32_dump()
> cls_u32.c:1009 if (tcf_exts_dump_stats(skb, &n->exts) < 0) goto
> nla_put_failure;
> tcf_exts_dump_stats()
> cls_api.c:606 if (tcf_action_copy_stats(skb, a, 1) < 0) return -1;
>
> tcf_action_copy_stats()
> act_api.c:604 struct tcf_common *p = a->priv;
> act_api.c:606 if (p == NULL) goto errout; // return -1;
> One of variants correcting this error is a verify the existence of action
> before calling tcf_action_copy_stats().
> Patch for kernel 3.18.10
You need to send patches against the latest kernel. Look for DaveM's
'net.git' repo on git.kernel.org.
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index aad6a67..8e7ad61 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -602,9 +602,11 @@ EXPORT_SYMBOL(tcf_exts_dump);
> int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
> {
> #ifdef CONFIG_NET_CLS_ACT
> - struct tc_action *a = tcf_exts_first_act(exts);
> - if (tcf_action_copy_stats(skb, a, 1) < 0)
> - return -1;
> + if(tcf_exts_is_available(exts)) {
Please run your patches thru scripts/chackpatch.pl; space is needed after
*if*.
> + struct tc_action *a = tcf_exts_first_act(exts);
Empty line needed here.
WBR, Sergei
next prev parent reply other threads:[~2015-04-21 18:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 17:53 [RFC PATCH] tc filter not show last u32 filter Vitaly E. Lavrov
2015-04-21 18:17 ` Sergei Shtylyov [this message]
2015-04-21 20:07 ` Vitaly E. Lavrov
2015-04-21 20:25 ` Cong Wang
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=55369446.10806@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=jhs@mojatatu.com \
--cc=lve@guap.ru \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.