From: "Liu, Yong" <yong.liu@intel.com>
To: Joyce Kong <joyce.kong@arm.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "phil.yang@arm.com" <phil.yang@arm.com>
Subject: Re: [dts] [PATCH 1/3] framework/project_dpdk: add API to get def_rte_config value
Date: Wed, 20 Jun 2018 08:02:37 +0000 [thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E630C6FA9@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1529406238-13393-1-git-send-email-joyce.kong@arm.com>
Thanks, Joyce. Some comments are inline.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Joyce Kong
> Sent: Tuesday, June 19, 2018 7:04 PM
> To: dts@dpdk.org
> Cc: phil.yang@arm.com; Joyce Kong <joyce.kong@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@arm.com>
> Reviewed-by: Phil Yang <phil.yang@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
prev parent reply other threads:[~2018-06-20 8:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-19 11:03 Joyce Kong
2018-06-19 11:03 ` [dts] [PATCH 2/3] tests/hello_world: fix invalid coremask when config RTE_MAX_LCORE Joyce Kong
2018-06-19 11:03 ` [dts] [PATCH 3/3] tests/coremask: " Joyce Kong
2018-06-20 8:02 ` Liu, Yong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86228AFD5BCD8E4EBFD2B90117B5E81E630C6FA9@SHSMSX103.ccr.corp.intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
--cc=joyce.kong@arm.com \
--cc=phil.yang@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).