You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bpf: Support specifying linear xdp packet data size in test_run
To test bpf_xdp_pull_data(), an xdp packet containing fragments as well
as free linear data area needs to be created. However,
bpf_prog_test_run_xdp() always fills the linear area with data_in before
creating fragments, leaving no space to pull data. This patch will allow
users to specify the linear data size through ctx->data_end.
Currently, ctx_in->data_end must match data_size_in and will not be the
final ctx->data_end seen by the xdp program. This is because
ctx->data_end is populated according to the xdp_buff passed to test_run,
which always contains PAGE_SIZE - headroom - tailroom bytes of linear
data if the linear data given by the user exceeds it.
This patch will allow user to specify the size of data that goes into
the linear area. When ctx_in->data_end is different from data_size_in,
only ctx_in->data_end bytes of data will be put into the linear area when
creating the xdp_buff.
While ctx_in->data_end will be allowed to be different from data_size_in,
it cannot be larger than the data_size_in as there will be no data to
copy from. If it is larger than the maximum linear data area size, the
layout suggested by the user will not be honored. Data beyond the
maximum linear data area size will still be put into fragments.
Signed-off-by: Amery Hung <[email protected]>
0 commit comments