diff options
| author | Lorenzo Bianconi <[email protected]> | 2020-12-22 21:09:28 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-01-08 21:39:24 +0000 |
| commit | 43b5169d8355ccf26d726fbc75f083b2429113e4 (patch) | |
| tree | cd42fa95a161f2aa4a41c3bcb039ce283b2636ed /drivers/net/xen-netfront.c | |
| parent | bpf: Replace fput with sockfd_put in sock map (diff) | |
| download | kernel-43b5169d8355ccf26d726fbc75f083b2429113e4.tar.gz kernel-43b5169d8355ccf26d726fbc75f083b2429113e4.zip | |
net, xdp: Introduce xdp_init_buff utility routine
Introduce xdp_init_buff utility routine to initialize xdp_buff fields
const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on
xdp_init_buff in all XDP capable drivers.
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Alexander Duyck <[email protected]>
Acked-by: Jesper Dangaard Brouer <[email protected]>
Acked-by: John Fastabend <[email protected]>
Acked-by: Shay Agroskin <[email protected]>
Acked-by: Martin Habets <[email protected]>
Acked-by: Camelia Groza <[email protected]>
Acked-by: Marcin Wojtas <[email protected]>
Link: https://lore.kernel.org/bpf/7f8329b6da1434dc2b05a77f2e800b29628a8913.1608670965.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'drivers/net/xen-netfront.c')
| -rw-r--r-- | drivers/net/xen-netfront.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index b01848ef4649..329397c60d84 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -864,12 +864,12 @@ static u32 xennet_run_xdp(struct netfront_queue *queue, struct page *pdata, u32 act; int err; + xdp_init_buff(xdp, XEN_PAGE_SIZE - XDP_PACKET_HEADROOM, + &queue->xdp_rxq); xdp->data_hard_start = page_address(pdata); xdp->data = xdp->data_hard_start + XDP_PACKET_HEADROOM; xdp_set_data_meta_invalid(xdp); xdp->data_end = xdp->data + len; - xdp->rxq = &queue->xdp_rxq; - xdp->frame_sz = XEN_PAGE_SIZE - XDP_PACKET_HEADROOM; act = bpf_prog_run_xdp(prog, xdp); switch (act) { |
