DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com,
	yskoh@mellanox.com
Cc: dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow director drop rule deletion crash
Date: Wed,  9 May 2018 10:37:00 +0300	[thread overview]
Message-ID: <20180509073700.11627-1-shahafs@mellanox.com> (raw)

Drop flow rules are created on the ETH queue even though the parser layer
matches the flow rule layer (L3/L4)

Fixes: 6f2f4948b236 ("net/mlx5: fix flow director rule deletion crash")
Cc: stable@dpdk.org
Cc: adrien.mazarguil@6wind.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 38811bbcec..ebc6754eeb 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -3382,6 +3382,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev,
 	if (parser.drop) {
 		struct ibv_flow_spec_action_drop *drop;
 
+		/* Drop rules are created on the ETH queue. */
+		parser.layer = HASH_RXQ_ETH;
 		drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr +
 				parser.queue[parser.layer].offset);
 		*drop = (struct ibv_flow_spec_action_drop){
@@ -3401,6 +3403,9 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev,
 
 		attr = parser.queue[parser.layer].ibv_attr;
 		flow_attr = flow->frxq[parser.layer].ibv_attr;
+		/* Matching flows must have ibv context on the same queue. */
+		if (!flow_attr)
+			continue;
 		/* Compare first the attributes. */
 		if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr)))
 			continue;
-- 
2.12.0

             reply	other threads:[~2018-05-09  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09  7:37 Shahaf Shuler [this message]
2018-05-15  6:26 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
2018-05-15  7:26   ` Adrien Mazarguil
2018-05-15  7:42     ` 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=20180509073700.11627-1-shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /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).