All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: John Fastabend <john.fastabend@gmail.com>,
	xiyou.wangcong@gmail.com, davem@davemloft.net,
	eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH 2/2] net: sched: cls_u32 changes to knode must appear atomic to readers
Date: Thu, 18 Sep 2014 07:38:13 -0400	[thread overview]
Message-ID: <541AC425.2090300@mojatatu.com> (raw)
In-Reply-To: <20140917191202.20529.87231.stgit@nitbit.x32>

On 09/17/14 15:12, John Fastabend wrote:
> Changes to the cls_u32 classifier must appear atomic to the
> readers. Before this patch if a change is requested for both
> the exts and ifindex, first the ifindex is updated then the
> exts with tcf_exts_change(). This opens a small window where
> a reader can have a exts chain with an incorrect ifindex. This
> violates the the RCU semantics.
>
> Here we resolve this by always passing u32_set_parms() a copy
> of the tc_u_knode to work on and then inserting it into the hash
> table after the updates have been successfully applied.
>
> Tested with the following short script:
>

>
> #tc filter add dev p3p2 parent 8001:0 protocol ip prio 99 handle 1: \
> 	       u32 divisor 256
>
> #tc filter add dev p3p2 parent 8001:0 protocol ip prio 99 \
> 	       u32 link 1: hashkey mask ffffff00 at 12    \
> 	       match ip src 192.168.8.0/2
>
> #tc filter add dev p3p2 parent 8001:0 protocol ip prio 102    \
> 	       handle 1::10 u32 classid 1:2 ht 1: 	      \
> 	       match ip src 192.168.8.0/8 match ip tos 0x0a 1e
>
> #tc filter change dev p3p2 parent 8001:0 protocol ip prio 102 \
> 		 handle 1::10 u32 classid 1:2 ht 1:        \
> 		 match ip src 1.1.0.0/8 match ip tos 0x0b 1e
>
> CC: Eric Dumazet <edumazet@google.com>
> CC: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>


Looks good to me.
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

  parent reply	other threads:[~2014-09-18 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 19:11 [net-next PATCH 1/2] net: cls_u32: fix missed pcpu_success free_percpu John Fastabend
2014-09-17 19:12 ` [net-next PATCH 2/2] net: sched: cls_u32 changes to knode must appear atomic to readers John Fastabend
2014-09-17 21:11   ` Cong Wang
2014-09-18  0:06     ` John Fastabend
2014-09-18 16:28       ` Cong Wang
2014-09-18 16:39         ` John Fastabend
2014-09-18 11:38   ` Jamal Hadi Salim [this message]
2014-09-20  4:55     ` John Fastabend
2014-09-18  1:17 ` [net-next PATCH 1/2] net: cls_u32: fix missed pcpu_success free_percpu John Fastabend

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=541AC425.2090300@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=john.fastabend@gmail.com \
    --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.