Re: [Intel-wired-lan] [PATCH v12 net-next 7/9] octeontx2-af: npc: Support for custom KPU profile from filesystem
From: Ratheesh Kannoth
Date: Mon May 11 2026 - 22:12:20 EST
On 2026-05-11 at 17:25:39, Loktionov, Aleksandr (aleksandr.loktionov@xxxxxxxxx) wrote:
> > +
> > + npc_prepare_default_kpu(rvu, profile);
> > +
> > + /* If user not specified profile customization */
> > + if (!strncmp(kpu_profile, def_pfl_name, KPU_NAME_LEN))
> > + return;
> > +
> > + /* Order of preceedence for load loading NPC profile (high to
> > low)
> > + * Firmware binary in filesystem.
> > + * Firmware database method.
> > + * Default KPU profile.
> > + */
> > +
> > + /* Filesystem-based KPU loading is not supported on cn20k.
> > + * npc_prepare_default_kpu() was invoked earlier, but control
> > + * reached this point because the default profile was not
> > selected.
> > + * No need to call it again.
> > + */
> It looks like comment contradicts with the code below?
> Isn't it?
No, there is no contradiction. Let me clarify the intent of the
comment.
npc_prepare_default_kpu() is called unconditionally at the top of
the function to ensure the hardware is always initialized with a
valid baseline KPU profile.
The strncmp(kpu_profile, def_pfl_name, KPU_NAME_LEN) check that
follows determines whether the user has explicitly requested a
non-default profile via the kpu_profile module parameter. If the
default profile name matches, we return early -- the job is
already done by npc_prepare_default_kpu().
However, if the user has specified a custom profile name,
execution continues past the early return. At that point, the
comment is clarifying that even though we are in the "custom
profile requested" code path, we must NOT call
npc_prepare_default_kpu() again -- it was already invoked above
and the HW is already initialized.
In summary: the comment is not describing what the code below
does -- it's explaining why npc_prepare_default_kpu() is
intentionally absent from the non cn20k-specific code path that
follows.
>
> > + if (!is_cn20k(rvu->pdev)) {
> > + if (!npc_load_kpu_profile_from_fs(rvu))
> > + return;
> > + }