Skip to content

Commit

Permalink
xdp-bench: Remove "header in linear part" assumption for -p no-touch
Browse files Browse the repository at this point in the history
Remove a condition in xdp_basic_prog that assumes the
packet header data is in the linear part of the xdp_buff.

Signed-off-by: Nimrod Oren <[email protected]>
Reviewed-by: Tariq Toukan <[email protected]>
  • Loading branch information
nimrod-oren committed Mar 25, 2024
1 parent 07007b0 commit 6f9ae82
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions xdp-bench/xdp_basic.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ static int record_stats(__u32 rxq_idx, bool success)
SEC("xdp")
int xdp_basic_prog(struct xdp_md *ctx)
{
void *data_end = (void *)(long)ctx->data_end;
void *data = (void *)(long)ctx->data;
struct ethhdr *eth = data;
__u64 nh_off;

nh_off = sizeof(*eth);
if (data + nh_off > data_end)
return XDP_ABORTED;

if (record_stats(ctx->rx_queue_index, true))
return XDP_ABORTED;

Expand Down

0 comments on commit 6f9ae82

Please sign in to comment.