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 EA087A0A0F for ; Mon, 5 Jul 2021 13:18:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1E9E4003C; Mon, 5 Jul 2021 13:18:12 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id DDF0C4003C for ; Mon, 5 Jul 2021 13:18:11 +0200 (CEST) Received: from mail-qv1-f72.google.com ([209.85.219.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1m0Mc7-0000TW-JE for stable@dpdk.org; Mon, 05 Jul 2021 11:18:11 +0000 Received: by mail-qv1-f72.google.com with SMTP id h7-20020a0ceda70000b02902af042354f1so4994762qvr.9 for ; Mon, 05 Jul 2021 04:18:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EwLxWPvbZZAg2hhHz02oNdnZoJD851BB/cjTUS26eXQ=; b=A/OXF8hdPEePjziFo/1zXex2eLlTNzCdRMXSFwe+VWAWU0ttS7H0MtsxnxwXVSdvTi K/5jPqkk8SCEYYMcWQM0Ny/dl51Fm2ccfI8ngCjNOPZmg76klWVp8+Ge1OftqTJeHWWR aga3FAqzI1/G601rpu45VNR0JKe4Jgudgb8d6AQQCKxQImbnYK+CHJcQ5MufbDdU5XVR Wx5ZKX8Y6ghBH3zGJr4lUWufLkcHCBI6FirmsbikQAu0Rc4KhZU1C8axJ/JIFRRVi8Lk +uDVqho0Ez/u/rkA0WL3s+dgIZ7JyGLLW2dRCPgslOtkVBnWG8vgUpoUSddB2dnXABRM wPcQ== X-Gm-Message-State: AOAM532jPxIYV1dAxDRATWZ1zoKyM6o0s1bj1f03tlo8PxXmQT0eTo/8 6g8eAq4xRzQeomVjRuW8zGAr8LAzZn71kTGSrpN2slihnvUoWI1Q/7zRtgFACEkrs/e/uOMaGVj qVYU5W8hhiDDypSO0NnhLnCpiqQHPimV7h4qUFuad X-Received: by 2002:a37:67cd:: with SMTP id b196mr11958031qkc.418.1625483890796; Mon, 05 Jul 2021 04:18:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx33/XmpmXzeqFdIxhLsRn8+VTsjAjSmB694frjYJrj/VXwxeXa+r3+dURZZbljTJq1VJakWSUXLVmZQcBUcp0= X-Received: by 2002:a37:67cd:: with SMTP id b196mr11958011qkc.418.1625483890592; Mon, 05 Jul 2021 04:18:10 -0700 (PDT) MIME-Version: 1.0 References: <20210705085856.13971-1-viacheslavo@nvidia.com> In-Reply-To: <20210705085856.13971-1-viacheslavo@nvidia.com> From: Christian Ehrhardt Date: Mon, 5 Jul 2021 13:17:44 +0200 Message-ID: To: Viacheslav Ovsiienko Cc: dpdk stable , Xueming Li , Raslan Darawsheh , matan@nvidia.com, Ali Alnubani , Michael Baum , Dekel Peled Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [PATC 19.11] net/mlx5: fix flow split combined with counter X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, Jul 5, 2021 at 10:59 AM Viacheslav Ovsiienko wrote: > > From: Dekel Peled > > [ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ] Thanks, applied > Currently, for a flow containing a count action, if flow is split to > sub-flows, a new counter will be created for each sub-flow. > However only the counter created for the last sub-flow will be queried > on flow query and cleared on flow removal. > > This behavior is wrong, causing a leak of resources. > Need to create just one counter per flow, and use it for all sub-flows. > > This patch adds the required check to make sure a counter is > created just once per flow, and used by all sub-flows. > > Fixes: fa2d01c87d2b ("net/mlx5: support flow aging") > Cc: stable@dpdk.org > > Signed-off-by: Dekel Peled > Acked-by: Matan Azrad > --- > drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index cea45a6d96..42ae1bbe2c 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -7377,12 +7377,13 @@ __flow_dv_translate(struct rte_eth_dev *dev, > rte_errno = ENOTSUP; > goto cnt_err; > } > - flow->counter = flow_dv_counter_alloc(dev, > - count->shared, > - count->id, > - dev_flow->group); > - if (flow->counter == NULL) > - goto cnt_err; > + if (!flow->counter) { > + flow->counter = flow_dv_counter_alloc > + (dev, count->shared, > + count->id, dev_flow->group); > + if (flow->counter == NULL) > + goto cnt_err; > + } > dev_flow->dv.actions[actions_n++] = > flow->counter->action; > action_flags |= MLX5_FLOW_ACTION_COUNT; > -- > 2.18.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd