From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: Moti Haimovsky <motih@mellanox.com>, dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] net/mlx4: fix drop flow resources not freed
Date: Wed, 31 Jan 2018 16:33:06 +0100 [thread overview]
Message-ID: <20180131153141.1289-1-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <1517327640-182072-1-git-send-email-motih@mellanox.com>
Resources allocated for drop flow rules are not freed properly. This causes
a memory leak and triggers an assertion failure on a reference counter when
compiled in debug mode.
This issue can be reproduced with testpmd by entering the following
commands:
flow create 0 ingress pattern eth / end actions drop / end
port start all
port stop all
port start all
port stop all
quit
The reason is additional references are taken when re-enabling existing
flow rules, a common occurrence when rehashing configuration.
Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org
Reported-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4_flow.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 8b6f8a01d..3a195b17a 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -1058,6 +1058,8 @@ mlx4_flow_toggle(struct priv *priv,
flow->drop = missing;
}
if (flow->drop) {
+ if (flow->ibv_flow)
+ return 0;
mlx4_drop_get(priv);
if (!priv->drop) {
err = rte_errno;
--
2.11.0
next prev parent reply other threads:[~2018-01-31 15:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 15:54 [dpdk-stable] [PATCH] " Moti Haimovsky
2018-01-30 16:41 ` Adrien Mazarguil
2018-01-30 17:24 ` Adrien Mazarguil
2018-01-31 15:33 ` Adrien Mazarguil [this message]
2018-02-01 8:40 ` [dpdk-stable] [PATCH v2] " Shahaf Shuler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131153141.1289-1-adrien.mazarguil@6wind.com \
--to=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=motih@mellanox.com \
--cc=shahafs@mellanox.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).