-
Notifications
You must be signed in to change notification settings - Fork 176
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
ENA/XDP metadata support #265
Comments
Hi @mejedi Thank you for raising this request, we will look into it. |
Hi @davidarinzon, As of today, we had a single use of metadata. Our routing logic is implemented in XDP. We rely on the kernel's ARP handling/neighbour cache. When the destination MAC address is in the cache, we are able to fully handle a packet in XDP ( However, when the destination MAC is not yet known, we have to trigger an ARP probe to learn it eventually. It is not possible from XDP, therefore we It worked beautifully in testing, but failed with the real ENA. Quite unexpectedly, metadata support turned out to be optional :( A workaround would revolve around passing the data inline; the tricky bit is picking an encoding that doesn't legitimately occur on the wire. One option would be picking a distinct ethertype, but it doesn't quite work. Another option is using a funny destination MAC address. Overall, it looks needlessly complicated and inelegant though.
|
Hi @mejedi |
We had a patch locally to enable metadata support. It was as easy setting the second parameter in this line to |
Are you sure? It looks like metadata start should be copied to skb to take advantage of it on TC side, but apparently it is not. |
Ah, we only use XDP, and we made our patch a while ago, so you're probably correct that more needs to be done to copy the metadata to the SKB. |
The link is now pointing to the wrong place. Here's probably the line that was linked back then: amzn-drivers/kernel/linux/ena/ena_netdev.c Line 1387 in ac09615
Nevertheless, even without copying to tc being able to use |
xdp_buff
has a metadata area, which an XDP eBPF program can use to stash some info (usingbpf_xdp_adjust_meta
and direct packet access to write data). This information is transferred tosk_buff
, and could be accessed by a TC eBPF program. This mechanism enables communication between XDP and TC programs.Unfortunately, ENA driver doesn't support attaching and transferring metadata.
bpf_xdp_adjust_meta
fails withENOTSUPP
when invoked in ENA XDP path.EMnify would love to see this feature implemented.
The text was updated successfully, but these errors were encountered: