From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Cong Wang <cwang@twopensource.com>
Subject: Re: [Patch net] sched, cls: check if we could overwrite actions when changing a filter
Date: Thu, 17 Apr 2014 07:50:08 -0400 [thread overview]
Message-ID: <534FBFF0.3020606@mojatatu.com> (raw)
In-Reply-To: <CAM_iQpXRVZ8_keaL-8OkmRVguA29bnTPS2ZHZ0j2SSeB6A=1jQ@mail.gmail.com>
On 04/16/14 17:10, Cong Wang wrote:
> On Wed, Apr 16, 2014 at 5:30 AM, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>
> I thought it's clear: I have a filter F1 contains an action A1,
> they are already in kernel (therefore I can read them from libnl cache),
> then I want to append A2 to F1 so that F1 would have two actions
> A1 and A2.
>
> In short: change from F1 -> A1 to F1 -> A1 -> A2 atomically.
>
Ok, got it.
>> In that case, you would specify the an existing filter rule but
>> in order to resolve ambiguity tc classifiers provide priorities
>> (i.e just specify a different priority) and the rule will be added
>> before or after the conflicting rule.
>> If you dont do that then you will get back EEXIST to tell you
>> there is a conflict.
>
> But I already told kernel I am changing a filter, so why it
> complains? I should change an existing one, shouldn't I?
>
[..]
> Why? Since actions are inside it, I should be able to change any
> part of it, right?
>
The challenge is in the semantics. You are making change to the
graph _not_ to the filter. There are dependencies in a graph. IOW,
I doubt what you are doing could be made generic and safe without
it being a two step operation since we have multiple tables to deal
with.
Example - what would you do if you wanted to change the graph
so that you add something in the middle or remove something at
the end?
>> If otoh you wanted to replace the filter + action graph with a backup
>> rule, then just add it lower in the priority list and delete the
>> existing one etc.
>>
>
> This is not atomic, is it?
>
It avoids the need for atomicity. Backup rule will never be used
as long as the active is still in use.
If you can do the two steps in the kernel as i described, then
you can achieve your purpose but i worry it will complicate code
for a corner use case (which has a work around already).
cheers,
jamal
next prev parent reply other threads:[~2014-04-17 11:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 23:46 [Patch net] sched, cls: check if we could overwrite actions when changing a filter Cong Wang
2014-04-16 12:30 ` Jamal Hadi Salim
2014-04-16 21:10 ` Cong Wang
2014-04-17 11:50 ` Jamal Hadi Salim [this message]
2014-04-17 20:48 ` Cong Wang
2014-04-18 14:26 ` Jamal Hadi Salim
2014-04-18 17:18 ` Cong Wang
2014-04-19 11:10 ` Jamal Hadi Salim
2014-04-21 23:28 ` Cong Wang
2014-04-23 11:30 ` Jamal Hadi Salim
2014-04-24 21:12 ` Cong Wang
2014-04-25 15:48 ` Jamal Hadi Salim
2014-04-25 20:41 ` 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=534FBFF0.3020606@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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.