From mboxrd@z Thu Jan 1 00:00:00 1970 From: Slava Ovsiienko Subject: Re: [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic Date: Sat, 29 Dec 2018 20:12:42 +0000 Message-ID: References: <1545748697-3385-4-git-send-email-motih@mellanox.com> <1545949196-3355-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 , "stable@dpdk.org" To: Mordechay Haimovsky , "dev@dpdk.org" Return-path: In-Reply-To: <1545949196-3355-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" Moti, don't you forget to update flow_verbs_counter_release() ? Only shared counters should be removed from the list. WBR, Slava > -----Original Message----- > From: dev On Behalf Of Mordechay Haimovsky > Sent: Friday, December 28, 2018 0:20 > To: dev@dpdk.org > Cc: Mordechay Haimovsky ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocatio= n > logic >=20 > This commit fixes the logic for searching and allocating a shared counter= in > mlx5_flow_verbs. > Now only the shared counters in the counters list are checked for a match > and not all the counters as before. >=20 > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > Cc: stable@dpdk.org >=20 > Signed-off-by: Moti Haimovsky > --- > v2: > * Modified commit header > --- > 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