X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow.c;h=bf8eff8a5004975fcada1a1e545593c2be2335c1;hb=3669a1af893088064778f14fba0c2ca88819e095;hp=4396ea8524bc5049a6c82ef600cfd3c68b9b408a;hpb=e8aafd9405b9f1da345abd2d5ff0d7aabc1ce6f3;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 4396ea8524..bf8eff8a50 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -44,7 +44,7 @@ #pragma GCC diagnostic error "-Wpedantic" #endif -#include +#include #include #include #include @@ -353,6 +353,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = { .dst_addr = -1, .type_of_service = -1, .next_proto_id = -1, + .time_to_live = -1, }, }, .default_mask = &rte_flow_item_ipv4_mask, @@ -529,7 +530,7 @@ mlx5_flow_item_validate(const struct rte_flow_item *item, } if (item->mask) { unsigned int i; - const uint8_t *spec = item->mask; + const uint8_t *spec = item->spec; for (i = 0; i < size; ++i) if ((spec[i] | mask[i]) != mask[i]) @@ -1168,16 +1169,6 @@ priv_flow_convert(struct priv *priv, attr->priority + hash_rxq_init[parser->layer].flow_priority; } -exit_free: - /* Only verification is expected, all resources should be released. */ - if (!parser->create) { - for (i = 0; i != hash_rxq_init_n; ++i) { - if (parser->queue[i].ibv_attr) { - rte_free(parser->queue[i].ibv_attr); - parser->queue[i].ibv_attr = NULL; - } - } - } if (parser->allmulti && parser->layer == HASH_RXQ_ETH) { for (i = 0; i != hash_rxq_init_n; ++i) { @@ -1189,6 +1180,16 @@ exit_free: IBV_FLOW_ATTR_MC_DEFAULT; } } +exit_free: + /* Only verification is expected, all resources should be released. */ + if (!parser->create) { + for (i = 0; i != hash_rxq_init_n; ++i) { + if (parser->queue[i].ibv_attr) { + rte_free(parser->queue[i].ibv_attr); + parser->queue[i].ibv_attr = NULL; + } + } + } return ret; exit_enomem: for (i = 0; i != hash_rxq_init_n; ++i) { @@ -2656,10 +2657,12 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV4, .spec = &attributes->l3, + .mask = &attributes->l3, }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_UDP, .spec = &attributes->l4, + .mask = &attributes->l4, }; break; case RTE_ETH_FLOW_NONFRAG_IPV4_TCP: @@ -2677,10 +2680,12 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV4, .spec = &attributes->l3, + .mask = &attributes->l3, }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_TCP, .spec = &attributes->l4, + .mask = &attributes->l4, }; break; case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: @@ -2694,6 +2699,7 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV4, .spec = &attributes->l3, + .mask = &attributes->l3, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: @@ -2714,10 +2720,12 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV6, .spec = &attributes->l3, + .mask = &attributes->l3, }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_UDP, .spec = &attributes->l4, + .mask = &attributes->l4, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: @@ -2738,10 +2746,12 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV6, .spec = &attributes->l3, + .mask = &attributes->l3, }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_TCP, .spec = &attributes->l4, + .mask = &attributes->l4, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: @@ -2758,6 +2768,7 @@ priv_fdir_filter_convert(struct priv *priv, attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV6, .spec = &attributes->l3, + .mask = &attributes->l3, }; break; default: