Skip to content

Commit

Permalink
dpdk: Add support for file-prefix on FreeBSD
Browse files Browse the repository at this point in the history
Change-Id: I63aa94dc02d0b202b242a97d91b8cfd5bf2174df
  • Loading branch information
Tom Jones committed May 6, 2024
1 parent 62a6176 commit d49be6e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/plugins/dpdk/device/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,8 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
u8 no_pci = 0;
u8 no_vmbus = 0;
u8 *socket_mem = 0;
#ifdef __linux__
u8 file_prefix = 0;
#ifdef __linux__
vlib_thread_main_t *tm = vlib_get_thread_main ();
uword default_hugepage_sz, x;
u8 *huge_dir_path = 0;
Expand Down Expand Up @@ -1212,7 +1212,20 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
}
foreach_eal_double_hyphen_arg
#undef _
#endif /* __linux__ */
#elif defined(__FreeBSD__)
#define _(a) \
else if (unformat(input, #a " %s", &s)) \
{ \
if (!strncmp(#a, "file-prefix", 11)) \
file_prefix = 1; \
tmp = format (0, "--%s%c", #a, 0); \
vec_add1 (conf->eal_init_args, tmp); \
vec_add1 (s, 0); \
vec_add1 (conf->eal_init_args, s); \
}
foreach_eal_double_hyphen_arg
#undef _
#endif
#define _(a,b) \
else if (unformat(input, #a " %s", &s)) \
{ \
Expand Down Expand Up @@ -1277,6 +1290,14 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
tmp = format (0, "vpp%c", 0);
vec_add1 (conf->eal_init_args, tmp);
}
#elif defined(__FreeBSD__)
if (!file_prefix)
{
tmp = format (0, "--file-prefix%c", 0);
vec_add1 (conf->eal_init_args, tmp);
tmp = format (0, "contigmem0%c", 0);
vec_add1 (conf->eal_init_args, tmp);
}
#endif

if (no_pci == 0 && geteuid () == 0)
Expand Down

0 comments on commit d49be6e

Please sign in to comment.