diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index dfd919374017..a3f24486829e 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -281,9 +281,9 @@ static int xdp_recv_frames(struct xdp_frame **frames, int nframes, static int xdp_test_run_batch(struct xdp_test_data *xdp, struct bpf_prog *prog, u32 repeat) { - struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); int err = 0, act, ret, i, nframes = 0, batch_sz; struct xdp_frame **frames = xdp->frames; + struct bpf_redirect_info *ri; struct xdp_page_head *head; struct xdp_frame *frm; bool redirect = false; @@ -294,6 +294,7 @@ static int xdp_test_run_batch(struct xdp_test_data *xdp, struct bpf_prog *prog, local_bh_disable(); xdp_set_return_frame_no_direct(); + ri = this_cpu_ptr(&bpf_redirect_info); for (i = 0; i < batch_sz; i++) { page = page_pool_dev_alloc_pages(xdp->pp);