[dpdk-dev,1/2] net/mlx5: fix VLAN validation

Message ID 14d8b56747b084c62ed4ff8b525165282803fd95.1485531240.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 Jan. 27, 2017, 3:35 p.m. UTC
  TCI field is read from the wrong place due to an invalid cast. Moreover
there is no need to limit matching to VID since PCP and DEI bits can be
matched as well.

Fixes: 12475fb203ad ("net/mlx5: support VLAN flow item")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 11 -----------
 1 file changed, 11 deletions(-)
  

Comments

Ferruh Yigit Jan. 27, 2017, 6:06 p.m. UTC | #1
On 1/27/2017 3:35 PM, Nelio Laranjeiro wrote:
> TCI field is read from the wrong place due to an invalid cast. Moreover
> there is no need to limit matching to VID since PCP and DEI bits can be
> matched as well.
> 
> Fixes: 12475fb203ad ("net/mlx5: support VLAN flow item")
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Series applied to dpdk-next-net/master, thanks.

("flow patter" added into both patch subject to limit the scope:
net/mlx5: fix flow pattern validation
net/mlx5: fix flow pattern VLAN validation
)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 7b97a61..d805c0a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -410,17 +410,6 @@  priv_flow_validate(struct priv *priv,
 
 		if (items->type == RTE_FLOW_ITEM_TYPE_VOID)
 			continue;
-		/* Handle special situation for VLAN. */
-		if (items->type == RTE_FLOW_ITEM_TYPE_VLAN) {
-			if (((const struct rte_flow_item_vlan *)items)->tci >
-			    ETHER_MAX_VLAN_ID) {
-				rte_flow_error_set(error, ENOTSUP,
-						   RTE_FLOW_ERROR_TYPE_ITEM,
-						   items,
-						   "wrong VLAN id value");
-				return -rte_errno;
-			}
-		}
 		for (i = 0;
 		     cur_item->items &&
 		     cur_item->items[i] != RTE_FLOW_ITEM_TYPE_END;