All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 4/4] net: dsa: implement and use a generic procedure for the flow dissector
Date: Tue, 12 May 2020 04:11:11 +0300	[thread overview]
Message-ID: <CA+h21hpXpakJ06BufXRzWeAVG5-av2zTzVLjcz9NUvnWpAB7Bg@mail.gmail.com> (raw)
In-Reply-To: <16b11435-e9f4-f869-bbcd-fea3cb069f71@gmail.com>

On Tue, 12 May 2020 at 02:15, Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>
>
> On 5/11/2020 1:20 PM, Vladimir Oltean wrote:
> > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> >
> > For all DSA formats that don't use tail tags, it looks like behind the
> > obscure number crunching they're all doing the same thing: locating the
> > real EtherType behind the DSA tag. Nonetheless, this is not immediately
> > obvious, so create a generic helper for those DSA taggers that put the
> > header before the EtherType.
> >
> > Another assumption for the generic function is that the DSA tags are of
> > equal length on RX and on TX. Prior to the previous patch, this was not
> > true for ocelot and for gswip. The problem was resolved for ocelot, but
> > for gswip it still remains, so that hasn't been converted.
> >
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> Given that __skb_flow_dissect() already de-references dsa_device_ops
> from skb->dev->dsa_ptr, maybe we can go one step further and just have
> dsa_tag_generic_flow_dissect obtain the overhead from the SKB directly
> since this will already have touched the cache lines involved. This then
> makes it unnecessary for the various taggers to specify a custom
> function and instead, dsa_tag_generic_flow_dissect() can be assigned
> where the dsa_device_ops are declared for the various tags. Did I miss
> something?
>
> It also looks like tag_ocelot.c and tag_sja1105.c should have their
> dsa_device_ops structures const, as a separate patch certainly.
> --
> Florian

Actually I wrote this patch in such a way that the assembly code
generated would remain the same, since dsa_tag_generic_flow_dissect is
inline, the arithmetic would be done at compile time, which it
wouldn't be if this function were to look at the tagger .overhead.
I don't know, I can do either way.

  reply	other threads:[~2020-05-12  1:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 20:20 [PATCH net-next 0/4] DSA: promisc on master, generic flow dissector code Vladimir Oltean
2020-05-11 20:20 ` [PATCH net-next 1/4] net: dsa: allow drivers to request promiscuous mode on master Vladimir Oltean
2020-05-11 23:19   ` Florian Fainelli
2020-05-11 20:20 ` [PATCH net-next 2/4] net: dsa: sja1105: request promiscuous mode for master Vladimir Oltean
2020-05-11 23:19   ` Florian Fainelli
2020-05-11 20:20 ` [PATCH net-next 3/4] net: dsa: tag_ocelot: use a short prefix on both ingress and egress Vladimir Oltean
2020-05-11 22:40   ` Jakub Kicinski
2020-05-11 22:44     ` Vladimir Oltean
2020-05-11 23:11       ` David Miller
2020-05-11 23:19         ` Vladimir Oltean
2020-05-11 23:22   ` Florian Fainelli
2020-05-11 20:20 ` [PATCH net-next 4/4] net: dsa: implement and use a generic procedure for the flow dissector Vladimir Oltean
2020-05-11 23:15   ` Florian Fainelli
2020-05-12  1:11     ` Vladimir Oltean [this message]
2020-05-11 23:28 ` [PATCH net-next 0/4] DSA: promisc on master, generic flow dissector code Florian Fainelli
2020-05-11 23:52   ` Vladimir Oltean
2020-05-12  0:03     ` Florian Fainelli
2020-05-14 15:27       ` Vladimir Oltean

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=CA+h21hpXpakJ06BufXRzWeAVG5-av2zTzVLjcz9NUvnWpAB7Bg@mail.gmail.com \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@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.