summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorChenmin Sun <chenmin.sun@intel.com>2019-12-14 06:59:03 +0800
committerDamjan Marion <dmarion@me.com>2019-12-17 17:55:34 +0000
commitf2bde7ac51123a0a46334b4ec55e2aceae031db7 (patch)
tree42387621b9ea20944fea2a14ceebcb0ba586676a /src/plugins/dpdk/device/init.c
parenta7cb357491bc8adeac23a329685e8ea9aa2d2f33 (diff)
dpdk: add devargs support
Type: feature This patch adds the devargs support for dpdk device The devargs are used as hardware-specific init args for dpdk devices please refer to the nic guides under $(DPDK_DIR)/doc/guides/nics/$(NIC_DRIVER).rst Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: Id380d04720090bb66afe5ce09d664e5e248b8eb9
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r--src/plugins/dpdk/device/init.c36
1 files changed, 24 insertions, 12 deletions
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* */