From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Joe Damato <jdamato@fastly.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>,
open list <linux-kernel@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"moderated list:INTEL ETHERNET DRIVERS"
<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [RFC net-next 1/1] idpf: Don't hard code napi_struct size
Date: Tue, 1 Oct 2024 15:14:07 +0200 [thread overview]
Message-ID: <a2d7ef07-a3a8-4427-857f-3477eb48af11@intel.com> (raw)
In-Reply-To: <Zvsjitl-SANM81Mk@LQ3V64L9R2>
From: Joe Damato <jdamato@fastly.com>
Date: Mon, 30 Sep 2024 15:17:46 -0700
> On Mon, Sep 30, 2024 at 03:10:41PM +0200, Przemek Kitszel wrote:
>> On 9/30/24 14:38, Alexander Lobakin wrote:
>>> From: Alexander Lobakin <aleksander.lobakin@intel.com>
>>> Date: Mon, 30 Sep 2024 14:33:45 +0200
>>>
>>>> From: Joe Damato <jdamato@fastly.com>
>>>> Date: Wed, 25 Sep 2024 18:00:17 +0000
>>
>>> struct napi_struct doesn't have any such fields and doesn't depend on
>>> the kernel configuration, that's why it's hardcoded.
>>> Please don't change that, just adjust the hardcoded values when needed.
>>
>> This is the crucial point, and I agree with Olek.
>>
>> If you will find it more readable/future proof, feel free to add
>> comments like /* napi_struct */ near their "400" part in the hardcode.
>>
>> Side note: you could just run this as a part of your netdev series,
>> given you will properly CC.
>
> I've already sent the official patch because I didn't hear back on
> this RFC.
>
> Sorry, but I respectfully disagree with you both on this; I don't
> think it makes sense to have code that will break if fields are
> added to napi_struct thereby requiring anyone who works on the core
> to update this code over and over again.
>
> I understand that the sizeofs are "meaningless" because of your
> desire to optimize cachelines, but IMHO and, again, respectfully, it
> seems strange that any adjustments to core should require a change
> to this code.
But if you change any core API, let's say rename a field used in several
drivers, you anyway need to adjust the affected drivers.
It's a common practice that some core changes require touching drivers.
Moreover, sizeof(struct napi_struct) doesn't get changed often, so I
don't see any issue in adjusting one line in idpf by just increasing one
value there by sizeof(your_new_field).
If you do that, then:
+ you get notified that you may affect the performance of different
drivers (napi_struct is usually embedded into perf-critical
structures in drivers);
+ I get notified (Cced) that someone's change will affect idpf, so I'll
be aware of it and review the change;
- you need to adjust one line in idpf.
Is it just me or these '+'s easily outweight that sole '-'?
>
> I really do not want to include a patch to change the size of
> napi_struct in idpf as part of my RFC which is totally unrelated to
> idpf and will detract from the review of my core changes.
One line won't distract anyone. The kernel tree contains let's say one
patch from me where I needed to modify around 20 drivers within one
commit due to core code structure change -- the number of locs I changed
in the drivers was way bigger than the number of locs I changed in the
core. And there's a ton of such commits in there. Again, it's a common
practice.
>
> Perhaps my change is unacceptable, but there should be a way to deal
> with this that doesn't require everyone working on core networking
> code to update idpf, right?
We can't isolate the core code from the drivers up to the point that you
wouldn't require to touch the drivers at all when working on the core
changes, we're not Windows. The drivers and the core are inside one
tree, so that such changes can be made easily and no code inside the
whole tree is ABI (excl uAPI).
Thanks,
Olek
next prev parent reply other threads:[~2024-10-01 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 18:00 [Intel-wired-lan] [RFC net-next 0/1] idpf: Don't hardcode napi_struct size Joe Damato
2024-09-25 18:00 ` [Intel-wired-lan] [RFC net-next 1/1] idpf: Don't hard code " Joe Damato
2024-09-25 20:33 ` Simon Horman
2024-09-30 12:33 ` Alexander Lobakin
2024-09-30 12:38 ` Alexander Lobakin
2024-09-30 13:10 ` Przemek Kitszel
2024-09-30 22:17 ` Joe Damato
2024-10-01 13:14 ` Alexander Lobakin [this message]
2024-10-01 14:44 ` Joe Damato
2024-10-02 17:17 ` Jakub Kicinski
2024-10-03 13:35 ` Alexander Lobakin
2024-10-03 15:46 ` Joe Damato
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=a2d7ef07-a3a8-4427-857f-3477eb48af11@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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