summaryrefslogtreecommitdiff
path: root/zebra/main.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-02-26 15:40:15 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-02-27 07:47:58 -0500
commit9fb83b55066e5cafa344d6a049e363fb631683f6 (patch)
tree5e9772ad29342ad23d8d9862430229f002cbe74f /zebra/main.c
parentfe972cbfd4973e1156f317c2425af8199892a01b (diff)
zebra: Allow *BSD to specify a receive buffer size
End operator is reporting that they are receiving buffer overruns when attempting to read from the kernel receive socket. It is possible to adjust this size to more modern levels especially for when the system is under load. Modify the code base so that *BSD operators can use the zebra `-s XXX` option to specify a read buffer. Additionally setup the default receive buffer size on *BSD to be 128k instead of the 8k so that FRR does not run into this issue again. Fixes: #10666 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 9deafb532e..7ef30d1d49 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -78,10 +78,12 @@ int graceful_restart;
bool v6_rr_semantics = false;
+/* Receive buffer size for kernel control sockets */
#ifdef HAVE_NETLINK
-/* Receive buffer size for netlink socket */
-uint32_t nl_rcvbufsize = 4194304;
-#endif /* HAVE_NETLINK */
+uint32_t rcvbufsize = 4194304;
+#else
+uint32_t rcvbufsize = 128 * 1024;
+#endif
#define OPTION_V6_RR_SEMANTICS 2000
#define OPTION_ASIC_OFFLOAD 2001
@@ -294,9 +296,9 @@ int main(int argc, char **argv)
frr_preinit(&zebra_di, argc, argv);
frr_opt_add(
- "baz:e:rK:"
+ "baz:e:rK:s:"
#ifdef HAVE_NETLINK
- "s:n"
+ "n"
#endif
,
longopts,
@@ -308,9 +310,11 @@ int main(int argc, char **argv)
" -K, --graceful_restart Graceful restart at the kernel level, timer in seconds for expiration\n"
" -A, --asic-offload FRR is interacting with an asic underneath the linux kernel\n"
#ifdef HAVE_NETLINK
- " -n, --vrfwnetns Use NetNS as VRF backend\n"
" -s, --nl-bufsize Set netlink receive buffer size\n"
+ " -n, --vrfwnetns Use NetNS as VRF backend\n"
" --v6-rr-semantics Use v6 RR semantics\n"
+#else
+ " -s, Set kernel socket receive buffer size\n"
#endif /* HAVE_NETLINK */
);
@@ -359,10 +363,10 @@ int main(int argc, char **argv)
case 'K':
graceful_restart = atoi(optarg);
break;
-#ifdef HAVE_NETLINK
case 's':
- nl_rcvbufsize = atoi(optarg);
+ rcvbufsize = atoi(optarg);
break;
+#ifdef HAVE_NETLINK
case 'n':
vrf_configure_backend(VRF_BACKEND_NETNS);
break;