X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow.c;h=bf718f8947d64243079d701b5f00925996ba9ee5;hb=c2fec27b5cb0141496623dd7e5eb4a08b1aacdec;hp=323dab7233dca16522f639507964e3b752c78e21;hpb=c0ff2fb81464a1bbb1a4e0fa1614c1d11e0ebbf4;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 323dab7233..bf718f8947 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -912,6 +912,16 @@ priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser) unsigned int i; (void)priv; + /* Remove any other flow not matching the pattern. */ + if (parser->queues_n == 1) { + for (i = 0; i != hash_rxq_init_n; ++i) { + if (i == HASH_RXQ_ETH) + continue; + rte_free(parser->queue[i].ibv_attr); + parser->queue[i].ibv_attr = NULL; + } + return; + } if (parser->layer == HASH_RXQ_ETH) { goto fill; } else { @@ -1758,6 +1768,7 @@ priv_flow_create_action_queue(struct priv *priv, { int err = 0; unsigned int i; + unsigned int flows_n = 0; assert(priv->pd); assert(priv->ctx); @@ -1782,11 +1793,17 @@ priv_flow_create_action_queue(struct priv *priv, err = ENOMEM; goto error; } + ++flows_n; DEBUG("%p type %d QP %p ibv_flow %p", (void *)flow, i, (void *)flow->frxq[i].hrxq, (void *)flow->frxq[i].ibv_flow); } + if (!flows_n) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, "internal error in flow creation"); + goto error; + } for (i = 0; i != parser->queues_n; ++i) { struct mlx5_rxq_data *q = (*priv->rxqs)[parser->queues[i]]; @@ -1881,6 +1898,7 @@ priv_flow_create(struct priv *priv, DEBUG("Flow created %p", (void *)flow); return flow; exit: + ERROR("flow creation error: %s", error->message); for (i = 0; i != hash_rxq_init_n; ++i) { if (parser.queue[i].ibv_attr) rte_free(parser.queue[i].ibv_attr);