Skip to content

Commit

Permalink
tools: fix alignment of ipv6_key_t in tcptop
Browse files Browse the repository at this point in the history
Fixes the following error on aarch64:

bpf: Failed to load program: Permission denied
; struct sock *sk = ctx->regs[0]; int copied = ctx->regs[1];
0: (79) r8 = *(u64 *)(r1 +8)
...
; struct ipv6_key_t ipv6_key = {.pid = pid};
79: (63) *(u32 *)(r10 -48) = r7
; struct ipv6_key_t ipv6_key = {.pid = pid};
80: (7b) *(u64 *)(r10 +8) = r9
invalid stack off=8 size=8
processed 96 insns (limit 1000000) max_states_per_insn 0 total_states 7 peak_states 7 mark_read 4
  • Loading branch information
jeromemarchand authored and yonghong-song committed Mar 23, 2020
1 parent 35c9940 commit 6b8a896
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/tcptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ def range_check(string):
BPF_HASH(ipv4_recv_bytes, struct ipv4_key_t);
struct ipv6_key_t {
u32 pid;
unsigned __int128 saddr;
unsigned __int128 daddr;
u32 pid;
u16 lport;
u16 dport;
u64 __pad__;
};
BPF_HASH(ipv6_send_bytes, struct ipv6_key_t);
BPF_HASH(ipv6_recv_bytes, struct ipv6_key_t);
Expand Down

0 comments on commit 6b8a896

Please sign in to comment.