bpf: allow BPF programs access skb_shared_info->gso_segs field
authorEric Dumazet <edumazet@google.com>
Wed, 23 Jan 2019 17:22:27 +0000 (09:22 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 Jan 2019 09:49:05 +0000 (10:49 +0100)
commitd9ff286a0f59fa7843549e49bd240393dd7d8b87
treee35b062f71cf6970b8fa2e05e6d9feb0687da8a3
parent866e6ac47409f0bd12398b777fef61fb51ce3680
bpf: allow BPF programs access skb_shared_info->gso_segs field

This adds the ability to read gso_segs from a BPF program.

v3: Use BPF_REG_AX instead of BPF_REG_TMP for the temporary register,
    as suggested by Martin.

v2: refined Eddie Hao patch to address Alexei feedback.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eddie Hao <eddieh@google.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/uapi/linux/bpf.h
net/core/filter.c
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/test_verifier.c