Skip to content

Commit

Permalink
xdp-bench: Remove "header in linear part" assumption for -l load-bytes
Browse files Browse the repository at this point in the history
Remove a condition in xdp_parse_load_bytes_prog that assumes the
packet header data is in the linear part of the xdp_buff.

Signed-off-by: Nimrod Oren <noren@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
  • Loading branch information
nimrod-oren committed Mar 25, 2024
1 parent 7fe0a09 commit 07007b0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions xdp-bench/xdp_basic.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,7 @@ int xdp_parse_prog(struct xdp_md *ctx)
SEC("xdp")
int xdp_parse_load_bytes_prog(struct xdp_md *ctx)
{
void *data_end = (void *)(long)ctx->data_end;
void *data = (void *)(long)ctx->data;
struct ethhdr *eth = data;
int ret = action;
__u64 nh_off;

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

if (parse_ip_header_load(ctx))
ret = XDP_ABORTED;
Expand Down

0 comments on commit 07007b0

Please sign in to comment.