dpdk: Only reconfigure max pipe size on linux 52/40852/2
authorTom Jones <thj@freebsd.org>
Fri, 2 Feb 2024 14:24:04 +0000 (14:24 +0000)
committerDamjan Marion <dmarion@0xa5.net>
Mon, 6 May 2024 11:38:40 +0000 (11:38 +0000)
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>
src/plugins/dpdk/device/cli.c

index c838800..77f9a27 100644 (file)
@@ -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)
     {