Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
33d00037
Commit
33d00037
authored
Nov 05, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update compat bpf.h with 4.4 features
Signed-off-by:
Brenden Blanco
<
bblanco@plumgrid.com
>
parent
4bcd220a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
37 deletions
+38
-37
src/cc/compat/linux/bpf.h
src/cc/compat/linux/bpf.h
+38
-37
No files found.
src/cc/compat/linux/bpf.h
View file @
33d00037
...
@@ -63,50 +63,16 @@ struct bpf_insn {
...
@@ -63,50 +63,16 @@ struct bpf_insn {
__s32
imm
;
/* signed immediate constant */
__s32
imm
;
/* signed immediate constant */
};
};
/* BPF syscall commands */
/* BPF syscall commands
, see bpf(2) man-page for details.
*/
enum
bpf_cmd
{
enum
bpf_cmd
{
/* create a map with given type and attributes
* fd = bpf(BPF_MAP_CREATE, union bpf_attr *, u32 size)
* returns fd or negative error
* map is deleted when fd is closed
*/
BPF_MAP_CREATE
,
BPF_MAP_CREATE
,
/* lookup key in a given map
* err = bpf(BPF_MAP_LOOKUP_ELEM, union bpf_attr *attr, u32 size)
* Using attr->map_fd, attr->key, attr->value
* returns zero and stores found elem into value
* or negative error
*/
BPF_MAP_LOOKUP_ELEM
,
BPF_MAP_LOOKUP_ELEM
,
/* create or update key/value pair in a given map
* err = bpf(BPF_MAP_UPDATE_ELEM, union bpf_attr *attr, u32 size)
* Using attr->map_fd, attr->key, attr->value, attr->flags
* returns zero or negative error
*/
BPF_MAP_UPDATE_ELEM
,
BPF_MAP_UPDATE_ELEM
,
/* find and delete elem by key in a given map
* err = bpf(BPF_MAP_DELETE_ELEM, union bpf_attr *attr, u32 size)
* Using attr->map_fd, attr->key
* returns zero or negative error
*/
BPF_MAP_DELETE_ELEM
,
BPF_MAP_DELETE_ELEM
,
/* lookup key in a given map and return next key
* err = bpf(BPF_MAP_GET_NEXT_KEY, union bpf_attr *attr, u32 size)
* Using attr->map_fd, attr->key, attr->next_key
* returns zero and stores next key or negative error
*/
BPF_MAP_GET_NEXT_KEY
,
BPF_MAP_GET_NEXT_KEY
,
/* verify and load eBPF program
* prog_fd = bpf(BPF_PROG_LOAD, union bpf_attr *attr, u32 size)
* Using attr->prog_type, attr->insns, attr->license
* returns fd or negative error
*/
BPF_PROG_LOAD
,
BPF_PROG_LOAD
,
BPF_OBJ_PIN
,
BPF_OBJ_GET
,
};
};
enum
bpf_map_type
{
enum
bpf_map_type
{
...
@@ -114,6 +80,7 @@ enum bpf_map_type {
...
@@ -114,6 +80,7 @@ enum bpf_map_type {
BPF_MAP_TYPE_HASH
,
BPF_MAP_TYPE_HASH
,
BPF_MAP_TYPE_ARRAY
,
BPF_MAP_TYPE_ARRAY
,
BPF_MAP_TYPE_PROG_ARRAY
,
BPF_MAP_TYPE_PROG_ARRAY
,
BPF_MAP_TYPE_PERF_EVENT_ARRAY
,
};
};
enum
bpf_prog_type
{
enum
bpf_prog_type
{
...
@@ -159,6 +126,11 @@ union bpf_attr {
...
@@ -159,6 +126,11 @@ union bpf_attr {
__aligned_u64
log_buf
;
/* user supplied buffer */
__aligned_u64
log_buf
;
/* user supplied buffer */
__u32
kern_version
;
/* checked when prog_type=kprobe */
__u32
kern_version
;
/* checked when prog_type=kprobe */
};
};
struct
{
/* anonymous struct used by BPF_OBJ_* commands */
__aligned_u64
pathname
;
__u32
bpf_fd
;
};
}
__attribute__
((
aligned
(
8
)));
}
__attribute__
((
aligned
(
8
)));
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
...
@@ -270,6 +242,33 @@ enum bpf_func_id {
...
@@ -270,6 +242,33 @@ enum bpf_func_id {
*/
*/
BPF_FUNC_skb_get_tunnel_key
,
BPF_FUNC_skb_get_tunnel_key
,
BPF_FUNC_skb_set_tunnel_key
,
BPF_FUNC_skb_set_tunnel_key
,
BPF_FUNC_perf_event_read
,
/* u64 bpf_perf_event_read(&map, index) */
/**
* bpf_redirect(ifindex, flags) - redirect to another netdev
* @ifindex: ifindex of the net device
* @flags: bit 0 - if set, redirect to ingress instead of egress
* other bits - reserved
* Return: TC_ACT_REDIRECT
*/
BPF_FUNC_redirect
,
/**
* bpf_get_route_realm(skb) - retrieve a dst's tclassid
* @skb: pointer to skb
* Return: realm if != 0
*/
BPF_FUNC_get_route_realm
,
/**
* bpf_perf_event_output(ctx, map, index, data, size) - output perf raw sample
* @ctx: struct pt_regs*
* @map: pointer to perf_event_array map
* @index: index of event in the map
* @data: data on stack to be output as raw data
* @size: size of data
* Return: 0 on success
*/
BPF_FUNC_perf_event_output
,
__BPF_FUNC_MAX_ID
,
__BPF_FUNC_MAX_ID
,
};
};
...
@@ -290,6 +289,8 @@ struct __sk_buff {
...
@@ -290,6 +289,8 @@ struct __sk_buff {
__u32
ifindex
;
__u32
ifindex
;
__u32
tc_index
;
__u32
tc_index
;
__u32
cb
[
5
];
__u32
cb
[
5
];
__u32
hash
;
__u32
tc_classid
;
};
};
struct
bpf_tunnel_key
{
struct
bpf_tunnel_key
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment