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 2/3] net/mlx5: fix verification of mark action
Date: Tue, 31 Jan 2017 17:02:47 +0100	[thread overview]
Message-ID: <6781e89c0572de09a4c8b029d45168296d818a93.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>

A configuration structure for the MARK action must always be specified.

Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action")

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4917f79..34ac5d3 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -457,7 +457,13 @@ priv_flow_validate(struct priv *priv,
 				(const struct rte_flow_action_mark *)
 				actions->conf;
 
-			if (mark && (mark->id >= MLX5_FLOW_MARK_MAX)) {
+			if (!mark) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ACTION,
+						   actions,
+						   "mark must be defined");
+				return -rte_errno;
+			} else if (mark->id >= MLX5_FLOW_MARK_MAX) {
 				rte_flow_error_set(error, ENOTSUP,
 						   RTE_FLOW_ERROR_TYPE_ACTION,
 						   actions,
-- 
2.1.4

  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 ` Nelio Laranjeiro [this message]
2017-01-31 16:02 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped Nelio Laranjeiro
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=6781e89c0572de09a4c8b029d45168296d818a93.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).