From: Florian Westphal <fw@strlen.de>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
netdev@vger.kernel.org, jhs@mojatatu.com, daniel@iogearbox.net
Subject: Re: [PATCH -next 2/3] net: sched: remove AT INGRESS/EGRESS
Date: Fri, 15 May 2015 19:21:15 +0200 [thread overview]
Message-ID: <20150515172115.GK6179@breakpoint.cc> (raw)
In-Reply-To: <20150515162319.GA8234@Alexeis-MBP.westell.com>
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 0e7afef..802b9b9 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -3071,9 +3071,6 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
> > txq = netdev_pick_tx(dev, skb, accel_priv);
> > q = rcu_dereference_bh(txq->qdisc);
> >
> > -#ifdef CONFIG_NET_CLS_ACT
> > - skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS);
> > -#endif
>
> I don't think it's a good change.
> Squeezing 4 bits into 2 by losing AT_STACK condition, imo, is wrong.
Its right, IMO.
> Before ifb could differentiate AT_STACK and AT_EGRESS, but when
> they're aliased we lose this information.
IFB refuses to work with skbs that did not come in via mirred.
So, from ifb point of view it makes no difference, G_TC_FROM+AT_STACK
causes skb to be dropped and IFB doesn't care about G_TC_AT() at all.
So the change is compatible: zero state == "mirred did not see this skb"
-> drop
> I think we shmuld keep AT_STACK, AT_INGRESS, AT_EGRESS.
We have dozens of combinations that either cannot happen
from concept point of view (skb is AT_EGRESS or its coming in,
it can't be both logically) or because no code path uses/sets it.
For G_TC_AT(), we only have two cases: egress (since
everything is attached to qdisc / coming in via dev_queue_xmit thats
the "normal case", and the special ingress one, which is what the new
TC_AT_INGRESS state is for. The ingress case is also "special" because
it can only turn back to 0 (no mirred action attached to ingress) or
change to TC_FROM_INGRESS (when mirred grabs it).
The existing G_TC_AT is is irrelevant for IFB since ifb is reachable only
called via ndo_start_xmit so its always at egress.
skb_tc_state enum just tells us what do to with the skb --
back to ingress or transmit via device.
AT_STACK cannot even happen for the G_TC_AT case from looking at the
code since dev_queue_xmit forces AT_EGRESS & rx sets AT_INGRESS.
And for FROM its only relevant in ifb to detect skb that wasn't seen by
mirred. And we keep this functionality via 0 skb_tc_state.
I did a test patch with Jamals suggestion (continue using macros, just
close holes), but I see no gain: we get 5 bits that are used for
automaton that only has/cares about 4 possible (distinct) skb states.
next prev parent reply other threads:[~2015-05-15 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 8:50 [PATCH -next 0/3] tc state machinery cleanups Florian Westphal
2015-05-15 8:50 ` [PATCH -next 1/3] net: sched: remove FROM INGRESS/EGRESS Florian Westphal
2015-05-15 8:50 ` [PATCH -next 2/3] net: sched: remove AT INGRESS/EGRESS Florian Westphal
2015-05-15 16:23 ` Alexei Starovoitov
2015-05-15 17:21 ` Florian Westphal [this message]
2015-05-15 20:09 ` Alexei Starovoitov
2015-05-15 22:22 ` Florian Westphal
2015-05-15 22:43 ` Jamal Hadi Salim
2015-05-15 8:50 ` [PATCH -next 3/3] net: core: use skb_tc_state to skip ingress classifiers Florian Westphal
2015-05-15 11:36 ` [PATCH -next 0/3] tc state machinery cleanups Jamal Hadi Salim
2015-05-15 11:59 ` Florian Westphal
2015-05-15 13:11 ` Daniel Borkmann
2015-05-18 3:34 ` David Miller
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=20150515172115.GK6179@breakpoint.cc \
--to=fw@strlen.de \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
/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.