Skip to content

Commit dd00aa1

Browse files
committed
packet04-tailgrow: bpf_xdp_adjust_tail experiments
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent 0fedd26 commit dd00aa1

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

packet04-tailgrow/xdp_prog_kern.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,36 @@ int xdp_pass_func(struct xdp_md *ctx)
9898
return xdp_stats_record_action(ctx, XDP_PASS);
9999
}
100100

101+
SEC("xdp_tailgrow")
102+
int xdp_tailgrow_func(struct xdp_md *ctx)
103+
{
104+
// void *data_end = (void *)(long)ctx->data_end;
105+
// void *data = (void *)(long)ctx->data;
106+
//struct hdr_cursor nh;
107+
int offset;
108+
109+
offset = 10;
110+
bpf_xdp_adjust_tail(ctx, offset);
111+
return xdp_stats_record_action(ctx, XDP_PASS);
112+
}
113+
114+
SEC("xdp_tailgrow_tx")
115+
int xdp_tailgrow_func2(struct xdp_md *ctx)
116+
{
117+
// void *data_end = (void *)(long)ctx->data_end;
118+
// void *data = (void *)(long)ctx->data;
119+
//struct hdr_cursor nh;
120+
int offset;
121+
122+
offset = 32;
123+
bpf_xdp_adjust_tail(ctx, offset);
124+
return xdp_stats_record_action(ctx, XDP_TX);
125+
}
126+
127+
SEC("xdp_tx")
128+
int xdp_tx_func(struct xdp_md *ctx)
129+
{
130+
return xdp_stats_record_action(ctx, XDP_TX);
131+
}
132+
101133
char _license[] SEC("license") = "GPL";

0 commit comments

Comments
 (0)