diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2016-07-02 19:28:47 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-07-04 19:08:40 -0400 |
| commit | 13c5c240f789bbd2bcacb14a23771491485ae61f (patch) | |
| tree | ecf47dfa74f483b539c325e1b95d3772e38e0107 /include/uapi/linux | |
| parent | 6fd980ac39efee9c26b1eb256c3271fcb139bd99 (diff) | |
bpf: add bpf_get_hash_recalc helper
If skb_clear_hash() was invoked due to mangling of relevant headers and
BPF program needs skb->hash later on, we can add a helper to trigger hash
recalculation via bpf_get_hash_recalc().
The helper will return the newly retrieved hash directly, but later access
can also be done via skb context again through skb->hash directly (inline)
without needing to call the helper once more.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/bpf.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index f44504d875e2..c14ca1cd6297 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -348,6 +348,15 @@ enum bpf_func_id { | |||
| 348 | * < 0 error | 348 | * < 0 error |
| 349 | */ | 349 | */ |
| 350 | BPF_FUNC_skb_in_cgroup, | 350 | BPF_FUNC_skb_in_cgroup, |
| 351 | |||
| 352 | /** | ||
| 353 | * bpf_get_hash_recalc(skb) | ||
| 354 | * Retrieve and possibly recalculate skb->hash. | ||
| 355 | * @skb: pointer to skb | ||
| 356 | * Return: hash | ||
| 357 | */ | ||
| 358 | BPF_FUNC_get_hash_recalc, | ||
| 359 | |||
| 351 | __BPF_FUNC_MAX_ID, | 360 | __BPF_FUNC_MAX_ID, |
| 352 | }; | 361 | }; |
| 353 | 362 | ||
