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

Multiple key candidates #398

Open
varonen opened this issue Sep 21, 2022 · 1 comment
Open

Multiple key candidates #398

varonen opened this issue Sep 21, 2022 · 1 comment

Comments

@varonen
Copy link

varonen commented Sep 21, 2022

Hi,
I would like to use a L2 host table where its key is a mac_addr (48 bits) and exact match.
The question is how I can perform a search on that same table with source MAC and another with dest MAC.
For each match I would like to take a different action.
One way would be to use two tables l2_host_src and l2_host_dest that are mapped to the same physical memory. However, I am not sure that there are any provisions in p4 to force memory mapping.
Any ideas?

@jfingerh
Copy link

I am not aware of any standard way in P4 to do what you ask for.

I could imagine that there might be particular P4 targets that might let you define two different P4 tables, one for source MAC lookup with its own set of actions, and a separate P4 table for dest MAC lookup with its own set of actions, and some kind of annotation to associate them with each other that tells the compiler back end "the set of keys in these two tables is always the same, because they share key storage with each other". That is not a standard P4 annotation, though.

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

2 participants