-
Notifications
You must be signed in to change notification settings - Fork 68
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
Read and write to registers #61
Comments
Yes it does. You have to use the thrift API: https://github.com/nsg-ethz/p4-utils/blob/master/p4utils/utils/thrift_API.py#L1976 You can find examples in the p4-learning repo: https://github.com/nsg-ethz/p4-learning/blob/master/examples/recirculate_and_add_header/fill_register.py |
Hi @edgar-costa, Thank you so much for your answer, I was able to get it to work. I need for each incoming packet to have the queue size of each egress port. Indeed, I know that in the ingress using the standard metadata we can have access to the queue size of the port that the packet enq and deq in it. However, what I need is for each incoming packet to check the current queue size of each egress port so I wanna send on the least congested port. Is there any solution or tricks or resources that might help in this? Again thank you so much for your help. |
That is something related to specific P4 architectures not P4-utils. Using the Otherwise, you can not know it beforehand. With a real hardware architecture you will need them to support this. There is something similar in By the way, this paper: https://dl.acm.org/doi/10.1145/3098822.3098839 is doing what you want to do, but its a pre-p4 paper. |
You can do so like:
|
I am writing the source ip address and destination ip address of the header to the register, why is the data read by the controller a set of numbers, how to translate the bit IP address |
@huyongqingandczw That has nothing to do with P4. Addresses are 32-bit integers. When you read them, you need to translate them yourself. This code will do that
|
Hello,
I just want to ask if P4-UTILS supports reading and writing to registers. I highly appreciate your help.
Thank you.
The text was updated successfully, but these errors were encountered: