Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org
Subject: Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector
Date: Sat, 26 Sep 2020 21:18:15 +0300	[thread overview]
Message-ID: <20200926181814.frtajym5dem4byx4@skbuf> (raw)
In-Reply-To: <20200926180545.GD3883417@lunn.ch>

On Sat, Sep 26, 2020 at 08:05:45PM +0200, Andrew Lunn wrote:
> Given spectra and meltdown etc, jumping through a pointer is expensive
> and we try to avoid it on the hot path. Given most of the taggers are
> going to use the generic version, maybe add a test here, is
> ops->flow_dissect the generic version, and if so, call it directly,
> rather than go through the pointer. Or only set ops->flow_dissect if
> the generic version cannot be used.

Agree about the motivation to eliminate an indirect call if possible.

The situation is as follows:
- Some taggers are before DMAC or before EtherType. These are the vast
  majority, and dsa_tag_generic_flow_dissect works well for them. We can
  keep the .flow_dissect callback as an override, but if this is absent,
  then the flow dissector can call dsa_tag_generic_flow_dissect
  directly.
- Some taggers use tail tags. These don't need any massaging at all. But
  we need to tell the flow dissector to not call
  dsa_tag_generic_flow_dissect if it doesn't find a function pointer.
  I'm thinking about adding another "bool tail_tag" in struct
  dsa_device_ops, for this purpose and not only*.
  *Usually tunnel interfaces need to set dev->needed_headroom for the
  memory allocator. But DSA doesn't request that, and needs to check
  manually in the xmit function if the headroom is large enough to push
  a tag. BUT! tail tags don't need dev->needed_headroom, they need
  dev->needed_tailroom, I think. So I was thinking about adding this
  bool anyway, to distinguish between these 2 cases.

What do you think?

  reply	other threads:[~2020-09-26 18:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26 17:30 [PATCH v2 net-next 00/16] Generic adjustment for flow dissector in DSA Vladimir Oltean
2020-09-26 17:30 ` [PATCH v2 net-next 01/16] net: mscc: ocelot: move NPI port configuration to DSA Vladimir Oltean
2020-09-26 17:30 ` [PATCH v2 net-next 02/16] net: dsa: allow drivers to request promiscuous mode on master Vladimir Oltean
2020-09-26 17:47   ` Andrew Lunn
2020-09-26 17:55     ` Vladimir Oltean
2020-09-26 17:30 ` [PATCH v2 net-next 03/16] net: dsa: sja1105: request promiscuous mode for master Vladimir Oltean
2020-09-26 17:30 ` [PATCH v2 net-next 04/16] net: dsa: tag_ocelot: use a short prefix on both ingress and egress Vladimir Oltean
2020-09-26 17:30 ` [PATCH v2 net-next 05/16] net: dsa: make the .flow_dissect tagger callback return void Vladimir Oltean
2020-09-26 17:49   ` Andrew Lunn
2020-09-26 17:30 ` [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector Vladimir Oltean
2020-09-26 18:05   ` Andrew Lunn
2020-09-26 18:18     ` Vladimir Oltean [this message]
2020-09-26 18:28       ` Andrew Lunn
2020-09-26 18:13   ` Andrew Lunn
2020-09-26 17:30 ` [PATCH v2 net-next 07/16] net: dsa: tag_ar8331: use generic flow dissector procedure Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 08/16] net: dsa: tag_brcm: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 09/16] net: dsa: tag_dsa: use the " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 10/16] net: dsa: tag_edsa: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 11/16] net: dsa: tag_lan9303: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 12/16] net: dsa: tag_mtk: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 13/16] net: dsa: tag_ocelot: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 14/16] net: dsa: tag_qca: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 15/16] net: dsa: tag_sja1105: " Vladimir Oltean
2020-09-26 17:31 ` [PATCH v2 net-next 16/16] net: dsa: tag_rtl4_a: " 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=20200926181814.frtajym5dem4byx4@skbuf \
    --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 \
    --cc=vladimir.oltean@nxp.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