aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-02-02 14:24:04 +0000
committerDamjan Marion <dmarion@0xa5.net>2024-05-06 11:38:40 +0000
commit3d372e655333442ce24b378cf70cc5e8deb6ff7a (patch)
treeacbbb3d1fed2237434f207b48168a7ec09d725e7 /src/plugins
parentf4c79967a659896eb7b2e8a9de981ad46e307a85 (diff)
dpdk: Only reconfigure max pipe size on linux
FreeBSD dynmically grows pipes based on usage and available system memory. Don't try to resize pipes on FreeBSD for now. Type: improvement Change-Id: I78b06dead5d42a3a7bdf634a67b43ef854e510f8 Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/device/cli.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/cli.c b/src/plugins/dpdk/device/cli.c
index c838800deb4..77f9a27f97b 100644
--- a/src/plugins/dpdk/device/cli.c
+++ b/src/plugins/dpdk/device/cli.c
@@ -89,12 +89,18 @@ show_dpdk_physmem (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
{
clib_error_t *err = 0;
- u32 pipe_max_size;
int fds[2];
u8 *s = 0;
int n, n_try;
FILE *f;
+ /*
+ * XXX: Pipes on FreeBSD grow dynamically up to 64KB (FreeBSD 15), don't
+ * manually tweak this value on FreeBSD at the moment.
+ */
+#ifdef __linux__
+ u32 pipe_max_size;
+
err = clib_sysfs_read ("/proc/sys/fs/pipe-max-size", "%u", &pipe_max_size);
if (err)
@@ -112,6 +118,7 @@ show_dpdk_physmem (vlib_main_t * vm, unformat_input_t * input,
err = clib_error_return_unix (0, "fcntl(F_SETPIPE_SZ)");
goto error;
}
+#endif /* __linux__ */
if (fcntl (fds[0], F_SETFL, O_NONBLOCK) == -1)
{