DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow director rules comparison
Date: Thu,  9 Nov 2017 13:43:06 +0100	[thread overview]
Message-ID: <33f03283d9d7c5cadbeb7c6495148e1eb527ac50.1510231343.git.nelio.laranjeiro@6wind.com> (raw)

When deleting/replacing a flow director rule the first rule of the list was
always the one replaced instead of the corresponding one.

Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cd99cb075..3df8fba4e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2914,13 +2914,16 @@ priv_fdir_filter_delete(struct priv *priv,
 			flow_h = flow_spec;
 			if (memcmp(spec, flow_spec,
 				   RTE_MIN(attr_h->size, flow_h->size)))
-				continue;
+				goto wrong_flow;
 			spec = (void *)((uintptr_t)attr + attr_h->size);
 			flow_spec = (void *)((uintptr_t)flow_attr +
 					     flow_h->size);
 		}
 		/* At this point, the flow match. */
 		break;
+wrong_flow:
+		/* The flow does not match. */
+		continue;
 	}
 	if (flow)
 		priv_flow_destroy(priv, &priv->flows, flow);
-- 
2.11.0

             reply	other threads:[~2017-11-09 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 12:43 Nelio Laranjeiro [this message]
2017-11-10  8:37 ` Ferruh Yigit

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=33f03283d9d7c5cadbeb7c6495148e1eb527ac50.1510231343.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@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).