Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples/bpf: tc_bench01_redirect lookup ingress ifindex and detect if…
… bouncing packet If bouncing packet out ingress device, we need to update MAC-addr, as some NIC HW will drop such bounced frames silently (e.g mlx5). There are two options of getting the SKB ingress ifindex, via the bpf mirror struct __sk_buff. 1) __sk_buff->ingress_ifindex == skb->skb_iif which is set to skb->dev->ifindex, just before us via sch_handle_ingress() 2) __sk_buff->ifindex == skb->dev->ifindex which is translated into BPF instructions that dereference dev->ifindex Option 1, requires the fewest eBPF instructions. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
- Loading branch information