From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shahaf Shuler Subject: Re: [PATCH v1 1/3] net/mlx5: modify shared counter allocation logic Date: Thu, 27 Dec 2018 08:12:53 +0000 Message-ID: References: <1545748697-3385-1-git-send-email-motih@mellanox.com> <1545748697-3385-2-git-send-email-motih@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Mordechay Haimovsky To: Mordechay Haimovsky , "dev@dpdk.org" Return-path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20046.outbound.protection.outlook.com [40.107.2.46]) by dpdk.org (Postfix) with ESMTP id 9204C2BF7 for ; Thu, 27 Dec 2018 09:12:55 +0100 (CET) In-Reply-To: <1545748697-3385-2-git-send-email-motih@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Tuesday, December 25, 2018 4:39 PM, Mordechay Haimovsky: > Subject: [dpdk-dev] [PATCH v1 1/3] net/mlx5: modify shared counter alloca= tion > logic >=20 > This commit modifies the logic for searching an allocating a shared count= er in > mlx5_flow_verbs. Need to explain - why you change it? I assume it is because only shared counters need to be search on the PMD da= tabase, correct? >=20 > modifies commit 84c406e74524 ("net/mlx5: add flow translate function") If above correct, better to introduce it as fix commit w/ Cc: stable@dpdk.o= rg >=20 > Signed-off-by: Moti Haimovsky > --- > drivers/net/mlx5/mlx5_flow_verbs.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index 81ec59d..409e1cd 100644 > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > @@ -121,13 +121,13 @@ > struct mlx5_flow_counter *cnt; > int ret; >=20 > - LIST_FOREACH(cnt, &priv->flow_counters, next) { > - if (!cnt->shared || cnt->shared !=3D shared) > - continue; > - if (cnt->id !=3D id) > - continue; > - cnt->ref_cnt++; > - return cnt; > + if (shared) { > + LIST_FOREACH(cnt, &priv->flow_counters, next) { > + if (cnt->shared && cnt->id =3D=3D id) { > + cnt->ref_cnt++; > + return cnt; > + } > + } > } > cnt =3D rte_calloc(__func__, 1, sizeof(*cnt), 0); > if (!cnt) { > -- > 1.8.3.1