[dts] [PATCH 1/3] framework/project_dpdk: add API to get def_rte_config value
Liu, Yong
yong.liu at intel.com
Wed Jun 20 10:02:37 CEST 2018
Thanks, Joyce. Some comments are inline.
> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Joyce Kong
> Sent: Tuesday, June 19, 2018 7:04 PM
> To: dts at dpdk.org
> Cc: phil.yang at arm.com; Joyce Kong <joyce.kong at arm.com>
> Subject: [dts] [PATCH 1/3] framework/project_dpdk: add API to get
> def_rte_config value
>
> Add get_def_rte_config API to get RTE configuration from
> config/defconfig_*.
>
> Signed-off-by: Joyce Kong <joyce.kong at arm.com>
> Reviewed-by: Phil Yang <phil.yang at arm.com>
> ---
> framework/project_dpdk.py | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
> index f87fd13..1006d4f 100644
> --- a/framework/project_dpdk.py
> +++ b/framework/project_dpdk.py
> @@ -430,6 +430,21 @@ class DPDKdut(Dut):
> # No blacklist option in FreeBSD
> return blacklist
>
> + def get_def_rte_config(self, config):
> + """
> + Get RTE configuration from config/defconfig_*.
> + """
> + out = self.send_expect("cat config/defconfig_%s" % self.target,
> "]# ", 10)
> +
Please replace send_expect with send_command, as any kind of string may existing in configuration file.
Suggest to add sed filter which can remove commented lines.
"cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'"
> + def_rte_config = re.findall(config+'=(\S+)', out)
> + if def_rte_config:
> + if re.match(r'\d+', def_rte_config[0]):
> + return int(def_rte_config[0])
> + else:
> + return def_rte_config[0]
Suggest not handle integer here, can leave it to test case.
> +
> + return None
> +
> def set_driver_specific_configurations(self, drivername):
> """
> Set configurations required for specific drivers before
> compilation.
> --
> 1.8.3.1
More information about the dts
mailing list