@@ -91,6 +91,8 @@ enum index {
ITEM_PHY_PORT_INDEX,
ITEM_PORT_ID,
ITEM_PORT_ID_ID,
+ ITEM_MARK,
+ ITEM_MARK_ID,
ITEM_RAW,
ITEM_RAW_RELATIVE,
ITEM_RAW_SEARCH,
@@ -453,6 +455,7 @@ static const enum index next_item[] = {
ITEM_VF,
ITEM_PHY_PORT,
ITEM_PORT_ID,
+ ITEM_MARK,
ITEM_RAW,
ITEM_ETH,
ITEM_VLAN,
@@ -505,6 +508,12 @@ static const enum index item_port_id[] = {
ZERO,
};
+static const enum index item_mark[] = {
+ ITEM_MARK_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index item_raw[] = {
ITEM_RAW_RELATIVE,
ITEM_RAW_SEARCH,
@@ -1127,6 +1136,19 @@ static const struct token token_list[] = {
.next = NEXT(item_port_id, NEXT_ENTRY(UNSIGNED), item_param),
.args = ARGS(ARGS_ENTRY(struct rte_flow_item_port_id, id)),
},
+ [ITEM_MARK] = {
+ .name = "mark",
+ .help = "match traffic against value set in previously matched rule",
+ .priv = PRIV_ITEM(MARK, sizeof(struct rte_flow_item_mark)),
+ .next = NEXT(item_mark),
+ .call = parse_vc,
+ },
+ [ITEM_MARK_ID] = {
+ .name = "id",
+ .help = "Integer value to match against",
+ .next = NEXT(item_mark, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_item_mark, id)),
+ },
[ITEM_RAW] = {
.name = "raw",
.help = "match an arbitrary byte string",
@@ -656,6 +656,36 @@ representor" depending on the kind of underlying device).
| ``mask`` | ``id`` | zeroed to match any port ID |
+----------+----------+-----------------------------+
+Item: ``MARK``
+^^^^^^^^^^^^^^
+
+Matches an arbitrary integer value which was set using the ``MARK`` action in
+a previously matched rule.
+
+This item can only specified once as a match criteria as the ``MARK`` action can
+only be specified once in a flow action.
+
+Note the value of MARK field is arbitrary and application defined.
+
+Depending on the underlying implementation the MARK item may be supported on
+the physical device, with virtual groups in the PMD or not at all.
+
+- Default ``mask`` matches any integer value.
+
+.. _table_rte_flow_item_mark:
+
+.. table:: MARK
+
+ +----------+----------+---------------------------+
+ | Field | Subfield | Value |
+ +==========+==========+===========================+
+ | ``spec`` | ``id`` | integer value |
+ +----------+--------------------------------------+
+ | ``last`` | ``id`` | upper range value |
+ +----------+----------+---------------------------+
+ | ``mask`` | ``id`` | zeroed to match any value |
+ +----------+------- --+---------------------------+
+
Data matching item types
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -3215,6 +3215,10 @@ This section lists supported pattern items and their attributes, if any.
- ``port_id``: match traffic from/to a given DPDK port ID.
- ``id {unsigned}``: DPDK port ID.
+
+- ``mark``: match value set in previously matched flow rule using the mark action.
+
+ - ``id {unsigned}``: arbitrary integer value.
- ``raw``: match an arbitrary byte string.
@@ -341,6 +341,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches specified mark field.
+ *
+ * See struct rte_flow_item_mark.
+ */
+ RTE_FLOW_ITEM_TYPE_MARK,
};
/**
@@ -869,6 +876,28 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
};
#endif
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_MARK
+ *
+ * Matches an arbitrary integer value which was set using the ``MARK`` action
+ * in a previously matched rule.
+ *
+ * This item can only be specified once as a match criteria as the ``MARK``
+ * action can only be specified once in a flow action.
+ *
+ * This value is arbitrary and application-defined. Maximum allowed value
+ * depends on the underlying implementation.
+ *
+ * Depending on the underlying implementation the MARK item may be supported on
+ * the physical device, with virtual groups in the PMD or not at all.
+ */
+struct rte_flow_item_mark {
+ uint32_t id; /**< Integer value to match against. */
+};
+
/**
* Matching pattern item definition.
*