netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Hurley <john.hurley@netronome.com>
To: Florian Westphal <fw@strlen.de>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Simon Horman <simon.horman@netronome.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	oss-drivers@netronome.com
Subject: Re: [RFC net-next v2 1/1] net: sched: protect against loops in TC filter hooks
Date: Tue, 11 Jun 2019 15:58:27 +0100	[thread overview]
Message-ID: <CAK+XE=m_Z=A6JXYvVzBBk+SPw5xnc_B3UsLfG81G5-kjrUNnzA@mail.gmail.com> (raw)
In-Reply-To: <20190606195255.4uelltuxptwobhiv@breakpoint.cc>

On Thu, Jun 6, 2019 at 8:52 PM Florian Westphal <fw@strlen.de> wrote:
>
> David Miller <davem@davemloft.net> wrote:
> > From: Florian Westphal <fw@strlen.de>
> > Date: Thu, 6 Jun 2019 14:58:18 +0200
> >
> > >> @@ -827,6 +828,7 @@ struct sk_buff {
> > >>    __u8                    tc_at_ingress:1;
> > >>    __u8                    tc_redirected:1;
> > >>    __u8                    tc_from_ingress:1;
> > >> +  __u8                    tc_hop_count:2;
> > >
> > > I dislike this, why can't we just use a pcpu counter?
> >
> > I understand that it's because the only precise context is per-SKB not
> > per-cpu doing packet processing.  This has been discussed before.
>
> I don't think its worth it, and it won't work with physical-world
> loops (e.g. a bridge setup with no spanning tree and a closed loop).
>
> Also I fear that if we start to do this for tc, we will also have to
> followup later with more l2 hopcounts for other users, e.g. veth,
> bridge, ovs, and so on.

Hi David/Florian,
Moving forward with this, should we treat the looping and recursion as
2 separate issues and at least prevent the potential stack overflow
panics caused by the recursion?
The pcpu counter should protect against this.
Are there context specific issues that we may miss by doing this?
If not I will respin with the pcpu counter in act_mirred.

  reply	other threads:[~2019-06-11 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 12:49 [RFC net-next v2 1/1] net: sched: protect against loops in TC filter hooks John Hurley
2019-06-06 12:58 ` Florian Westphal
2019-06-06 13:27   ` John Hurley
2019-06-06 14:04     ` Florian Westphal
2019-06-06 18:19   ` David Miller
2019-06-06 19:52     ` Florian Westphal
2019-06-11 14:58       ` John Hurley [this message]
2019-06-11 15:03         ` Florian Westphal

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='CAK+XE=m_Z=A6JXYvVzBBk+SPw5xnc_B3UsLfG81G5-kjrUNnzA@mail.gmail.com' \
    --to=john.hurley@netronome.com \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=jakub.kicinski@netronome.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=simon.horman@netronome.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).