From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH] net/mlx4: fix drop flow resources not freed Date: Tue, 30 Jan 2018 18:24:19 +0100 Message-ID: <20180130172419.GQ4256@6wind.com> References: <1517327640-182072-1-git-send-email-motih@mellanox.com> <20180130164107.GP4256@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, stable@dpdk.org To: Moti Haimovsky Return-path: Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 09F261B6A3 for ; Tue, 30 Jan 2018 18:24:33 +0100 (CET) Received: by mail-wr0-f170.google.com with SMTP id a43so4464140wrc.4 for ; Tue, 30 Jan 2018 09:24:33 -0800 (PST) Content-Disposition: inline In-Reply-To: <20180130164107.GP4256@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jan 30, 2018 at 05:41:07PM +0100, Adrien Mazarguil wrote: > Hi Moti, > > On Tue, Jan 30, 2018 at 05:54:00PM +0200, Moti Haimovsky wrote: > > This patch fixes the drop-flow resources not being freed when the device > > is closed. > > Issue can be observed when running testpmd and adding the following rule > > more than once: > > "flow create 0 ingress pattern eth / end actions drop / end" > > then either exiting testpmd using the "quit" command or by running the > > command: "port stop all" > > > > Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand") > > Cc: stable@dpdk.org > > > > Signed-off-by: Moti Haimovsky > > Thanks for investigating this problem, however I do not think the proposed > patch uses the right approach to address it, more below. > We need to find out why we do not end up with a number of mlx5_drop_put() > calls matching that of mlx5_drop_get(). One is likely missing somewhere. > I'll have a look as well. After investigation, the following change in mlx4_flow_toggle() should do the trick: if (flow->drop) { + if (flow->ibv_flow) + return 0; mlx4_drop_get(priv); Without this, an already-enabled drop flow rule takes another reference when re-enabled, hence the issue. I can send a fix tomorrow. -- Adrien Mazarguil 6WIND