From: NĂ©lio Laranjeiro Date: Fri, 27 Oct 2017 06:50:00 +0000 (+0200) Subject: net/mlx5: fix flow director matching rules X-Git-Tag: spdx-start~981 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0eefd129b9d4926912a9051c593d90b5e4feaae5;p=dpdk.git net/mlx5: fix flow director matching rules Flow director API does not provide a layer 2 configuration when the filter is for layer 3 and 4 causing the translation to generic flow API to be wrong, as not providing a mask for layer ends by using the default one. In this case, the Ethernet mask layer is full whereas it must be empty. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 57544de9a7..1ea9d685fe 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -479,6 +479,7 @@ struct mlx5_fdir { struct rte_flow_action actions[2]; struct rte_flow_item items[4]; struct rte_flow_item_eth l2; + struct rte_flow_item_eth l2_mask; union { struct rte_flow_item_ipv4 ipv4; struct rte_flow_item_ipv6 ipv6; @@ -2624,6 +2625,7 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[0] = (struct rte_flow_item) { .type = RTE_FLOW_ITEM_TYPE_ETH, .spec = &attributes->l2, + .mask = &attributes->l2_mask, }; switch (fdir_filter->action.behavior) { case RTE_ETH_FDIR_ACCEPT: @@ -2787,6 +2789,11 @@ priv_fdir_filter_add(struct priv *priv, { struct mlx5_fdir attributes = { .attr.group = 0, + .l2_mask = { + .dst.addr_bytes = "\x00\x00\x00\x00\x00\x00", + .src.addr_bytes = "\x00\x00\x00\x00\x00\x00", + .type = 0, + }, }; struct mlx5_flow_parse parser = { .layer = HASH_RXQ_ETH,