DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix ipv6 flow pattern item
@ 2017-04-25  8:27 Nelio Laranjeiro
  2017-04-25 10:45 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2017-04-25  8:27 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil

Only masked bits must be set in Verbs specification for a rule to be valid.

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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1784e64..cd3e5da 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -778,6 +778,7 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 	struct mlx5_flow *flow = (struct mlx5_flow *)data;
 	struct ibv_exp_flow_spec_ipv6_ext *ipv6;
 	unsigned int ipv6_size = sizeof(struct ibv_exp_flow_spec_ipv6_ext);
+	unsigned int i;
 
 	++flow->ibv_attr->num_of_specs;
 	flow->ibv_attr->priority = 1;
@@ -803,6 +804,11 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 	ipv6->mask.flow_label = mask->hdr.vtc_flow;
 	ipv6->mask.next_hdr = mask->hdr.proto;
 	ipv6->mask.hop_limit = mask->hdr.hop_limits;
+	/* Remove unwanted bits from values. */
+	for (i = 0; i < RTE_DIM(ipv6->val.src_ip); ++i) {
+		ipv6->val.src_ip[i] &= ipv6->mask.src_ip[i];
+		ipv6->val.dst_ip[i] &= ipv6->mask.dst_ip[i];
+	}
 	ipv6->val.flow_label &= ipv6->mask.flow_label;
 	ipv6->val.next_hdr &= ipv6->mask.next_hdr;
 	ipv6->val.hop_limit &= ipv6->mask.hop_limit;
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix ipv6 flow pattern item
  2017-04-25  8:27 [dpdk-dev] [PATCH] net/mlx5: fix ipv6 flow pattern item Nelio Laranjeiro
@ 2017-04-25 10:45 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-04-25 10:45 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev; +Cc: Adrien Mazarguil

On 4/25/2017 9:27 AM, Nelio Laranjeiro wrote:
> Only masked bits must be set in Verbs specification for a rule to be valid.
> 
> 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>

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

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

end of thread, other threads:[~2017-04-25 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25  8:27 [dpdk-dev] [PATCH] net/mlx5: fix ipv6 flow pattern item Nelio Laranjeiro
2017-04-25 10:45 ` 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).