Skip to contentSkip to conversation

bpf: make bpf_skb_ecn_set_ce callable from BPF_PROG_TYPE_SCHED_ACT

PATCH In review Peter Oskolkov 3 participants 4 messages Mar 15, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: make bpf_skb_ecn_set_ce callable from BPF_PROG_TYPE_SCHED_ACT

This helper is useful if a bpf tc filter sets skb->tstamp.

---
 net/core/filter.c | 2 ++
 1 file changed, 2 insertions(+)
net/core/filter.c +2 -0
index 647c63a7b25b..c6d016d9c4b8 100644
@@ -5719,6 +5719,8 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 		return &bpf_tcp_sock_proto;
 	case BPF_FUNC_get_listener_sock:
 		return &bpf_get_listener_sock_proto;
+	case BPF_FUNC_skb_ecn_set_ce:
+		return &bpf_skb_ecn_set_ce_proto;
 #endif
 	default:
 		return bpf_base_func_proto(func_id);
Signature · 1 line
2.21.0.360.g471c308f928-goog
#2 lore raw
Quoted 8 lines · Martin Lau
Quoted 2 lines · Peter Oskolkov

This helper is useful if a bpf tc filter sets skb->tstamp.

For the patch,

Not sure if it should belong to bpf-next material though.

Thanks, Martin! I consider it a bug that the helper is not available in TC context... ;-)