X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow.c;h=f392f1f657143c7b547e5910622f0c6adaaa156f;hb=d04fc01de2298e2b7e405f499a919d1bd4d551f1;hp=6f458f44a07c6b9ffbd79dbaec24305e4ea8b73a;hpb=79b0fb70965e98c32e6071a89c82b4270f5668a8;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6f458f44a0..f392f1f657 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -786,6 +786,8 @@ priv_flow_convert_actions(struct priv *priv, goto exit_action_not_supported; } } + if (parser->drop && parser->mark) + parser->mark = 0; if (!parser->queues_n && !parser->drop) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "no valid action"); @@ -1172,9 +1174,17 @@ priv_flow_convert(struct priv *priv, * Last step. Complete missing specification to reach the RSS * configuration. */ - if (parser->queues_n > 1) { + if (parser->drop) { + /* + * Drop queue priority needs to be adjusted to + * their most specific layer priority. + */ + parser->drop_q.ibv_attr->priority = + attr->priority + + hash_rxq_init[parser->layer].flow_priority; + } else if (parser->queues_n > 1) { priv_flow_convert_finalise(priv, parser); - } else if (!parser->drop) { + } else { /* * Action queue have their priority overridden with * Ethernet priority, this priority needs to be adjusted to @@ -2601,20 +2611,27 @@ priv_fdir_filter_convert(struct priv *priv, ERROR("invalid queue number %d", fdir_filter->action.rx_queue); return EINVAL; } - /* Validate the behavior. */ - if (fdir_filter->action.behavior != RTE_ETH_FDIR_ACCEPT) { - ERROR("invalid behavior %d", fdir_filter->action.behavior); - return ENOTSUP; - } attributes->attr.ingress = 1; attributes->items[0] = (struct rte_flow_item) { .type = RTE_FLOW_ITEM_TYPE_ETH, .spec = &attributes->l2, }; - attributes->actions[0] = (struct rte_flow_action){ - .type = RTE_FLOW_ACTION_TYPE_QUEUE, - .conf = &attributes->queue, - }; + switch (fdir_filter->action.behavior) { + case RTE_ETH_FDIR_ACCEPT: + attributes->actions[0] = (struct rte_flow_action){ + .type = RTE_FLOW_ACTION_TYPE_QUEUE, + .conf = &attributes->queue, + }; + break; + case RTE_ETH_FDIR_REJECT: + attributes->actions[0] = (struct rte_flow_action){ + .type = RTE_FLOW_ACTION_TYPE_DROP, + }; + break; + default: + ERROR("invalid behavior %d", fdir_filter->action.behavior); + return ENOTSUP; + } attributes->queue.index = fdir_filter->action.rx_queue; switch (fdir_filter->input.flow_type) { case RTE_ETH_FLOW_NONFRAG_IPV4_UDP: @@ -2783,7 +2800,6 @@ priv_fdir_filter_add(struct priv *priv, attributes.actions, &error); if (flow) { - TAILQ_INSERT_TAIL(&priv->flows, flow, next); DEBUG("FDIR created %p", (void *)flow); return 0; }