DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks
@ 2017-01-31 16:02 Nelio Laranjeiro
  2017-01-31 16:02 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action Nelio Laranjeiro
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-01-31 16:02 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil

Default masks were introduced in the API after its implementation in this
PMD.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 42a12e8..4917f79 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -164,6 +164,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 			.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 			.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 		},
+		.default_mask = &rte_flow_item_eth_mask,
 		.mask_sz = sizeof(struct rte_flow_item_eth),
 		.convert = mlx5_flow_create_eth,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_eth),
@@ -175,6 +176,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 		.mask = &(const struct rte_flow_item_vlan){
 			.tci = -1,
 		},
+		.default_mask = &rte_flow_item_vlan_mask,
 		.mask_sz = sizeof(struct rte_flow_item_vlan),
 		.convert = mlx5_flow_create_vlan,
 		.dst_sz = 0,
@@ -191,12 +193,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 				.next_proto_id = -1,
 			},
 		},
-		.default_mask = &(const struct rte_flow_item_ipv4){
-			.hdr = {
-				.src_addr = -1,
-				.dst_addr = -1,
-			},
-		},
+		.default_mask = &rte_flow_item_ipv4_mask,
 		.mask_sz = sizeof(struct rte_flow_item_ipv4),
 		.convert = mlx5_flow_create_ipv4,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_ipv4_ext),
@@ -221,6 +218,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 				},
 			},
 		},
+		.default_mask = &rte_flow_item_ipv6_mask,
 		.mask_sz = sizeof(struct rte_flow_item_ipv6),
 		.convert = mlx5_flow_create_ipv6,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_ipv6),
@@ -234,6 +232,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 				.dst_port = -1,
 			},
 		},
+		.default_mask = &rte_flow_item_udp_mask,
 		.mask_sz = sizeof(struct rte_flow_item_udp),
 		.convert = mlx5_flow_create_udp,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_tcp_udp),
@@ -246,6 +245,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 				.dst_port = -1,
 			},
 		},
+		.default_mask = &rte_flow_item_tcp_mask,
 		.mask_sz = sizeof(struct rte_flow_item_tcp),
 		.convert = mlx5_flow_create_tcp,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_tcp_udp),
@@ -256,6 +256,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 		.mask = &(const struct rte_flow_item_vxlan){
 			.vni = "\xff\xff\xff",
 		},
+		.default_mask = &rte_flow_item_vxlan_mask,
 		.mask_sz = sizeof(struct rte_flow_item_vxlan),
 		.convert = mlx5_flow_create_vxlan,
 		.dst_sz = sizeof(struct ibv_exp_flow_spec_tunnel),
-- 
2.1.4

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

* [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action
  2017-01-31 16:02 [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Nelio Laranjeiro
@ 2017-01-31 16:02 ` Nelio Laranjeiro
  2017-01-31 16:02 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped Nelio Laranjeiro
  2017-02-01 11:04 ` [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-01-31 16:02 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil

A configuration structure for the MARK action must always be specified.

Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4917f79..34ac5d3 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -457,7 +457,13 @@ priv_flow_validate(struct priv *priv,
 				(const struct rte_flow_action_mark *)
 				actions->conf;
 
-			if (mark && (mark->id >= MLX5_FLOW_MARK_MAX)) {
+			if (!mark) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ACTION,
+						   actions,
+						   "mark must be defined");
+				return -rte_errno;
+			} else if (mark->id >= MLX5_FLOW_MARK_MAX) {
 				rte_flow_error_set(error, ENOTSUP,
 						   RTE_FLOW_ERROR_TYPE_ACTION,
 						   actions,
-- 
2.1.4

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

* [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped
  2017-01-31 16:02 [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Nelio Laranjeiro
  2017-01-31 16:02 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action Nelio Laranjeiro
@ 2017-01-31 16:02 ` Nelio Laranjeiro
  2017-02-01 11:04 ` [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-01-31 16:02 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil

Adding a flow when the port is stopped ends in an inconsistent situation
where the queue can receive traffic when it should not.
Record new rules and apply them as soon as the port is started.

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

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 34ac5d3..23c1b5e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -948,6 +948,8 @@ priv_flow_create_action_queue(struct priv *priv,
 				   NULL, "cannot allocate QP");
 		goto error;
 	}
+	if (!priv->started)
+		return rte_flow;
 	rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp,
 						 rte_flow->ibv_attr);
 	if (!rte_flow->ibv_flow) {
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks
  2017-01-31 16:02 [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Nelio Laranjeiro
  2017-01-31 16:02 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action Nelio Laranjeiro
  2017-01-31 16:02 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped Nelio Laranjeiro
@ 2017-02-01 11:04 ` Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-02-01 11:04 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev; +Cc: Adrien Mazarguil

On 1/31/2017 4:02 PM, Nelio Laranjeiro wrote:
> Default masks were introduced in the API after its implementation in this
> PMD.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

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

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

end of thread, other threads:[~2017-02-01 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-31 16:02 [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Nelio Laranjeiro
2017-01-31 16:02 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix verification of mark action Nelio Laranjeiro
2017-01-31 16:02 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix flow rule creation if ports are stopped Nelio Laranjeiro
2017-02-01 11:04 ` [dpdk-dev] [PATCH 1/3] net/mlx5: use flow API default masks Ferruh Yigit

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