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: sta...@dpdk.org > > > > Signed-off-by: Moti Haimovsky <mo...@mellanox.com> > > Thanks for investigating this problem, however I do not think the proposed > patch uses the right approach to address it, more below. <snip> > 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