DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped
Date: Tue, 31 Jan 2017 17:02:48 +0100	[thread overview]
Message-ID: <1b5005cdb2cfe9bc160dc4d61a717db42e7c70bd.1485878361.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <8772a5838ed3733da6749b333375e2a6aa6ea2ad.1485878361.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <8772a5838ed3733da6749b333375e2a6aa6ea2ad.1485878361.git.nelio.laranjeiro@6wind.com>

Adding a flow when the port is stopped ends in an inconsistent situation
where the queue can receive traffic when it should not.
Record new rules and apply them as soon as the port is started.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 34ac5d3..23c1b5e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -948,6 +948,8 @@ priv_flow_create_action_queue(struct priv *priv,
 				   NULL, "cannot allocate QP");
 		goto error;
 	}
+	if (!priv->started)
+		return rte_flow;
 	rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp,
 						 rte_flow->ibv_attr);
 	if (!rte_flow->ibv_flow) {
-- 
2.1.4

  parent reply	other threads:[~2017-01-31 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 16:02 [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Nelio Laranjeiro
2017-01-31 16:02 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action Nelio Laranjeiro
2017-01-31 16:02 ` Nelio Laranjeiro [this message]
2017-02-01 11:04 ` [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks 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=1b5005cdb2cfe9bc160dc4d61a717db42e7c70bd.1485878361.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@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).