Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Adding PERCPU_ARRAY Question #130

Open
aaglenn opened this issue Apr 16, 2021 · 2 comments
Open

Adding PERCPU_ARRAY Question #130

aaglenn opened this issue Apr 16, 2021 · 2 comments

Comments

@aaglenn
Copy link

aaglenn commented Apr 16, 2021

Not letting my lack of C++ experience stop me, I'm trying to fix the TODO on line 197 in xdpProgram.cpp.

Despite some review of the code base, I am unsure how to appropriately reference a unsigned 32bit type to pass as key and value types in the emitTableDecl() call. A simple uint32_t or something else?

@mihaibudiu
Copy link
Contributor

A few lines lower in the code there's a reference to u32. That is a 32-bit unsigned integer.

@aaglenn
Copy link
Author

aaglenn commented Apr 18, 2021

indeed that was about all I was able to understand on my own. I may have confused myself with p4c's cstring.h when touching ebpf/target.cpp to add the tableKind

I'm unsure what to use to pass as cstring keyType, cstring valueType as defined in ::emitTableDecl() in, admittedly, p4c and not here. following some definitions lead me to arrayIndexType. In the spirit of changing things and seeing what happens, I will go and do just that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants