All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 23 Apr 2014 07:30:27 -0400	[thread overview]
Message-ID: <5357A453.6030901@mojatatu.com> (raw)
In-Reply-To: <CAM_iQpVM-djLiz9Z9Bhz9zac88m8b6t1S-SRUkRxYhOaW_xJvQ@mail.gmail.com>


On 04/21/14 19:28, Cong Wang wrote:
> On Sat, Apr 19, 2014 at 4:10 AM, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>> On 04/18/14 13:18, Cong Wang wrote:

>> RTNL is one dimension. The other is the datapath processing.
>> You need to make sure that packets still flow correctly during the
>> change over.
>
> Sure, since we grab tcf_tree_lock() before changing actions in
> tcf_exts_change(), I think this is guaranteed too.
>

Maybe - I thought there were recent changes to tcf_tree_lock that
eased the restriction. Youd need to make sure.


>> Well - then go nuts and put out a patch.
>> Replace _all or none_ is a reasonable approach.
>>
>>
>
> Great! We both agree on this.
>
> Looking at the current code, we first initialize a list of actions
> and then replace them as a whole by splicing the lists with
> tcf_tree_lock held, so this is already done. IOW, this patch
> is enough.
>
> Or am I missing anything?
>

I dont see what you are seeing. However, some quick tests will prove it.
Example go from 1->3 actions and backwards 3->1 actions.
I.e create a policy with (handwave) 3 actions and replace it with
another that has only one action. Do this while you are sending a
ping exercising this policy.
I can see how yours with 1->0 and 0->1 will work.

cheers,
jamal

  reply	other threads:[~2014-04-23 11:30 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
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 [this message]
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=5357A453.6030901@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.