-/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "knot/server/dthreads.h"
#define RECVMMSG_BATCHLEN 10 /*!< Default recvmmsg() batch size. */
-#define XDP_BATCHLEN 32
/*!
* \brief UDP handler thread runnable.
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "knot/server/xdp-handler.h"
+#ifdef ENABLE_XDP
-#include "contrib/ucw/mempool.h"
+#include <stdlib.h>
+#include <urcu.h>
+
+#include "knot/server/xdp-handler.h"
#include "knot/common/log.h"
#include "knot/server/server.h"
+#include "contrib/ucw/mempool.h"
#include "libknot/error.h"
#include "libknot/xdp/tcp.h"
-#include <stdlib.h>
-#include <urcu.h>
-
-#define XDP_BATCHLEN 32 // TODO move/dedup
-
-#ifdef ENABLE_XDP
-
typedef struct xdp_handle_ctx {
knot_xdp_msg_t msg_recv[XDP_BATCHLEN];
knot_xdp_msg_t msg_send_udp[XDP_BATCHLEN];