DPDK patches and discussions
 help / color / mirror / Atom feed
From: <han.li1@zte.com.cn>
To: <thomas@monjalon.net>
Cc: <dev@dpdk.org>, <reshma.pattan@intel.com>
Subject: [dpdk-dev] 答复: Re:  [PATCH v3]  app/proc-info: fix port mask parse issue
Date: Wed, 14 Nov 2018 11:57:07 +0800 (CST)
Message-ID: <201811141157075427143@zte.com.cn> (raw)
In-Reply-To: <3847235.2WWUCME0sW@xps>

  below is maintainer's suggestion,and I think it's ok to do these changes?
> -----Original Message-----> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Li HanTo avoid typecast below , please use uint64_t for enabled_port_mask. So change below function return type to uint64_t> -static int> +static uint32_t>  parse_portmask(const char *portmask)>  {Declare pm to be of type uint64_t.> +	return (uint32_t)pm;You can remove above typecast after change to uint64_t. Thanks, Reshma

发件人:ThomasMonjalon <thomas@monjalon.net>
抄送人:dev@dpdk.org <dev@dpdk.org>;reshma.pattan@intel.com <reshma.pattan@intel.com>;
日 期 :2018年11月14日 11:10
主 题 :Re: [dpdk-dev] [PATCH v3]  app/proc-info: fix port mask parse issue

07/11/2018 07:10, Li Han:
> parse_portmask return type is int,but global variable
> "enabled_port_mask" type is uint32_t.so in proc_info_parse_args
> function,when parse_portmask return -1,"enabled_port_mask" will
> get a huge value and "if (enabled_port_mask == 0)" will never happen.
> Fixes: 22561383ea17 ("app: replace dump_cfg by proc_info")
> Signed-off-by: Li Han <han.li1@zte.com.cn>
> -static uint32_t enabled_port_mask;
> +static uint64_t enabled_port_mask;
> -static int
> +static unsigned long
>  parse_portmask(const char *portmask)

On one side, you use uint64_t, on the other side, you use unsigned long.
I don't understand the logic behind.

  reply	other threads:[~2018-11-14  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07  6:10 [dpdk-dev] " Li Han
2018-11-07  9:47 ` Pattan, Reshma
2018-11-14  3:10 ` Thomas Monjalon
2018-11-14  3:57   ` han.li1 [this message]
2018-11-14 10:39   ` Burakov, Anatoly
2018-11-16 10:15 ` Burakov, Anatoly
2018-11-16 10:35   ` Burakov, Anatoly

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201811141157075427143@zte.com.cn \
    --to=han.li1@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    --cc=thomas@monjalon.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git