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

Add bazel support for p4c-dpdk compiler #3441

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

lzhzero
Copy link
Contributor

@lzhzero lzhzero commented Jul 15, 2022

  1. Made p4c atribute of the p4_library rule configurable, so the
    p4c-dpdk compiler can be selected if needed. The default
    compiler is still p4c-bm2-ss.

  2. Added DPDK backend specific bf-rt-schema and context output files.

  3. Added everything under p4include folder into the default include.

  4. updated blaze example with dpdk pna program vxlan.p4.
    Note: This vxlan.p4 program already exist in backends/dpdk/examples/vxlan.p4

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but should probably be reviewed by a bazel expert too

@smolkaj
Copy link
Member

smolkaj commented Jul 15, 2022

This is super cool, thanks for the extension!

I don't feel strongly, but I wonder if renaming the p4c parameter to p4c_backend makes sense -- perhaps that makes things a bit more readable from the user perspective?

LGTM from my side either way.

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will wait for the changes suggested by @smolkaj to merge.

1. Use 'p4c_backend' atribute to configure the p4c backend binary
used for p4_library rule. The 'p4c-dpdk' compiler can be selected
if needed. The default compiler is still 'p4c-bm2-ss'.

2. Added DPDK backend specific bf-rt-schema and context output files.

3. Added pna.p4 into default include path.

4. updated blaze example with dpdk pna program vxlan.p4.
@lzhzero
Copy link
Contributor Author

lzhzero commented Jul 19, 2022

Thanks for the suggestion. The PR is now updated.

I only changed the user facing blaze rule attribute name, and did not change the internal variable name p4c. Otherwise we might need to change other internal variable names to be consistent.

Please let me know what do you think.

Also this PR will close issue #3391

@smolkaj
Copy link
Member

smolkaj commented Jul 19, 2022

Beautiful, thanks!

@mihaibudiu mihaibudiu merged commit 5c21f41 into p4lang:main Jul 19, 2022
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

Successfully merging this pull request may close these issues.

3 participants