diff options
author | Xinyao Cai <xinyao.cai@intel.com> | 2023-04-12 18:35:23 +0800 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2023-04-25 15:13:22 +0000 |
commit | efad24a84d35458e2c672b94027e54923a42fd25 (patch) | |
tree | e3ebb21f1c3274d81e5d1b9fbcf874f0685a5dbc /src/plugins/dpdk/device/init.c | |
parent | 140ca0fa95b4b8c037dfa83e99fd08620e93c646 (diff) |
dpdk: code preparation for bumping to DPDK 22.11
This patch prepares code for bumping DPDK version to 22.11, but the DPDK version of this patch keeps at 22.07 for compatibility.
the "no-dsa" parameter in DPDK configuration is removed, the "blacklist" parameter can be used to block the related DSA devices.
Type: feature
Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I08787c6584bba66383fc0a784963f33171196910
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r-- | src/plugins/dpdk/device/init.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 847affea243..3eb1da55919 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -205,8 +205,12 @@ dpdk_find_startup_config (struct rte_eth_dev_info *di) if ((vmbus_dev = dpdk_get_vmbus_device (di))) { unformat_input_t input_vmbus; - unformat_init_string (&input_vmbus, di->device->name, - strlen (di->device->name)); +#if RTE_VERSION >= RTE_VERSION_NUM(22, 11, 0, 0) + const char *dev_name = rte_dev_name (di->device); +#else + const char *dev_name = di->device->name; +#endif + unformat_init_string (&input_vmbus, dev_name, strlen (dev_name)); if (unformat (&input_vmbus, "%U", unformat_vlib_vmbus_addr, &vmbus_addr)) p = mhash_get (&dm->conf->device_config_index_by_vmbus_addr, &vmbus_addr); @@ -997,7 +1001,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) int eal_no_hugetlb = 0; u8 no_pci = 0; u8 no_vmbus = 0; - u8 no_dsa = 0; u8 file_prefix = 0; u8 *socket_mem = 0; u8 *huge_dir_path = 0; @@ -1108,8 +1111,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) tmp = format (0, "--no-pci%c", 0); vec_add1 (conf->eal_init_args, tmp); } - else if (unformat (input, "no-dsa")) - no_dsa = 1; else if (unformat (input, "blacklist %U", unformat_vlib_vmbus_addr, &vmbus_addr)) { @@ -1319,13 +1320,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) vm = vlib_get_main (); - if (no_dsa) - { - struct rte_bus *bus; - bus = rte_bus_find_by_name ("dsa"); - if (bus) - rte_bus_unregister (bus); - } /* make copy of args as rte_eal_init tends to mess up with arg array */ for (i = 1; i < vec_len (conf->eal_init_args); i++) conf->eal_init_args_str = format (conf->eal_init_args_str, "%s ", |