Now all XDP driver have been updated to setup xdp_rxq_info and assign this to xdp_buff->rxq. Thus, it is now safe to enable access to some of the xdp_rxq_info struct members. This patch extend xdp_md and expose UAPI to userspace for ingress_ifindex and rx_queue_index. Access happens via bpf instruction rewrite, that load data directly from struct xdp_rxq_info. * ingress_ifindex map to xdp_rxq_info->dev->ifindex * rx_queue_index map to xdp_rxq_info->queue_index
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -899,6 +899,9 @@ struct xdp_md { · 898 unmodified lines | ||
| 899 | 899 | __u32 data; |
| 900 | 900 | __u32 data_end; |
| 901 | 901 | __u32 data_meta; |
| 902 | + /* Below access go though struct xdp_rxq_info */ | |
| 903 | + __u32 ingress_ifindex; /* rxq->dev->ifindex */ | |
| 904 | + __u32 rx_queue_index; /* rxq->queue_index */ | |
| 902 | 905 | }; |
| 903 | 906 | |
| 904 | 907 | enum sk_action { |