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

Missing namespaces in tofino back end. #5214

Open
fruffy opened this issue Apr 2, 2025 · 5 comments
Open

Missing namespaces in tofino back end. #5214

fruffy opened this issue Apr 2, 2025 · 5 comments
Labels
good-first-issue An issue that could be solved by someone new to the code base.

Comments

@fruffy
Copy link
Collaborator

fruffy commented Apr 2, 2025

A lot of the files in the tofino backend have namespace BFN but it should be namespace P4:BFN. A lot of the files (in particular in bf-asm) do not have any namespace at all. This should be fixed.

@fruffy fruffy added the good-first-issue An issue that could be solved by someone new to the code base. label Apr 2, 2025
@Vineet1101
Copy link
Contributor

@fruffy taking on this task. anything else you would like to tell

@fruffy
Copy link
Collaborator Author

fruffy commented Apr 2, 2025

This is a fairly straightforward task but you will have to edit many files. You may also run into compilation problems because of the namespace change, which may need to be fix. Usually the change is simple, but it can be tedious.

Another thing: Anything like P4::IR::... or similar within the namespaces can be simplified to IR:: after this change.

@Vineet1101
Copy link
Contributor

ok i will start working on this

@ChrisDodd
Copy link
Contributor

A lot of the files (in particular in bf-asm) do not have any namespace at all. This should be fixed.

Why? bfas is a standalone executable, not a library, so there's no point to using namespaces other than obfuscation.

@fruffy
Copy link
Collaborator Author

fruffy commented Apr 7, 2025

Why? bfas is a standalone executable, not a library, so there's no point to using namespaces other than obfuscation.

Similar reasoning as #4707 (comment). If you want to use the assembler as library this could become an issue (although it's unlikely that will be the case for now).

bfas is also not completely standalone, it does call into lib a fair bit. As part of the compiler it probably makes sense to encapsulate the code in the P4 namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue An issue that could be solved by someone new to the code base.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants