Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this DPDK target works for PNA programs? #16

Closed
lzhzero opened this issue Feb 14, 2022 · 9 comments
Closed

Does this DPDK target works for PNA programs? #16

lzhzero opened this issue Feb 14, 2022 · 9 comments

Comments

@lzhzero
Copy link

lzhzero commented Feb 14, 2022

p4c-dpdk can compile PNA programs into spec files. When I try to load it into the bf_switchd target, and run bfrt.<program_name>.enable, I get "Invalid struct field size." error.
I think this is related to some of the PNA metadata fields are 3 bits like bit<3> pna_pre_input_metadata_pass

However, when I hack the .spec file to make them bit<8>, I got "Pipeline build error."

Could you supply some sample programs that can load and run on this DPDK target? Maybe the l3_simple_demo example that is mentioned in the tools folder.

@TingtingXuA
Copy link

Exactly the same question, hope for an answer!

@dandaly
Copy link

dandaly commented Mar 23, 2022

Here is an example file from IPDK. We will look into this pipeline build error:

https://github.com/ipdk-io/ipdk/blob/main/build/examples/simple_l3/simple_l3.p4

@jamescchoi
Copy link
Collaborator

We will add an PNA P4 example and include the steps to build and run.

@lzhzero
Copy link
Author

lzhzero commented Apr 6, 2022

Thanks for the link and explanation.
I am able to run the simple_l3.p4 PSA program and add table entries using the bfrt_python shell of the bf_switchd binary.

So far, I can't load table entries using the bfshell binary. Do I need the p4testutils python package? If so, do you plan to make it available?

@jamescchoi
Copy link
Collaborator

p4testutils is not required. Can you provide more info on the failure? If you have bfrt_python running from the bf_switchd, you can't have another CLI from bf_shell. You may want to try running bf_switchd with --background and connect with bf_shell.

@akaevgen
Copy link

Here is an example file from IPDK. We will look into this pipeline build error:

https://github.com/ipdk-io/ipdk/blob/main/build/examples/simple_l3/simple_l3.p4

Hi Dandaly,

Provided link is broken. Correct link can be founded below, but example related to PSA arch. So, it is not clear, is PNA supported for DPDK pipeline library or not?

https://github.com/ipdk-io/ipdk/blob/9f36013a41b19ea126aa7342a12915d9c5b7075c/build/networking/examples/simple_l3/simple_l3.p4

@akaevgen
Copy link

We will add an PNA P4 example and include the steps to build and run.

Hi James,

Could you pls update the status and clarify will PNA arch supported?

Thanks in advance.

@akaevgen
Copy link

So, it looks that limitation related to pipeline library itself and it's described in P4 docs

"Size of all structure fields to be multiple of 8 bits and should not be greater than 64-bit. (This limitation is planned to be removed by grouping fields into fields which are multiple of 8-bits)".

https://github.com/p4lang/p4c/tree/main/backends/dpdk

@swaroopsarma
Copy link
Collaborator

Yes it works for PNA programs as well and you can find some in examples/pna.
As @akaevgen points out , this is a limitation from the backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants