Hi, here a little patchset proposal to support cpu locality over a socket.
I would understand if it is rejected tough no problems. Thanks.
From f207b3e1f4cfaf9a1682778be747378e7146ce82 Mon Sep 17 00:00:00 2001 From: David Carlier <devne...@gmail.com> Date: Fri, 17 Dec 2021 17:19:48 +0000 Subject: [PATCH 1/3] MINOR: socket Adds support got reuseportbpf new configuration directive. configuration parsing bit and new flag. --- include/haproxy/compat.h | 4 ++++ include/haproxy/global-t.h | 3 +++ src/cfgparse-global.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index f8afe1b5c..7d34ac4cb 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -159,6 +159,10 @@ typedef struct { } empty_t; #include <linux/netfilter_ipv4.h> #endif +#if defined(SO_ATTACH_REUSEPORT_CBPF) +#include <linux/filter.h> +#endif + /* On Linux, IP_TRANSPARENT and/or IP_FREEBIND generally require a kernel patch */ #if defined(USE_LINUX_TPROXY) #if !defined(IP_FREEBIND) diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h index fb01e0768..8d65df4ee 100644 --- a/include/haproxy/global-t.h +++ b/include/haproxy/global-t.h @@ -72,6 +72,9 @@ #define GTUNE_SCHED_LOW_LATENCY (1<<19) #define GTUNE_IDLE_POOL_SHARED (1<<20) #define GTUNE_DISABLE_H2_WEBSOCKET (1<<21) +#define GTUNE_USE_REUSEPORTBPF (1<<22) + +#define GTUNE_LAST (1<<31) /* SSL server verify mode */ enum { diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c index a9e1b9480..9bad9b547 100644 --- a/src/cfgparse-global.c +++ b/src/cfgparse-global.c @@ -167,6 +167,11 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) goto out; global.tune.options &= ~GTUNE_USE_REUSEPORT; } + else if (strcmp(args[0], "reuseportbpf") == 0) { + if (alertif_too_many_args(0, file, linenum, args, &err_code)) + goto out; + global.tune.options |= GTUNE_USE_REUSEPORTBPF; + } else if (strcmp(args[0], "quiet") == 0) { if (alertif_too_many_args(0, file, linenum, args, &err_code)) goto out; -- 2.32.0