public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox•net>
To: Alexei Starovoitov <ast@plumgrid•com>
Cc: "David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>, Jiri Pirko <jiri@resnulli•us>,
	netdev@vger•kernel.org
Subject: Re: [PATCH net-next] net_sched: act_bpf: remove spinlock in fast path
Date: Tue, 04 Aug 2015 10:55:07 +0200	[thread overview]
Message-ID: <55C07DEB.1010902@iogearbox.net> (raw)
In-Reply-To: <1438664952-24712-1-git-send-email-ast@plumgrid.com>

On 08/04/2015 07:09 AM, Alexei Starovoitov wrote:
> Similar to act_gact/act_mirred, act_bpf can be lockless in packet processing.
>
> Also similar to gact/mirred there is a race between prog->filter and
> prog->tcf_action. Meaning that the program being replaced may use
> previous default action if it happened to return TC_ACT_UNSPEC.
> act_mirred race betwen tcf_action and tcfm_dev is similar.
> In all cases the race is harmless.

Okay, what happens however, when we have an action attached to a
classifier and do a replace on that action, meaning one CPU is still
executing the filter inside tcf_bpf(), while another one is already
running tcf_bpf_cfg_cleanup() on that prog? Afaik, the schedule_work()
that's called during freeing maps/progs might 'mitigate' this race,
but doesn't give a hard guarantee, right?

> Long term we may want to improve the situation by replacing the whole
> struct tc_action as single pointer instead of updating inner fields one by one.
>
> Signed-off-by: Alexei Starovoitov <ast@plumgrid•com>

  reply	other threads:[~2015-08-04  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  5:09 [PATCH net-next] net_sched: act_bpf: remove spinlock in fast path Alexei Starovoitov
2015-08-04  8:55 ` Daniel Borkmann [this message]
2015-08-04 16:35   ` Alexei Starovoitov

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=55C07DEB.1010902@iogearbox.net \
    --to=daniel@iogearbox$(echo .)net \
    --cc=ast@plumgrid$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox