-
Notifications
You must be signed in to change notification settings - Fork 447
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 Digest extern to PSA/eBPF backend #3164
Conversation
Co-authored-by: Mateusz Kossakowski <mateusz.kossakowski@orange.com> Co-authored-by: Jan Palimąka <jan.palimaka@orange.com>
|
||
Digests are intended to carry a small piece of user-defined data from the data plane to a control plane. | ||
The PSA-eBPF compiler translates each Digest instance into `BPF_MAP_TYPE_QUEUE` that implements a FIFO queue. | ||
If a deparser triggers the `pack()` method, an eBPF program inserts data defined for a Digest into the BPF queue map using `bpf_map_push_elem`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps you can add a link to the relevant section in the psa specification
### Digest | ||
|
||
Digests are intended to carry a small piece of user-defined data from the data plane to a control plane. | ||
The PSA-eBPF compiler translates each Digest instance into `BPF_MAP_TYPE_QUEUE` that implements a FIFO queue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you have a separate table to keep them strongly typed, instead of one table with a union?
This will lose the relative ordering of digests between different tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a single Digest instance, there is a separate BPF map of type BPF_MAP_TYPE_QUEUE
. No unions, etc. Just a straightforward mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no requirement in PSA that data plane -> controller ordering must be maintained across different instances of Digest externs.
backends/ebpf/psa/ebpfPsaGen.cpp
Outdated
this->visit(p4Control->body); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
void ConvertToEBPFDeparserPSA::findDigests(const IR::P4Control *p4Control) { | ||
// Digests are only at ingress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why you should probably give an error if you find one in egress.
I would check this later.
Also, perhaps this field should not be called "type"; we already have many types.
@mbudiu-vmw what about this one? I've addressed/answered your review. |
As you can see, lately I have a lot of reviews to do, so I appreciate if you actively tell me when you are done. |
Got it and understood, I'll be pinging you when I'm done with addressing a review! |
This PR adds support for Digest extern to PSA/eBPF backend.
Digests are implemented using
BPF_MAP_TYPE_QUEUE
. An eBPF program generates a Digest by callingbpf_map_push_elem
. A user space application can get a Digest by callingpsabpf-ctl digest get pipe
orbpf_map_lookup_and_delete_elem
C API.This is another PR from series implementing PSA support for eBPF backend.