diff options
author | Benoît Ganne <bganne@cisco.com> | 2021-05-19 16:41:03 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-05-21 21:07:02 +0000 |
commit | 1a06e53341224bb08cff2fb6d218415c50f947d3 (patch) | |
tree | 9402b008b0ec37c8bfcd4b27a080211e1e4d3153 /src/plugins/af_xdp/device.c | |
parent | 73b71225b1f6bdd65923ac8ac786ed226d57228e (diff) |
af_xdp: use desc offset on rx
Instead of pre-programming the data offset on rx, use offset passed in
the descriptor. This is more robust and future-proof.
Type: fix
Change-Id: I2bd910d92b8b03d17be5be85a24108be711dc7b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/af_xdp/device.c')
-rw-r--r-- | src/plugins/af_xdp/device.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c index 03a3053e449..7a10bce4290 100644 --- a/src/plugins/af_xdp/device.c +++ b/src/plugins/af_xdp/device.c @@ -215,18 +215,7 @@ af_xdp_create_queue (vlib_main_t *vm, af_xdp_create_if_args_t *args, umem_config.comp_size = args->txq_size; umem_config.frame_size = sizeof (vlib_buffer_t) + vlib_buffer_get_default_data_size (vm); - /* - * Note about headroom: for some reasons, there seem to be a discrepency - * between 0-copy and copy mode: - * - 0-copy: XDP_PACKET_HEADROOM will be added to the user headroom - * - copy: nothing is added to the user headroom - * We privileged 0-copy and set headroom so that frame_headroom + - * XDP_PACKET_HEADROOM == sizeof(vlib_buffer_t), ie data will correctly - * point to vlib_buffer_t->data for 0-copy. In copy mode, we have to add - * XDP_PACKET_HEADROOM to desc offset during refill. - */ - STATIC_ASSERT (sizeof (vlib_buffer_t) >= XDP_PACKET_HEADROOM, "wrong size"); - umem_config.frame_headroom = sizeof (vlib_buffer_t) - XDP_PACKET_HEADROOM; + umem_config.frame_headroom = sizeof (vlib_buffer_t); umem_config.flags = XDP_UMEM_UNALIGNED_CHUNK_FLAG; if (xsk_umem__create (umem, uword_to_pointer (vm->buffer_main->buffer_mem_start, void *), |