History

bpf: finally expose xdp_rxq_info to XDP bpf-programs

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

Jesper Dangaard Brouer committed 8 years ago

Commit 02dd3291 parent e817f852 files · +22 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -899,6 +899,9 @@ struct xdp_md { · 898 unmodified lines
899 __u32 data;899 __u32 data;
900 __u32 data_end;900 __u32 data_end;
901 __u32 data_meta;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
904enum sk_action {907enum sk_action {