RTE_FLOW_ACTION_TYPE_DROP,
RTE_FLOW_ACTION_TYPE_QUEUE,
RTE_FLOW_ACTION_TYPE_MARK,
+ RTE_FLOW_ACTION_TYPE_FLAG,
RTE_FLOW_ACTION_TYPE_END,
};
return -rte_errno;
}
action.mark = 1;
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_FLAG) {
+ action.mark = 1;
} else {
goto exit_action_not_supported;
}
if (mark)
action.mark_id = mark->id;
action.mark = !action.drop;
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_FLAG) {
+ action.mark = 1;
} else {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION,
/*
* Add one to the user value to differentiate un-marked flows from
- * marked flows.
+ * marked flows, if the ID is equal to MLX5_FLOW_MARK_DEFAULT it
+ * remains untouched.
*/
- ++val;
+ if (val != MLX5_FLOW_MARK_DEFAULT)
+ ++val;
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
/*
* Mark is 24 bits (minus reserved values) but is stored on a 32 bit
#else
ret = val;
#endif
- assert(ret <= MLX5_FLOW_MARK_MAX);
return ret;
}
pkt->hash.rss = rss_hash_res;
pkt->ol_flags = PKT_RX_RSS_HASH;
}
- if (rxq->mark &&
- ((cqe->sop_drop_qpn !=
- htonl(MLX5_FLOW_MARK_INVALID)) &&
- (cqe->sop_drop_qpn !=
- htonl(MLX5_FLOW_MARK_DEFAULT)))) {
- pkt->hash.fdir.hi =
- mlx5_flow_mark_get(cqe->sop_drop_qpn);
- pkt->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
+ if (rxq->mark && (cqe->sop_drop_qpn !=
+ htonl(MLX5_FLOW_MARK_INVALID))) {
+ pkt->ol_flags |= PKT_RX_FDIR;
+ if (cqe->sop_drop_qpn !=
+ htonl(MLX5_FLOW_MARK_DEFAULT)) {
+ uint32_t mark = cqe->sop_drop_qpn;
+
+ pkt->ol_flags |= PKT_RX_FDIR_ID;
+ pkt->hash.fdir.hi =
+ mlx5_flow_mark_get(mark);
+ }
}
if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip |
rxq->crc_present) {