bpf: add skb->tstamp r/w access from tc clsact and cg skb progs
authorVlad Dumitrescu <vladum@google.com>
Thu, 22 Nov 2018 19:39:16 +0000 (14:39 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 22 Nov 2018 23:47:28 +0000 (15:47 -0800)
commitf11216b24219ab26d8d159fbfa12dff886b16e32
tree8450dfa5480d05dc3ae2c2710ab90b2211c9814d
parentab85b0143428739cb0f2533182d5824375b6b66b
bpf: add skb->tstamp r/w access from tc clsact and cg skb progs

This could be used to rate limit egress traffic in concert with a qdisc
which supports Earliest Departure Time, such as FQ.

Write access from cg skb progs only with CAP_SYS_ADMIN, since the value
will be used by downstream qdiscs. It might make sense to relax this.

Changes v1 -> v2:
  - allow access from cg skb, write only with CAP_SYS_ADMIN

Signed-off-by: Vlad Dumitrescu <vladum@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/bpf.h
net/core/filter.c
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/test_verifier.c