History

sched, bpf: add helper for retrieving routing realms

Using routing realms as part of the classifier is quite useful, it can be viewed as a tag for one or multiple routing entries (think of an analogy to net_cls cgroup for processes), set by user space routing daemons or via iproute2 as an indicator for traffic classifiers and later on processed in the eBPF program. Unlike actions, the classifier can inspect device flags and enable netif_keep_dst() if necessary. tc actions don't have that possibility, but in case people know what they are doing, it can be used from there as well (e.g. via devs that must keep dsts by design anyway). If a realm is set, the handler returns the non-zero realm. User space can set the full 32bit realm for the dst.

Daniel Borkmann committed 11 years ago

Commit c46646d1 parent a91263d5 files · +39 −3Browse files

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

Unified · Split

include/uapi/linux/bpf.h+7−0
@@ -280,6 +280,13 @@ enum bpf_func_id { · 279 unmodified lines
280280 * Return: TC_ACT_REDIRECT
281281 */
282282 BPF_FUNC_redirect,
283+
284+ /**
285+ * bpf_get_route_realm(skb) - retrieve a dst's tclassid
286+ * @skb: pointer to skb
287+ * Return: realm if != 0
288+ */
289+ BPF_FUNC_get_route_realm,
283290 __BPF_FUNC_MAX_ID,
284291 };
285292

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t