lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 26 Sep 2020 20:28:25 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Vladimir Oltean <olteanv@...il.com>
Cc:     Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org,
        davem@...emloft.net, f.fainelli@...il.com,
        vivien.didelot@...il.com, kuba@...nel.org
Subject: Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for
 the flow dissector

On Sat, Sep 26, 2020 at 09:18:15PM +0300, Vladimir Oltean wrote:
> 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?

Sounds good.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ