xdp-project / xdp-tutorial

XDP tutorial
2.33k stars 562 forks source link

extend packet #374

Open Nian0124 opened 8 months ago

Nian0124 commented 8 months ago

hi,everone ! I would like to ask if there is a way to use XDP to extend the packet, such as adding a new field, and ensure that the end data is not lost.

Nian0124 commented 8 months ago

oh, I got it !

ahihi8z8z commented 7 months ago

oh, I got it !

How you did that? I have a similar problem in https://github.com/xdp-project/xdp-tutorial/issues/376

sachintiptur commented 7 months ago

You can use helper calls like bpf_xdp_adjust_head

Nian0124 commented 6 months ago

oh, I got it !

How you did that? I have a similar problem in #376

sorry that I don't check my email timely ; I just use the helpers "bpf_xdp_adjust_tail" This function adjusts the position of the packet tail; also "bpf_xdp_adjust_head" adjust the position of the packet header; This is used by a blogger when adding a timestamp to the tail, but I can't find that post.

Nian0124 commented 6 months ago

oh, I got it !

How you did that? I have a similar problem in #376

sorry that I don't check my email timely ; I just use the helpers "bpf_xdp_adjust_tail" This function adjusts the position of the packet tail; also "bpf_xdp_adjust_head" adjust the position of the packet header; This is used by a blogger when adding a timestamp to the tail, but I can't find that post.

ooohhh , just the xdp-tutorial/experiment01-traigrow ; hhhhh