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] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c2f6555-53b6-be1c-3d7b-7a6dc95b46fe@bootlin.com>
Date: Mon, 8 Jan 2024 15:23:38 +0100 (CET)
From: Romain Gantois <romain.gantois@...tlin.com>
To: Vladimir Oltean <vladimir.oltean@....com>
cc: Romain Gantois <romain.gantois@...tlin.com>, 
    Alexandre Torgue <alexandre.torgue@...s.st.com>, 
    Jose Abreu <joabreu@...opsys.com>, "David S. Miller" <davem@...emloft.net>, 
    Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
    Paolo Abeni <pabeni@...hat.com>, 
    Maxime Coquelin <mcoquelin.stm32@...il.com>, 
    Miquel Raynal <miquel.raynal@...tlin.com>, 
    Maxime Chevallier <maxime.chevallier@...tlin.com>, 
    Sylvain Girard <sylvain.girard@...com>, 
    Pascal EBERHARD <pascal.eberhard@...com>, 
    Richard Tresidder <rtresidd@...ctromag.com.au>, 
    Linus Walleij <linus.walleij@...aro.org>, 
    Florian Fainelli <f.fainelli@...il.com>, Andrew Lunn <andrew@...n.ch>, 
    netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com, 
    linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org
Subject: Re: [PATCH net v3 1/1] net: stmmac: Prevent DSA tags from breaking
 C

On Mon, 8 Jan 2024, Vladimir Oltean wrote:

...

> Nitpick: you could render this in kernel-doc format.
> https://docs.kernel.org/doc-guide/kernel-doc.html
> 
> > +static inline bool stmmac_has_ip_ethertype(struct sk_buff *skb)
> 
> Nitpick: in netdev it is preferred not to use the "inline" keyword at
> all in C files, only "static inline" in headers, and to let the compiler
> decide by itself when it is appropriate to inline the code (which it
> does by itself even without the "inline" keyword). For a bit more
> background why, you can view Documentation/process/4.Coding.rst, section
> "Inline functions".

I see, the kernel docs were indeed enlightening on this point. As a side note, 
I've just benchmarked both the "with-inline" and "without-inline" versions. 
First of all, objdump seems to confirm that GCC does indeed follow this pragma 
in this particular case. Also, RX perfs are better with stmmac_has_ip_ethertype 
inlined, but TX perfs are actually consistently worse with this function 
inlined, which could very well be caused by cache effects.

In any case, I think it is better to remove the "inline" pragma as you said. 
I'll do that in v4.

Best Regards,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ