net/mlx5: fix VLAN ID matching on switch flow rules

Message ID 20180802092432.19635-1-adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers
Series net/mlx5: fix VLAN ID matching on switch flow rules |

Checks

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

Commit Message

Adrien Mazarguil Aug. 2, 2018, 9:25 a.m. UTC
  VLAN ID is not properly translated to TC due to swapped byte order.

Fixes: fdc4d0f4c7e1 ("net/mlx5: add VLAN item and actions to switch flow rules")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_nl_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Shahaf Shuler Aug. 2, 2018, 12:48 p.m. UTC | #1
Thursday, August 2, 2018 12:25 PM, Adrien Mazarguil:
> Subject: [PATCH] net/mlx5: fix VLAN ID matching on switch flow rules
> 
> VLAN ID is not properly translated to TC due to swapped byte order.
> 
> Fixes: fdc4d0f4c7e1 ("net/mlx5: add VLAN item and actions to switch flow
> rules")
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to next-net-mlx, thank.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_nl_flow.c b/drivers/net/mlx5/mlx5_nl_flow.c
index 9bad1a418..8803ffc32 100644
--- a/drivers/net/mlx5/mlx5_nl_flow.c
+++ b/drivers/net/mlx5/mlx5_nl_flow.c
@@ -662,7 +662,7 @@  mlx5_nl_flow_transpose(void *buf,
 		    (mask.vlan->tci & RTE_BE16(0x0fff) &&
 		     !mnl_attr_put_u16_check
 		     (buf, size, TCA_FLOWER_KEY_VLAN_ID,
-		      spec.vlan->tci & RTE_BE16(0x0fff))))
+		      rte_be_to_cpu_16(spec.vlan->tci & RTE_BE16(0x0fff)))))
 			goto error_nobufs;
 		++item;
 		break;