Introduce an eBPF hookpoint for tx queue selection in the XPS (Transmit Packet Steering) code.
Subsystems (3)
RFC 1/2 Introduce an eBPF hookpoint for tx queue selection in the XPS (Transmit Packet Steering) code.
WORK IN PROGRESS:
* bpf program loading works!
* txq steering via bpf program return code works!
* bpf program unloading not working.
* bpf program attached query not working.
--- include/linux/netdevice.h | 3 +++ include/uapi/linux/if_link.h | 12 +++++++++ net/core/dev.c | 61 ++++++++++++++++++++++++++++++++++++------- net/core/rtnetlink.c | 62 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 9 deletions(-)
include/linux/netdevice.h +3 -0
@@ -1966,6 +1966,7 @@ struct net_device {#ifdef CONFIG_XPS struct xps_dev_maps __rcu *xps_cpus_map;struct xps_dev_maps __rcu *xps_rxqs_map; +struct bpf_prog __rcu *xps_prog;#endif #ifdef CONFIG_NET_CLS_ACT struct mini_Qdisc __rcu *miniq_egress;
@@ -2147,6 +2148,8 @@ struct netdev_queue *netdev_core_pick_tx(struct net_device *dev,struct sk_buff *skb, struct net_device *sb_dev); +int dev_change_xps_fd (struct net_device *dev,int fd); +/* returns the headroom that the master device needs to take in account * when forwarding to this dev */
include/uapi/linux/if_link.h +12 -0
@@ -167,6 +167,7 @@ enum {IFLA_NEW_IFINDEX ,IFLA_MIN_MTU ,IFLA_MAX_MTU , +IFLA_XPS , __IFLA_MAX };
@@ -979,6 +980,17 @@ enum {#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1) +/* XPS section */ + +enum { +IFLA_XPS_UNSPEC , +IFLA_XPS_FD , +IFLA_XPS_ATTACHED , + __IFLA_XPS_MAX, +}; + +#define IFLA_XPS_MAX (__IFLA_XPS_MAX - 1) +enum {IFLA_EVENT_NONE ,IFLA_EVENT_REBOOT ,/* internal reset / reboot */
net/core/dev.c +52 -9
84 lines not on this page · raw message
net/core/rtnetlink.c +62 -0
104 lines not on this page · raw message
Signature · 1 line
1.8.3.1