diff options
| author | songyanchao <[email protected]> | 2023-03-07 09:39:37 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2023-03-07 09:39:37 +0000 |
| commit | 1db43482ef43f20cda5c1128ea40e989cf4508a7 (patch) | |
| tree | 22639250a18d60da68b801191d58afbef423097d | |
| parent | 075c2cd470d19e0687823e2ee79e46c76c50f8ae (diff) | |
🐞 fix(DPISDN-2): 修正 rss mode 为 default 时网卡初始化失败问题
修正 rss mode 为 default 时网卡初始化失败问题
| -rw-r--r-- | service/src/devmgr.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/service/src/devmgr.c b/service/src/devmgr.c index d2b3258..f7d0fdb 100644 --- a/service/src/devmgr.c +++ b/service/src/devmgr.c @@ -10,6 +10,7 @@ #include <rte_bus_pci.h> #include <rte_config.h> #include <rte_debug.h> +#include <rte_eth_bond.h> #include <rte_ethdev.h> #include <rte_ether.h> #include <rte_flow.h> @@ -20,7 +21,6 @@ #include <rte_node_eth_api.h> #include <rte_pci.h> #include <rte_string_fns.h> -#include <rte_eth_bond.h> #include <MESA_prof_load.h> #include <cJSON.h> @@ -244,7 +244,6 @@ static struct representor_config * kernel_resp_config_load(struct devmgr_main * return resp_cfg; } - int mr_dev_desc_config_load(struct devmgr_main * devmgr_main, struct mr_dev_desc * dev_desc) { const char * cfgfile = devmgr_main->sc->local_cfgfile; @@ -512,7 +511,7 @@ int shmdev_setup_one_device(struct devmgr_main * devmgr_main, const char * devsy /* inherit configuration from dev_desc */ struct representor_config * resp_config = dev_desc->representor_config; - if(resp_config != NULL && resp_config->ns_type == REPRESENTOR_NS_APP) + if (resp_config != NULL && resp_config->ns_type == REPRESENTOR_NS_APP) { vdev_desc->representor_config.enable = 1; vdev_desc->representor_config.redirect_local_arp = resp_config->redirect_local_arp; @@ -620,22 +619,22 @@ static int gen_dpdk_dev_ethconf(struct dpdk_dev * dev, unsigned nr_rxq_use, stru /* Get dev info */ rte_eth_dev_info_get(dev->port_id, &dev_info); - eth_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads; - - /* Check request rss_hf the dev supported or not */ - if (eth_conf.rx_adv_conf.rss_conf.rss_hf != request_eth_conf.rx_adv_conf.rss_conf.rss_hf) + if (dev_info.flow_type_rss_offloads == 0) { - /* If device no support rss,reset the eth_conf */ - if (eth_conf.rx_adv_conf.rss_conf.rss_hf == 0) + memcpy(ð_conf, ð_conf_default, sizeof(eth_conf)); + MR_WARNING("The port '%s' no support rss.", dev->symbol); + } + else + { + /* Check request rss_hf the dev supported or not */ + eth_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads; + if (eth_conf.rx_adv_conf.rss_conf.rss_hf != request_eth_conf.rx_adv_conf.rss_conf.rss_hf) { - memcpy(ð_conf, ð_conf_default, sizeof(eth_conf)); - MR_WARNING("The port '%s' no support rss.", dev->symbol); - } - else MR_WARNING("The port %s modified RSS hash function based on hardware support," "requested:%#" PRIx64 " configured:%#" PRIx64 "\n", dev->symbol, request_eth_conf.rx_adv_conf.rss_conf.rss_hf, eth_conf.rx_adv_conf.rss_conf.rss_hf); + } } } else if (dev_desc->drv_type == MR_DEV_DRV_TYPE_DPDK_VIRTIO_USER || |
