DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement
@ 2018-05-04 15:17 Adrien Mazarguil
  2018-05-04 15:17 ` [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter Adrien Mazarguil
  2018-05-08  8:04 ` [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Shahaf Shuler
  0 siblings, 2 replies; 4+ messages in thread
From: Adrien Mazarguil @ 2018-05-04 15:17 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Ferruh Yigit, dev, stable

For some unknown reason, priorities do not have any effect on flow rules
that happen to match UDP destination ports. Those are always matched first
regardless.

This patch is a workaround that enforces this limitation at the PMD level;
such flow rules can only be created at the highest priority level for
correctness.

Fixes: a5171594fc3b ("net/mlx4: expose support for flow rule priorities")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4_flow.c | 9 +++++++++
 drivers/net/mlx4/mlx4_flow.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index bebad074e..3f754b480 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -357,6 +357,9 @@ mlx4_flow_merge_ipv4(struct rte_flow *flow,
  * Additional mlx4-specific constraints on supported fields:
  *
  * - No support for partial masks.
+ * - Due to HW/FW limitation, flow rule priority is not taken into account
+ *   when matching UDP destination ports, doing is therefore only supported
+ *   at the highest priority level (0).
  *
  * @param[in, out] flow
  *   Flow rule handle to update.
@@ -388,6 +391,11 @@ mlx4_flow_merge_udp(struct rte_flow *flow,
 		msg = "mlx4 does not support matching partial UDP fields";
 		goto error;
 	}
+	if (mask && mask->hdr.dst_port && flow->priority) {
+		msg = "combining UDP destination port matching with a nonzero"
+			" priority level is not supported";
+		goto error;
+	}
 	if (!flow->ibv_attr)
 		return 0;
 	++flow->ibv_attr->num_of_specs;
@@ -658,6 +666,7 @@ mlx4_flow_prepare(struct priv *priv,
 fill:
 	overlap = 0;
 	proc = mlx4_flow_proc_item_list;
+	flow->priority = attr->priority;
 	/* Go over pattern. */
 	for (item = pattern; item->type; ++item) {
 		const struct mlx4_flow_proc_item *next = NULL;
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index 7b83d74b0..2c8dff362 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -42,6 +42,7 @@ struct rte_flow {
 	uint32_t promisc:1; /**< This rule matches everything. */
 	uint32_t allmulti:1; /**< This rule matches all multicast traffic. */
 	uint32_t drop:1; /**< This rule drops packets. */
+	uint32_t priority; /**< Flow rule priority. */
 	struct mlx4_rss *rss; /**< Rx target. */
 };
 
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter
  2018-05-04 15:17 [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Adrien Mazarguil
@ 2018-05-04 15:17 ` Adrien Mazarguil
  2018-05-10 19:03   ` Ferruh Yigit
  2018-05-08  8:04 ` [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Shahaf Shuler
  1 sibling, 1 reply; 4+ messages in thread
From: Adrien Mazarguil @ 2018-05-04 15:17 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Ferruh Yigit, dev, stable

Since the commit below, mlx4_conv_rss_types() does not need to support
special value -1 anymore. Other functions rely on priv->hw_rss_sup
directly.

Fixes: 1d173da83ef2 ("net/mlx4: fix default RSS hash fields")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4_flow.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 3f754b480..cb3b9a952 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -78,9 +78,6 @@ struct mlx4_drop {
 /**
  * Convert DPDK RSS hash types to their Verbs equivalent.
  *
- * This function returns the supported (default) set when @p types has
- * special value (uint64_t)-1.
- *
  * @param priv
  *   Pointer to private structure.
  * @param types
@@ -125,8 +122,6 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t types)
 	uint64_t conv = 0;
 	unsigned int i;
 
-	if (types == (uint64_t)-1)
-		return priv->hw_rss_sup;
 	for (i = 0; i != RTE_DIM(in); ++i)
 		if (types & in[i]) {
 			seen |= types & in[i];
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement
  2018-05-04 15:17 [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Adrien Mazarguil
  2018-05-04 15:17 ` [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter Adrien Mazarguil
@ 2018-05-08  8:04 ` Shahaf Shuler
  1 sibling, 0 replies; 4+ messages in thread
From: Shahaf Shuler @ 2018-05-08  8:04 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: Ferruh Yigit, dev, stable

Friday, May 4, 2018 6:18 PM, Adrien Mazarguil:
> Subject: [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement
> 
> For some unknown reason, priorities do not have any effect on flow rules
> that happen to match UDP destination ports. Those are always matched first
> regardless.
> 
> This patch is a workaround that enforces this limitation at the PMD level; such
> flow rules can only be created at the highest priority level for correctness.
> 
> Fixes: a5171594fc3b ("net/mlx4: expose support for flow rule priorities")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---

Series applied to next-net-mlx, thanks. 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter
  2018-05-04 15:17 ` [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter Adrien Mazarguil
@ 2018-05-10 19:03   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-05-10 19:03 UTC (permalink / raw)
  To: Adrien Mazarguil, Shahaf Shuler; +Cc: dev, stable

On 5/4/2018 4:17 PM, Adrien Mazarguil wrote:
> Since the commit below, mlx4_conv_rss_types() does not need to support
> special value -1 anymore. Other functions rely on priv->hw_rss_sup
> directly.
> 
> Fixes: 1d173da83ef2 ("net/mlx4: fix default RSS hash fields")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

This patch dropped from next-net as requested by Shahaf. So won't be on rc3.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-10 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 15:17 [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Adrien Mazarguil
2018-05-04 15:17 ` [dpdk-dev] [PATCH 2/2] net/mlx4: fix useless default in RSS converter Adrien Mazarguil
2018-05-10 19:03   ` Ferruh Yigit
2018-05-08  8:04 ` [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement Shahaf Shuler

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).