[dpdk-dev,v2] net/mlx5: fix adjust priority for drop queue

Message ID 5156fd25083e0489e1e3da5d412579ce9a123e0f.1508919813.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nélio Laranjeiro Oct. 25, 2017, 8:25 a.m. UTC
  Drop queue should also adjust their priority according the most specific
layer in the pattern they are matching to avoid dropping all the traffic.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

---

Changes in v2:

 * Reorder the if, else if, else statement to improve readability
---
 drivers/net/mlx5/mlx5_flow.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
  

Comments

Yongseok Koh Oct. 25, 2017, 4:41 p.m. UTC | #1
> On Oct 25, 2017, at 1:25 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com> wrote:
> 
> Drop queue should also adjust their priority according the most specific
> layer in the pattern they are matching to avoid dropping all the traffic.
> 
> Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> ---
> 
> Changes in v2:
> 
> * Reorder the if, else if, else statement to improve readability
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks
  
Ferruh Yigit Oct. 25, 2017, 9:45 p.m. UTC | #2
On 10/25/2017 9:41 AM, Yongseok Koh wrote:
> 
>> On Oct 25, 2017, at 1:25 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com> wrote:
>>
>> Drop queue should also adjust their priority according the most specific
>> layer in the pattern they are matching to avoid dropping all the traffic.
>>
>> Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
>>
>> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 26cf593af..f392f1f65 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1174,9 +1174,17 @@  priv_flow_convert(struct priv *priv,
 	 * Last step. Complete missing specification to reach the RSS
 	 * configuration.
 	 */
-	if (parser->queues_n > 1) {
+	if (parser->drop) {
+		/*
+		 * Drop queue priority needs to be adjusted to
+		 * their most specific layer priority.
+		 */
+		parser->drop_q.ibv_attr->priority =
+			attr->priority +
+			hash_rxq_init[parser->layer].flow_priority;
+	} else if (parser->queues_n > 1) {
 		priv_flow_convert_finalise(priv, parser);
-	} else if (!parser->drop) {
+	} else {
 		/*
 		 * Action queue have their priority overridden with
 		 * Ethernet priority, this priority needs to be adjusted to