From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>,
David Miller <davem@davemloft.net>,
socketcan@hartkopp.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] pkt_sched: namespace aware ifb
Date: Sun, 13 Jan 2013 09:44:48 -0500 [thread overview]
Message-ID: <50F2C860.1060602@mojatatu.com> (raw)
In-Reply-To: <1358056199.20249.2121.camel@edumazet-glaptop>
On 13-01-13 12:49 AM, Eric Dumazet wrote:
> Could you elaborate on what could be the problem ?
>
> We hold the RTNL, so I dont think another process could possibly call
> tcf_mirred_init()
>
Eric, the point probably Ben was trying to make is not about
synchronizing rather about which namespace has the right to that action
config. Your change is correct for the common use of actions
but does not fix the larger picture.
At the moment a dev is owned by a specific namespace; that owns a tc
filter that in turn owns an action. So no problem with the change you
make if all configuration follows those rules i.e something along the
lines of:
===
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
match ip dst 10.0.0.229/32 flowid 1:10 \
action mirred egress redirect dev ifb0
=====
I would say most people use the above syntax.
However, there is another way to configure actions so they can be
shared[1], example control syntax:
----
tc actions add \
action police rate 1kbit burst 90k drop index 3 \
action mirred egress mirror dev eth0 index 5
----
In such a case, the "tc actions" netlink path may be
entered from a different namespace than the one that is
using it. Then current->nsproxy->net_ns is no longer correct.
To correct this, i think what Ben points out in passing the
init() the correct namespace seem like the way to go. Feel free
to make that change - otherwise i will get to it and fix it.
cheers,
jamal
[1]
You can then have multiple filters use this action like so:
===
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
match ip dst 10.0.0.229/32 flowid 1:10 \
action police index 3
#
tc filter add dev eth0 parent ffff: protocol ip prio 6 u32 \
match ip src 10.0.0.21/32 flowid 1:16 \
action police index 3 action mirred egress mirror dev eth0
=====
next prev parent reply other threads:[~2013-01-13 14:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 13:48 [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-12 18:13 ` Jiri Pirko
2013-01-12 18:40 ` Oliver Hartkopp
2013-01-12 19:37 ` Jiri Pirko
2013-01-12 20:14 ` Oliver Hartkopp
2013-01-12 21:23 ` David Miller
2013-01-12 21:36 ` David Miller
2013-01-13 3:06 ` [PATCH net-next] pkt_sched: namespace aware ifb Eric Dumazet
2013-01-13 3:50 ` Benjamin LaHaise
2013-01-13 5:49 ` Eric Dumazet
2013-01-13 14:44 ` Jamal Hadi Salim [this message]
2013-01-13 16:41 ` Benjamin LaHaise
2013-01-13 16:57 ` Eric Dumazet
2013-01-13 17:25 ` Jamal Hadi Salim
2013-01-14 5:40 ` Eric Dumazet
2013-01-13 17:46 ` [PATCH net-next] ifb: dont hard code inet_net use Eric Dumazet
2013-01-14 13:13 ` Jamal Hadi Salim
2013-01-14 15:15 ` [PATCH net-next] pkt_sched: namespace aware act_mirred Benjamin LaHaise
2013-01-14 20:10 ` David Miller
2013-01-14 20:13 ` [PATCH net-next] ifb: dont hard code inet_net use David Miller
2013-01-13 14:59 ` [PATCH net-next] pkt_sched: namespace aware ifb Benjamin LaHaise
2013-01-13 16:35 ` Eric Dumazet
2013-01-13 11:01 ` [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-13 13:20 ` David Miller
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=50F2C860.1060602@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=bcrl@kvack.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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.