Exceeding FC_MAX_KEY_LEN_LW max length and disabling flowcache

76 views
Skip to first unread message

Gesualdo Di Perna

unread,
Nov 18, 2024, 1:17:26 PM11/18/24
to open-nfp
Hi everyone,

While working on a P4 code I bumped into the following error:
/opt/netronome/p4/components/nfp_pif/me/apps/common/include/flow_cache_global_c.h(330) : catastrophic error: #error directive: "FC_MAX_KEY_LEN_LW is limited to a maximum of 23"

I thus tried to disable the flowcache when running the nfp4build command, but I got the same error as in this other discussion:
/opt/netronome/p4/components/nfp_pif/me/apps/common/src/fc.c(8) : catastrophic error: could not open source file "flow_cache_global_c.h"
I tried to manually include the path to the flowcache directory as suggest in the discussion, but that did not work for me. What seemed to work was creating a symlink to flow_cache_global_c.h in /opt/netronome/p4/components/nfp_pif/me/apps/common/include. After that, the error for the import of flow_cache_global_c.h disappears when running nfp4build (which shows "flowcache: disabled") but the original error about FC_MAX_KEY_LEN_LW exceeding 23 is shown again. However. if the flowcache is correctly disabled, should this error not appear anymore?

Any pointers on how to correctly disable the flowcache, or about anything that can be done to solve the original error would be greatly appreciated!

Thank you!

Luís Pereira

unread,
Nov 19, 2024, 4:24:48 AM11/19/24
to open-nfp
Hi!

In order to solve the issue, I believe you need to manually add to the nfp4build command the following flags:
--disable-component flowcache
--include /opt/netronome/p4/components/flowcache/me/lib/flowcache

Gesualdo Di Perna

unread,
Nov 19, 2024, 12:18:50 PM11/19/24
to open-nfp

Hi!

Thank you for replying! Unfortunately that does not solve the issue for me, and I still get the import error. I read that for some other people using the --include flag works (e.g., in this case) while for others it does not (e.g., in this other case).
The only fix which seems to work for me is wrapping the entire content of /opt/netronome/p4/components/nfp_pif/me/apps/common/src/fc.c directly into an #ifndef PIF_GLOBAL_FLOWCACHE_DISABLED, such that the the file does nothing when the flowcache is disabled in nfp4build (i.e., it doesn't even try to include flow_cache_global_c.h). This gets rid of both the include error when disabling the flowcache, and of the FC_MAX_KEY_LEN_LW error once the cache is disabled, and everything seems to work as expected. However, I am still wondering why nfp4build tries to compile/use flowcache-related files in the first place if the flowcache is disabled.

Luís Pereira

unread,
Nov 23, 2024, 6:59:52 AM11/23/24
to open-nfp
I had a similar issue with flowcache, the solution was what I told you.
A colleague of mine has this Template, where we added flags for disabling the cache flow while compiling, this solved the issue for me.
You can try and use it if you want.
Reply all
Reply to author
Forward
0 new messages