From 54a31ceabcf9204d602be27397d01185050bc07e Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Fri, 16 Dec 2022 12:40:28 +0000 Subject: [PATCH] Take off the XDP_ZEROCOPY flag from port_params_default.xsk_cfg.bind_flags Fix for issue 78; veth does not support zerocopy in bind flags Take off the XDP_ZEROCOPY flag in the setting of port_params_default.xsk_cfg.bind_flags in AF_XDP-forwarding/xsk_fwd.c With this change, libxdp first tries to set up zerocopy, and when it finds that this is not available it sets up an implementation which copies the data. So performance will not be impactes for eths which support zerocopy. Signed-off-by: Chris Ward --- AF_XDP-forwarding/xsk_fwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AF_XDP-forwarding/xsk_fwd.c b/AF_XDP-forwarding/xsk_fwd.c index af2a4c8e..ac9ee00c 100644 --- a/AF_XDP-forwarding/xsk_fwd.c +++ b/AF_XDP-forwarding/xsk_fwd.c @@ -728,7 +728,7 @@ static const struct port_params port_params_default = { .tx_size = XSK_RING_PROD__DEFAULT_NUM_DESCS, .libxdp_flags = 0, .xdp_flags = XDP_FLAGS_DRV_MODE, - .bind_flags = XDP_USE_NEED_WAKEUP | XDP_ZEROCOPY, + .bind_flags = XDP_USE_NEED_WAKEUP, }, .bp = NULL,