Re: [PATCH v8 net-next 6/6] octeontx2-af: npc: Support for custom KPU profile from filesystem
From: Simon Horman
Date: Fri Mar 27 2026 - 09:39:03 EST
On Wed, Mar 25, 2026 at 12:51:59PM +0530, Ratheesh Kannoth wrote:
...
Thanks for the updates, much appreciated.
I have a few more minor questions.
> +void npc_load_kpu_profile(struct rvu *rvu)
> +{
> + struct npc_kpu_profile_adapter *profile = &rvu->kpu;
> + const char *kpu_profile = rvu->kpu_pfl_name;
> +
> + profile->from_fs = false;
> +
> + /* If user not specified profile customization */
> + if (!strncmp(kpu_profile, def_pfl_name, KPU_NAME_LEN)) {
> + npc_prepare_default_kpu(rvu, profile);
> + return;
> + }
> +
> + /* Order of preceedence for load loading NPC profile (high to low)
> + * Firmware binary in filesystem.
> + * Firmware database method.
> + * Default KPU profile.
> + */
> +
> + /* No support for filesystem KPU loading for cn20k */
> +npc_prepare_default_kpu if (!is_cn20k(rvu->pdev)) {
> + if (!npc_load_kpu_profile_from_fs(rvu))
AI review flags that:
npc_load_kpu_profile_from_fs() calls npc_apply_custom_kpu(),
which returns early if the following condition is met.
if (fw->kpus > profile->kpus)
Does npc_prepare_default_kpu() need to be called before
npc_load_kpu_profile_from_fs() to initialise profile->kpus,
which is 0 by default due to profile being allocated using devm_kzalloc()?
> + return;
> + }
> +
> + /* First prepare default KPU, then we'll customize top entries. */
> + npc_prepare_default_kpu(rvu, profile);
> + if (!npc_load_kpu_profile_from_fw(rvu))
> + return;
>
> -revert_to_default:
> npc_prepare_default_kpu(rvu, profile);
Is this call to npc_prepare_default_kpu() still needed?
> }
>
> static void npc_parser_profile_init(struct rvu *rvu, int blkaddr)
> {
> + struct npc_kpu_profile_adapter *profile = &rvu->kpu;
> struct rvu_hwinfo *hw = rvu->hw;
> int num_pkinds, num_kpus, idx;
>
...