summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/dpdk.h2
-rw-r--r--src/plugins/dpdk/device/format.c3
-rw-r--r--src/plugins/dpdk/device/init.c36
3 files changed, 29 insertions, 12 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index d58d2daa768..ab28ac06a0a 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -336,6 +336,8 @@ typedef struct
u32 hqos_enabled;
dpdk_device_config_hqos_t hqos;
u8 tso;
+ u8 *devargs;
+
#define DPDK_DEVICE_TSO_DEFAULT 0
#define DPDK_DEVICE_TSO_OFF 1
#define DPDK_DEVICE_TSO_ON 2
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 292c083fca5..20493eb77da 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -564,6 +564,9 @@ format_dpdk_device (u8 * s, va_list * args)
format_white_space, indent + 2, format_dpdk_link_status, xd);
s = format (s, "%Uflags: %U\n",
format_white_space, indent + 2, format_dpdk_device_flags, xd);
+ if (di.device->devargs && di.device->devargs->args)
+ s = format (s, "%UDevargs: %s\n",
+ format_white_space, indent + 2, di.device->devargs->args);
s = format (s, "%Urx: queues %d (max %d), desc %d "
"(min %d max %d align %d)\n",
format_white_space, indent + 2, xd->rx_q_used, di.max_rx_queues,
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 5a6262c30a1..d0125e93936 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -1118,6 +1118,8 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
{
devconf->tso = DPDK_DEVICE_TSO_OFF;
}
+ else if (unformat (input, "devargs %s", &devconf->devargs))
+ ;
else
{
error = clib_error_return (0, "unknown input `%U'",
@@ -1428,21 +1430,31 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
/* copy tso config from default device */
_(tso)
+ /* copy tso config from default device */
+ _(devargs)
+
/* add DPDK EAL whitelist/blacklist entry */
if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
- {
- tmp = format (0, "-w%c", 0);
- vec_add1 (conf->eal_init_args, tmp);
- tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
- vec_add1 (conf->eal_init_args, tmp);
- }
+ {
+ tmp = format (0, "-w%c", 0);
+ vec_add1 (conf->eal_init_args, tmp);
+ if (devconf->devargs)
+ {
+ tmp = format (0, "%U,%s", format_vlib_pci_addr, &devconf->pci_addr, devconf->devargs, 0);
+ }
+ else
+ {
+ tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
+ }
+ vec_add1 (conf->eal_init_args, tmp);
+ }
else if (num_whitelisted == 0 && devconf->is_blacklisted != 0)
- {
- tmp = format (0, "-b%c", 0);
- vec_add1 (conf->eal_init_args, tmp);
- tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
- vec_add1 (conf->eal_init_args, tmp);
- }
+ {
+ tmp = format (0, "-b%c", 0);
+ vec_add1 (conf->eal_init_args, tmp);
+ tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
+ vec_add1 (conf->eal_init_args, tmp);
+ }
}));
/* *INDENT-ON* */