Re: [PATCH net-next 1/8] net: dsa: add tag driver for LAN9645X
From: Andrew Lunn
Date: Wed Mar 04 2026 - 10:21:25 EST
> > These functions are big enough i would place them into the .c file.
> > Then, normally, i would say, please don't use inline in a C file. But
> > here we are in the fast path. Have you tried this with and without the
> > inline? How does it change the object size and performance?
> >
>
> I did test performance back when I first implemented this. I had some issues
> getting gcc to inline the functions, and that hurt performance quite a bit.
> But I did not look at object size though. I moved them to the header so I could
> add the inline. I can move them to the .c file in the next version.
Developers often get inline wrong:
It is used on the slow path, so all it achieves is bloating the object
size.
It is used on tiny functions, which the compiler is likely to inline
anyway.
Your use case is different. This is fast path, and it is not a small
function. You also have a good justification, you know not using
inline really does hurt performance.
So, please move this into the .c file, and use inline. And add a
comment to the commit message adding your justification for inline.
If something is justified, we will accept it.
Andrew