diff options
| author | David S. Miller <davem@davemloft.net> | 2016-06-30 05:54:48 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-06-30 05:54:48 -0400 |
| commit | 545c321ba3c524045ebc26f6c81b3ec3ba966836 (patch) | |
| tree | d02f10ddd1ad1f4e5d280ab8e285f7ab450312fc /include/uapi/linux | |
| parent | ee58b57100ca953da7320c285315a95db2f7053d (diff) | |
| parent | d2485c4242a826fdf493fd3a27b8b792965b9b9e (diff) | |
Merge branch 'bpf-helper-improvements'
Daniel Borkmann says:
====================
BPF helper improvements
This set adds various BPF helper improvements, that is, cleaning
up and adding BPF_F_CURRENT_CPU flag for tracing helper, allowing
for preemption checks on bpf_get_smp_processor_id() helper, and
adding two new helpers bpf_skb_change_{proto, type} for tc related
programs. For further details please see individual patches.
Note, this set requires -net to be merged into -net-next tree first.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/bpf.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 406459b935a2..be6ac1291680 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -313,6 +313,29 @@ enum bpf_func_id { | |||
| 313 | */ | 313 | */ |
| 314 | BPF_FUNC_skb_get_tunnel_opt, | 314 | BPF_FUNC_skb_get_tunnel_opt, |
| 315 | BPF_FUNC_skb_set_tunnel_opt, | 315 | BPF_FUNC_skb_set_tunnel_opt, |
| 316 | |||
| 317 | /** | ||
| 318 | * bpf_skb_change_proto(skb, proto, flags) | ||
| 319 | * Change protocol of the skb. Currently supported is | ||
| 320 | * v4 -> v6, v6 -> v4 transitions. The helper will also | ||
| 321 | * resize the skb. eBPF program is expected to fill the | ||
| 322 | * new headers via skb_store_bytes and lX_csum_replace. | ||
| 323 | * @skb: pointer to skb | ||
| 324 | * @proto: new skb->protocol type | ||
| 325 | * @flags: reserved | ||
| 326 | * Return: 0 on success or negative error | ||
| 327 | */ | ||
| 328 | BPF_FUNC_skb_change_proto, | ||
| 329 | |||
| 330 | /** | ||
| 331 | * bpf_skb_change_type(skb, type) | ||
| 332 | * Change packet type of skb. | ||
| 333 | * @skb: pointer to skb | ||
| 334 | * @type: new skb->pkt_type type | ||
| 335 | * Return: 0 on success or negative error | ||
| 336 | */ | ||
| 337 | BPF_FUNC_skb_change_type, | ||
| 338 | |||
| 316 | __BPF_FUNC_MAX_ID, | 339 | __BPF_FUNC_MAX_ID, |
| 317 | }; | 340 | }; |
| 318 | 341 | ||
| @@ -347,7 +370,7 @@ enum bpf_func_id { | |||
| 347 | #define BPF_F_ZERO_CSUM_TX (1ULL << 1) | 370 | #define BPF_F_ZERO_CSUM_TX (1ULL << 1) |
| 348 | #define BPF_F_DONT_FRAGMENT (1ULL << 2) | 371 | #define BPF_F_DONT_FRAGMENT (1ULL << 2) |
| 349 | 372 | ||
| 350 | /* BPF_FUNC_perf_event_output flags. */ | 373 | /* BPF_FUNC_perf_event_output and BPF_FUNC_perf_event_read flags. */ |
| 351 | #define BPF_F_INDEX_MASK 0xffffffffULL | 374 | #define BPF_F_INDEX_MASK 0xffffffffULL |
| 352 | #define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK | 375 | #define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK |
| 353 | 376 | ||
