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");
* 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
};
++parser->drop_q.ibv_attr->num_of_specs;
parser->drop_q.offset += size;
+ flow->drxq.ibv_attr = parser->drop_q.ibv_attr;
if (!priv->dev->data->dev_started)
return 0;
- flow->drxq.ibv_attr = parser->drop_q.ibv_attr;
parser->drop_q.ibv_attr = NULL;
flow->drxq.ibv_flow = ibv_create_flow(priv->flow_drop_queue->qp,
flow->drxq.ibv_attr);
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:
attributes.actions,
&error);
if (flow) {
- TAILQ_INSERT_TAIL(&priv->flows, flow, next);
DEBUG("FDIR created %p", (void *)flow);
return 0;
}