All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5: fix VLAN validation
@ 2017-01-27 15:35 Nelio Laranjeiro
  2017-01-27 15:35 ` [PATCH 2/2] net/mlx5: fix validation Nelio Laranjeiro
  2017-01-27 18:06 ` [PATCH 1/2] net/mlx5: fix VLAN validation Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Nelio Laranjeiro @ 2017-01-27 15:35 UTC (permalink / raw)
  To: dev; +Cc: adrien.mazarguil

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

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;
-- 
2.1.4

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

* [PATCH 2/2] net/mlx5: fix validation
  2017-01-27 15:35 [PATCH 1/2] net/mlx5: fix VLAN validation Nelio Laranjeiro
@ 2017-01-27 15:35 ` Nelio Laranjeiro
  2017-01-27 18:06 ` [PATCH 1/2] net/mlx5: fix VLAN validation Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Nelio Laranjeiro @ 2017-01-27 15:35 UTC (permalink / raw)
  To: dev; +Cc: adrien.mazarguil

Size of the mask is wrongly computed and make the validation process only
verify the first 4 bytes of the layer.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index d805c0a..42a12e8 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -424,7 +424,7 @@ priv_flow_validate(struct priv *priv,
 		cur_item = token;
 		err = mlx5_flow_item_validate(items,
 					      (const uint8_t *)cur_item->mask,
-					      sizeof(cur_item->mask_sz));
+					      cur_item->mask_sz);
 		if (err)
 			goto exit_item_not_supported;
 		if (flow->ibv_attr && cur_item->convert) {
-- 
2.1.4

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

* Re: [PATCH 1/2] net/mlx5: fix VLAN validation
  2017-01-27 15:35 [PATCH 1/2] net/mlx5: fix VLAN validation Nelio Laranjeiro
  2017-01-27 15:35 ` [PATCH 2/2] net/mlx5: fix validation Nelio Laranjeiro
@ 2017-01-27 18:06 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-01-27 18:06 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev; +Cc: adrien.mazarguil

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
)

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

end of thread, other threads:[~2017-01-27 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 15:35 [PATCH 1/2] net/mlx5: fix VLAN validation Nelio Laranjeiro
2017-01-27 15:35 ` [PATCH 2/2] net/mlx5: fix validation Nelio Laranjeiro
2017-01-27 18:06 ` [PATCH 1/2] net/mlx5: fix VLAN validation Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.