From 3d372e655333442ce24b378cf70cc5e8deb6ff7a Mon Sep 17 00:00:00 2001 From: Tom Jones Date: Fri, 2 Feb 2024 14:24:04 +0000 Subject: 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 --- src/plugins/dpdk/device/cli.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins') 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) { -- cgit 1.2.3-korg