DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Shahaf Shuler <shahafs@mellanox.com>
Subject: [dpdk-dev] [PATCH v3 02/11] net/mlx4: fix ignored RSS hash types
Date: Fri, 6 Apr 2018 15:22:36 +0200	[thread overview]
Message-ID: <20180406131243.19037-3-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <20180406131243.19037-1-adrien.mazarguil@6wind.com>

When an unsupported hash type is part of a RSS configuration structure, it
is silently ignored instead of triggering an error. This may lead
applications to assume that such types are accepted, while they are in fact
not part of the resulting flow rules.

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx4/mlx4_flow.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index a3b4480b4..4d26df326 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -706,6 +706,7 @@ mlx4_flow_prepare(struct priv *priv,
 			const struct rte_flow_action_queue *queue;
 			const struct rte_flow_action_rss *rss;
 			const struct rte_eth_rss_conf *rss_conf;
+			uint64_t fields;
 			unsigned int i;
 
 		case RTE_FLOW_ACTION_TYPE_VOID:
@@ -780,10 +781,15 @@ mlx4_flow_prepare(struct priv *priv,
 					" of the context size";
 				goto exit_action_not_supported;
 			}
+			rte_errno = 0;
+			fields = mlx4_conv_rss_hf(priv, rss_conf->rss_hf);
+			if (fields == (uint64_t)-1 && rte_errno) {
+				msg = "unsupported RSS hash type requested";
+				goto exit_action_not_supported;
+			}
 			flow->rss = mlx4_rss_get
-				(priv,
-				 mlx4_conv_rss_hf(priv, rss_conf->rss_hf),
-				 rss_conf->rss_key, rss->num, rss->queue);
+				(priv, fields, rss_conf->rss_key, rss->num,
+				 rss->queue);
 			if (!flow->rss) {
 				msg = "either invalid parameters or not enough"
 					" resources for additional multi-queue"
-- 
2.11.0

  parent reply	other threads:[~2018-04-06 13:22 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 12:58 [dpdk-dev] [PATCH v1 0/9] Bunch of flow API-related fixes Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 1/9] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 2/9] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 3/9] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 4/9] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 5/9] app/testpmd: fix RSS " Adrien Mazarguil
2018-05-07  6:53   ` Zhao1, Wei
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 6/9] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 7/9] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 8/9] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-dev] [PATCH v1 9/9] ethdev: fix ABI version in meson build Adrien Mazarguil
2018-04-04 14:57 ` [dpdk-dev] [PATCH v2 00/13] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 01/13] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 02/13] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 03/13] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-05  6:57     ` Nélio Laranjeiro
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 04/13] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 05/13] net/sfc: fix endian conversions in flow API Adrien Mazarguil
2018-04-04 15:30     ` Andrew Rybchenko
2018-04-04 16:08       ` Adrien Mazarguil
2018-04-05 15:10         ` Andrew Rybchenko
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 06/13] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 07/13] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-05  6:59     ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:57   ` [dpdk-dev] [PATCH v2 08/13] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-05  7:39     ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [dpdk-dev] [PATCH v2 09/13] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-05  8:15     ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [dpdk-dev] [PATCH v2 10/13] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-04 14:58   ` [dpdk-dev] [PATCH v2 11/13] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-05  8:17     ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-04 14:58   ` [dpdk-dev] [PATCH v2 12/13] ethdev: fix ABI version in meson build Adrien Mazarguil
2018-04-04 14:58   ` [dpdk-dev] [PATCH v2 13/13] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-05  8:18     ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-06 13:22   ` [dpdk-dev] [PATCH v3 00/11] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-06 13:22     ` Adrien Mazarguil [this message]
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-06 13:22     ` [dpdk-dev] [PATCH v3 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-10 16:34     ` [dpdk-dev] [PATCH v4 00/11] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-10 16:34       ` [dpdk-dev] [PATCH v4 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-16 16:21       ` [dpdk-dev] [PATCH v5 00/11] Bunch of flow API-related fixes Adrien Mazarguil
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-17  9:19           ` Nélio Laranjeiro
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-17  9:20           ` Nélio Laranjeiro
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-16 16:21         ` [dpdk-dev] [PATCH v5 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-16 16:22         ` [dpdk-dev] [PATCH v5 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-16 16:22         ` [dpdk-dev] [PATCH v5 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-17  9:18           ` [dpdk-dev] [dpdk-stable] " Nélio Laranjeiro
2018-04-16 16:22         ` [dpdk-dev] [PATCH v5 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-16 19:17           ` Matan Azrad
2018-04-17  8:25             ` Adrien Mazarguil
2018-04-18 17:16               ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-04-19 10:18                 ` Adrien Mazarguil
2018-04-16 16:22         ` [dpdk-dev] [PATCH v5 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-17  9:17         ` [dpdk-dev] [PATCH v5 00/11] Bunch of flow API-related fixes Ferruh Yigit
2018-04-19 10:07         ` [dpdk-dev] [PATCH v6 " Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-05-07  5:23             ` Peng, Yuan
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 09/11] app/testpmd: fix missing boolean values in flow command Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 10/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-19 10:07           ` [dpdk-dev] [PATCH v6 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-19 14:03           ` [dpdk-dev] [PATCH v6 00/11] Bunch of flow API-related fixes Ferruh Yigit
2018-04-19 14:07             ` 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=20180406131243.19037-3-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --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).