diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2022-01-03 16:08:09 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-01-06 04:46:32 +0100 |
commit | d53ad5d8b218a885e95080d4d3d556b16b91b1b9 (patch) | |
tree | 0de2ccc3ad0064fc8bc1828c8e1dda00225c24d4 /kernel/bpf/cpumap.c | |
parent | page_pool: Store the XDP mem id (diff) | |
download | linux-d53ad5d8b218a885e95080d4d3d556b16b91b1b9.tar.xz linux-d53ad5d8b218a885e95080d4d3d556b16b91b1b9.zip |
xdp: Move conversion to xdp_frame out of map functions
All map redirect functions except XSK maps convert xdp_buff to xdp_frame
before enqueueing it. So move this conversion of out the map functions
and into xdp_do_redirect(). This removes a bit of duplicated code, but more
importantly it makes it possible to support caller-allocated xdp_frame
structures, which will be added in a subsequent commit.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220103150812.87914-5-toke@redhat.com
Diffstat (limited to 'kernel/bpf/cpumap.c')
-rw-r--r-- | kernel/bpf/cpumap.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c index 0421061d95f1..b3e6b9422238 100644 --- a/kernel/bpf/cpumap.c +++ b/kernel/bpf/cpumap.c @@ -746,15 +746,9 @@ static void bq_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_frame *xdpf) list_add(&bq->flush_node, flush_list); } -int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp, +int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_frame *xdpf, struct net_device *dev_rx) { - struct xdp_frame *xdpf; - - xdpf = xdp_convert_buff_to_frame(xdp); - if (unlikely(!xdpf)) - return -EOVERFLOW; - /* Info needed when constructing SKB on remote CPU */ xdpf->dev_rx = dev_rx; |