diff options
| author | Lu Qiuwen <[email protected]> | 2023-08-05 22:24:33 +0800 |
|---|---|---|
| committer | Lu Qiuwen <[email protected]> | 2023-08-05 22:24:33 +0800 |
| commit | d39d8a1187101f2d25e4a42df7e86232b422e44a (patch) | |
| tree | 383bc110eb08f9d3f54e341315b40674ddce239a | |
| parent | b8efac5f6f76699a9a08269db3d670fde16b49dc (diff) | |
支持从配置文件中读入MLX5网卡的EAL参数。v4.6.40-20230805feature-support-read-mlx5-eal-paramaters
| -rw-r--r-- | service/src/devmgr.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/service/src/devmgr.c b/service/src/devmgr.c index 4712661..e48d883 100644 --- a/service/src/devmgr.c +++ b/service/src/devmgr.c @@ -1862,7 +1862,16 @@ void devmgr_eal_args_generate(struct devmgr_main * devmgr_main, char * eal_argv[ /* generate the mlx5 parameters */ unsigned int mlx5_en_delay_drop = 0; - MESA_load_profile_uint_def(local_cfgfile, "eal", "mlx5_en_delay_drop", &mlx5_en_delay_drop, 0); + MESA_load_profile_uint_def(local_cfgfile, "eal", "mlx5_en_delay_drop", &mlx5_en_delay_drop, 1); + + unsigned int mlx5_en_rxq_pkt_pad = 0; + MESA_load_profile_uint_def(local_cfgfile, "eal", "mlx5_en_rxq_pkt_pad", &mlx5_en_rxq_pkt_pad, 1); + + unsigned int mlx5_txq_inline_max = 0; + MESA_load_profile_uint_def(local_cfgfile, "eal", "mlx5_txq_inline_max", &mlx5_txq_inline_max, 128); + + unsigned int mlx5_txq_inline_mpw = 0; + MESA_load_profile_uint_def(local_cfgfile, "eal", "mlx5_txq_inline_mpw", &mlx5_txq_inline_mpw, 128); TAILQ_FOREACH(dev_can, &devmgr_main->dpdk_dev_candidate_list, next) { @@ -1879,13 +1888,26 @@ void devmgr_eal_args_generate(struct devmgr_main * devmgr_main, char * eal_argv[ /* for the mlx5/6, disable the duplicated flow feature */ if (strcasecmp(dev_can->driver, "mlx5_core") == 0) { - asprintf(&str_dev_option, "%s,%s", str_dev_option, - "rxq_cqe_comp_en=4,rxq_pkt_pad_en=1,txq_inline_max=128,txq_inline_mpw=128,allow_duplicate_pattern=0"); - + asprintf(&str_dev_option, "%s,%s", str_dev_option, "rxq_cqe_comp_en=4,allow_duplicate_pattern=0"); if (mlx5_en_delay_drop > 0) { asprintf(&str_dev_option, "%s,%s", str_dev_option, "delay_drop=0x1"); } + + if (mlx5_en_rxq_pkt_pad > 0) + { + asprintf(&str_dev_option, "%s,rxq_pkt_pad_en=0x1", str_dev_option); + } + + if (mlx5_txq_inline_max > 0) + { + asprintf(&str_dev_option, "%s,txq_inline_max=%u", str_dev_option, mlx5_txq_inline_max); + } + + if (mlx5_txq_inline_mpw > 0) + { + asprintf(&str_dev_option, "%s,txq_inline_mpw=%u", str_dev_option, mlx5_txq_inline_mpw); + } } eal_argv[(*eal_argc)++] = str_dev_option; |
