]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
XDP-TCP: tiny cleanup of handler headers
authorDaniel Salzman <daniel.salzman@nic.cz>
Thu, 24 Jun 2021 09:18:33 +0000 (11:18 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Sat, 10 Jul 2021 20:46:37 +0000 (22:46 +0200)
src/knot/server/udp-handler.h
src/knot/server/xdp-handler.c
src/knot/server/xdp-handler.h

index eca8ec02151946c011e5cd7464f097d735eb74fc..b09e43e14f3a848af6ed35cfd529ba03749eee3c 100644 (file)
@@ -1,4 +1,4 @@
-/*  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
@@ -27,7 +27,6 @@
 #include "knot/server/dthreads.h"
 
 #define RECVMMSG_BATCHLEN 10 /*!< Default recvmmsg() batch size. */
-#define XDP_BATCHLEN      32
 
 /*!
  * \brief UDP handler thread runnable.
index 4d7e2a2049f1c7cf4bf125490529dd58663bf2a4..c5df5bdc3cb064c445e6d65d3e65b1b3985d8f2d 100644 (file)
     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];
index 7a2561c4452b84c5c133287214a4a9234b859447..7b9e9a39c1daa796df683da86d14312d771466db 100644 (file)
@@ -21,6 +21,8 @@
 #include "knot/query/layer.h"
 #include "libknot/xdp/xdp.h"
 
+#define XDP_BATCHLEN  32 /*!< XDP receive batch size. */
+
 struct xdp_handle_ctx;
 struct server;