From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4539A0C61; Fri, 5 Nov 2021 11:34:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FF2741134; Fri, 5 Nov 2021 11:34:22 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 4404F410DC for ; Fri, 5 Nov 2021 11:34:21 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DF3085C00B8; Fri, 5 Nov 2021 06:34:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 05 Nov 2021 06:34:20 -0400 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=fm2; bh= w76hs/2bD1CHO+U9xpRM8RUsGzAp3WlHrENinH50Oyw=; b=oAlTEPlxdp/iulod tH9r+xvdwOS+3tjx7K8xH4HcuJxOProuThxenBPSWuXXXnGvjxzuQaeskad40CD5 fivRyocGCXYPcJkLuuV1LaIgVPXZt/dlVk8WB9wfRm6YLao/+OMB9v4CW8wtYmSx yK6pQOhsCp+8GuKxXZLlLkVQEPPTBGrX+wBZ/jhB6JcNms2j0i04R1VEnvYK29R6 e/QLKtPW1yaLamdm5axQCqiPMjuHicgn7eMeqTOTgRQUEIeL548DtiNJJ6Hj6P2C OJ6A1HWzgWJAqIkTH0HAXDIcoFzRxXAOrWiCk7rp93tDCOYpG8ankbsMf8MvyCwB iU+okg== 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=w76hs/2bD1CHO+U9xpRM8RUsGzAp3WlHrENinH50O yw=; b=V1LyE9ZvYcCG1Zr6HYu7d25GfodfkBiFp1Jzs62ZpHtaayhOmJbQfxNPu lL3AqnGTODcYoD2EOUsRc0V71JtbgcAHB1kJpVnh193KJTLrcrlj4nn/suicRYrY /8Mt2kEwlM+QAcprmcH1xQCqBn237+2QIe612NJptuDHQclWyG6FXS9MygtHin6T yVlwJ1gYCBfWYbUoE+nwDToue4CfwuG9ZmwnDL9HvLOrucbWkPh9Z2gBuLHQmlZJ kExBQxBOyz0PBnwD4BHVEr5UGm6EkdKKSrVFdVotJ4xByOH24Cj8hKWSsPIlrDP3 XJ3VnYsN8QqbB7WamR4BxMcr/tQQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdeigdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeekteehtdeivefhieegjeelgedufeejheekkeetueevieeuvdevuedt jeevheevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Nov 2021 06:34:19 -0400 (EDT) From: Thomas Monjalon To: Wisam Monther , Rongwei Liu Cc: Matan Azrad , Slava Ovsiienko , Ori Kam , "dev@dpdk.org" , Raslan Darawsheh , Haifei Luo , "Jiawei(Jonny) Wang" Date: Fri, 05 Nov 2021 11:34:18 +0100 Message-ID: <6106963.jHQkdsGB6Q@thomas> In-Reply-To: References: <2507603.9PVMiUTV9K@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 1/3] app/flow-perf: support meter policy API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 05/11/2021 11:24, Rongwei Liu: > HI Tomas: > Flow-perf application run-time options are growing quickly and some of t= hem are a little complex. > Under current architecture, I don't find a valid way to reduce the inden= tion level unless maintainer agree to simply the logic. Trust checkpatch, it is possible. One basic solution is to have sub-functions. Please do not top-post. > For the fill_actions() function, I will rebase it once our github branch= updated. > It should be something like: >=20 > > > + fill_actions(actions[i], all_actions[i], 0, 0, 0, > > > + 0, 0, 0, unique_data, rx_queues_count, dst= _port); >=20 > BR > Rongwei >=20 > > -----Original Message----- > > From: Thomas Monjalon > > Sent: Friday, November 5, 2021 5:58 PM > > To: Wisam Monther ; Rongwei Liu > > > > Cc: Matan Azrad ; Slava Ovsiienko > > ; Ori Kam ; dev@dpdk.org; > > Raslan Darawsheh ; Haifei Luo ; > > Jiawei(Jonny) Wang > > Subject: Re: [dpdk-dev] [PATCH v3 1/3] app/flow-perf: support meter pol= icy > > API > >=20 > > External email: Use caution opening links or attachments > >=20 > >=20 > > 28/10/2021 05:25, Rongwei Liu: > > > @@ -854,6 +862,46 @@ args_parse(int argc, char **argv) > > > RTE_MAX_LCORE); > > > } > > > } > > > + if (strcmp(lgopts[opt_idx].name, "policy-mtr") = =3D=3D 0) { > > > + j =3D 0; > > > + k =3D 0; > > > + arg =3D optarg; > > > + policy_mtr =3D true; > > > + token =3D strsep(&arg, ":\0"); > > > + while (token !=3D NULL && j < RTE_COLOR= S) { > > > + actions_str[j++] =3D token; > > > + token =3D strsep(&arg, ":\0"); > > > + } > > > + j =3D 0; > > > + token =3D strtok(actions_str[0], ",\0"); > > > + while (token =3D=3D NULL && j < RTE_COL= ORS - 1) > > > + token =3D strtok(actions_str[++= j], ",\0"); > > > + while (j < RTE_COLORS && token !=3D NUL= L) { > > > + for (i =3D 0; > > > + i < RTE_DIM(flow_options);= i++) { > > > + if (!strcmp(token, > > > + flow_options[i].str= )) { > > > + all_actions[j][= k++] =3D > > > + flow_options[i]= =2Emask; > > > + break; > > > + } > > > + } > > > + /* Reached last item with no ma= tch */ > > > + if (i >=3D RTE_DIM(flow_options= )) { > > > + fprintf(stderr, > > > + "Invalid action= s " > > > + "item: %s\n", t= oken); > > > + usage(argv[0]); > > > + rte_exit(EXIT_SUCCESS, = "Invalid actions item\n"); > > > + } > > > + token =3D strtok(NULL, ",\0"); > > > + while (!token && j < RTE_COLORS= - 1) { > > > + token =3D strtok(action= s_str[++j], > > > + ",\0"); > > > + k =3D 0; > > > + } > > > + } > > > + } > >=20 > > Could we avoid having so many indents? > > Checkpatch suggest considering a refactoring. > >=20 > > [...] > > > + fill_actions(actions[i], all_actions[i], 0, 0, 0, > > > + 0, 0, 0, unique_data, rx_queues_count); > >=20 > > error: too few arguments to function =E2=80=98fill_actions=E2=80=99 > >=20 > > That's a rebase issue because I merged first the patch > > "app/flow-perf: add destination ports parameter" > >=20 > >=20 >=20 >=20