From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BAE71A0A03;
	Mon, 18 Jan 2021 17:18:25 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 998E6140D36;
	Mon, 18 Jan 2021 17:18:25 +0100 (CET)
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20])
 by mails.dpdk.org (Postfix) with ESMTP id 77DF8140CE6
 for <dev@dpdk.org>; Mon, 18 Jan 2021 17:18:24 +0100 (CET)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.west.internal (Postfix) with ESMTP id F3FEC1829;
 Mon, 18 Jan 2021 11:18:22 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Mon, 18 Jan 2021 11:18:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm3; bh=
 jbsjUbM3dMQJNDr1riUWdFfcZ15SmT1fyt52RD1jXaY=; b=F0dgoUsXfJLCfzlg
 QwONNgs+aKI9sYC6nk+H7noawHc8NAaI9mRPQ3hvoMQF16i80tLuHkicGj2ze1LQ
 yeAwFhKLGR9BZ5tQCEBD5Rj8ngnlGxTt/U6tzrWDXRzDHJjEqAOeoJ+L3GJ5rO1m
 iWKqx5QBPTEu6p16S1JACmpeLqsbE5ZIokkZH+cOm3aJBjzkr6W+bqcIkg6n12v/
 SQ8o0hIekNecjzP5TdAvFLVjOVTmlS8LDf0ayZ3kPGNOh26+wQN7QFsYjW09HOI4
 MnUf5BPvzt54kosnChR6CVlsBJt7duMeksKHYgLaqAhqSET7K4pqfULYUQQGzRyw
 Mxfexw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=jbsjUbM3dMQJNDr1riUWdFfcZ15SmT1fyt52RD1jX
 aY=; b=mvSrgrwp8LrwONp8MMhzK2iDtKKGwFsT9FMErimGxZ5kf6RTkOkaQsYpS
 d0CsKAymRNncpy6XOsPIECDaV6QbOAPW+W9//IpLMIAtaiu84IqFKNoJtmHlxhvf
 Epc+DBZOjVgZiX8pwUiVt+ANCurv9+m781I85oZ9y3Qa6rHGjCcFAeRxncV5g7u8
 0NwTpDX9+PGEGDAyhtuwW8YwqVRLyjUC8NrYr3//d/BMHM2xd2Yxf1KuaoyXEDqK
 harZekq7VTXgkLT6XjzXixXTzfDAS927+aRlOw2RYvB4ezFnNloEVjgjVFVkTr11
 BOtOYYqvLTzTTsTYjilYRGXXBvkiQ==
X-ME-Sender: <xms:zbQFYN4FK7sQzN9TNoNLYktOC3eivxXxPYQiXH-zflMGmWg7DNMo8g>
 <xme:zbQFYJ_up9M0foR1ZVyJm58uX1pnmoLiUTNqOWX4igFX7MXgfyxsXscM1PCUvtZ_L
 LPIJpUuG2xsTSsSug>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdekgdekjecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih
 iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho
 nhdrnhgvth
X-ME-Proxy: <xmx:zbQFYKoxBG8fUabJ_metEhvkeCAhKXiP1I0H1UrLvJQWCAjPPkyFcQ>
 <xmx:zbQFYCr_CLMXZeae7lT2JF9twqIQRAqfwDum5R-oELx4KH3OvzbHtQ>
 <xmx:zbQFYF3vCh_ZItJtvKx_JLb3PFILpS-C9Ol2MHYn5Q35m46NpG6B0g>
 <xmx:zrQFYC1cJkpmgvAumNEWINhm_OU_SKDvxJ7MPiLa1uIyChPZyKU8WQ>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 35AF424005D;
 Mon, 18 Jan 2021 11:18:21 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: Xueming Li <xuemingl@nvidia.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 Olivier Matz <olivier.matz@6wind.com>, dev@dpdk.org,
 Viacheslav Ovsiienko <viacheslavo@nvidia.com>, Asaf Penso <asafp@nvidia.com>
Date: Mon, 18 Jan 2021 17:18:20 +0100
Message-ID: <6719978.oSDc5pInoS@thomas>
In-Reply-To: <1610968623-31345-3-git-send-email-xuemingl@nvidia.com>
References: <1610968623-31345-1-git-send-email-xuemingl@nvidia.com>
 <1610968623-31345-3-git-send-email-xuemingl@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v4 2/9] ethdev: support representor port list
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

18/01/2021 12:16, Xueming Li:
> To support extended representor syntax, this patch extends the
> representor list parsing to support for representor port range in
> devargs, examples:
>    representor=[1,2,3]         - single list
>    representor=[1,3-5,7,9-11]  - list with singles and ranges
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Parsing functions are usually difficult to read.
If you need to do another version, I would recommend adding
an oneline comment on top of parsing functions to give a hint
about what it is really doing.

Here,

> +static int
> +rte_eth_devargs_enlist(uint16_t *list, uint16_t *len_list,
> +		       const uint16_t max_list, uint16_t val)

here,

> +static char *
>  rte_eth_devargs_process_range(char *str, uint16_t *list, uint16_t *len_list,
>  	const uint16_t max_list)

here,

> +static char *
> +rte_eth_devargs_process_list(char *str, uint16_t *list, uint16_t *len_list,
> +	const uint16_t max_list)

and also for this old one:

> @@ -121,6 +115,9 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)