ITEM_HIGIG2,
ITEM_HIGIG2_CLASSIFICATION,
ITEM_HIGIG2_VID,
+ ITEM_TAG,
+ ITEM_TAG_DATA,
+ ITEM_TAG_INDEX,
/* Validate/create actions. */
ACTIONS,
ACTION_RAW_ENCAP_INDEX_VALUE,
ACTION_RAW_DECAP_INDEX,
ACTION_RAW_DECAP_INDEX_VALUE,
+ ACTION_SET_TAG,
+ ACTION_SET_TAG_DATA,
+ ACTION_SET_TAG_INDEX,
+ ACTION_SET_TAG_MASK,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
ITEM_PPPOED,
ITEM_PPPOE_PROTO_ID,
ITEM_HIGIG2,
+ ITEM_TAG,
END_SET,
ZERO,
};
ZERO,
};
+static const enum index item_tag[] = {
+ ITEM_TAG_DATA,
+ ITEM_TAG_INDEX,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
ACTION_DEC_TCP_ACK,
ACTION_RAW_ENCAP,
ACTION_RAW_DECAP,
+ ACTION_SET_TAG,
ZERO,
};
ZERO,
};
+static const enum index action_set_tag[] = {
+ ACTION_SET_TAG_DATA,
+ ACTION_SET_TAG_INDEX,
+ ACTION_SET_TAG_MASK,
+ ACTION_NEXT,
+ ZERO,
+};
+
static int parse_set_raw_encap_decap(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_higig2_hdr,
hdr.ppt1.vid)),
},
+ [ITEM_TAG] = {
+ .name = "tag",
+ .help = "match tag value",
+ .priv = PRIV_ITEM(TAG, sizeof(struct rte_flow_item_tag)),
+ .next = NEXT(item_tag),
+ .call = parse_vc,
+ },
+ [ITEM_TAG_DATA] = {
+ .name = "data",
+ .help = "tag value to match",
+ .next = NEXT(item_tag, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tag, data)),
+ },
+ [ITEM_TAG_INDEX] = {
+ .name = "index",
+ .help = "index of tag array to match",
+ .next = NEXT(item_tag, NEXT_ENTRY(UNSIGNED),
+ NEXT_ENTRY(ITEM_PARAM_IS)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
.name = "actions",
.help = "index of raw_encap/raw_decap data",
.next = NEXT(next_item),
.call = parse_port,
- }
+ },
+ [ACTION_SET_TAG] = {
+ .name = "set_tag",
+ .help = "set tag",
+ .priv = PRIV_ACTION(SET_TAG,
+ sizeof(struct rte_flow_action_set_tag)),
+ .next = NEXT(action_set_tag),
+ .call = parse_vc,
+ },
+ [ACTION_SET_TAG_INDEX] = {
+ .name = "index",
+ .help = "index of tag array",
+ .next = NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_action_set_tag, index)),
+ .call = parse_vc_conf,
+ },
+ [ACTION_SET_TAG_DATA] = {
+ .name = "data",
+ .help = "tag value",
+ .next = NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_HTON
+ (struct rte_flow_action_set_tag, data)),
+ .call = parse_vc_conf,
+ },
+ [ACTION_SET_TAG_MASK] = {
+ .name = "mask",
+ .help = "mask for tag value",
+ .next = NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_HTON
+ (struct rte_flow_action_set_tag, mask)),
+ .call = parse_vc_conf,
+ },
};
/** Remove and return last entry from argument stack. */
| ``mask`` | ``id`` | zeroed to match any value |
+----------+----------+---------------------------+
-Data matching item types
-~~~~~~~~~~~~~~~~~~~~~~~~
+Item: ``TAG``
+^^^^^^^^^^^^^
+
+Matches tag item set by other flows. Multiple tags are supported by specifying
+``index``.
+
+- Default ``mask`` matches the specified tag value and index.
+
+.. _table_rte_flow_item_tag:
+
+.. table:: TAG
+
+ +----------+----------+----------------------------------------+
+ | Field | Subfield | Value |
+ +==========+===========+=======================================+
+ | ``spec`` | ``data`` | 32 bit flow tag value |
+ | +-----------+---------------------------------------+
+ | | ``index`` | index of flow tag |
+ +----------+-----------+---------------------------------------+
+ | ``last`` | ``data`` | upper range value |
+ | +-----------+---------------------------------------+
+ | | ``index`` | field is ignored |
+ +----------+-----------+---------------------------------------+
+ | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" |
+ | +-----------+---------------------------------------+
+ | | ``index`` | field is ignored |
+ +----------+-----------+---------------------------------------+
+
+ata matching item types
+~~~~~~~~~~~~~~~~~~~~~~~
Most of these are basically protocol header definitions with associated
bit-masks. They must be specified (stacked) from lowest to highest protocol
Using this action on non-matching traffic will result in undefined behavior.
+Action: ``SET_TAG``
+^^^^^^^^^^^^^^^^^^^
+
+Set Tag.
+
+Tag is a transient data used during flow matching. This is not delivered to
+application. Multiple tags are supported by specifying index.
+
+.. _table_rte_flow_action_set_tag:
+
+.. table:: SET_TAG
+
+ +-----------+----------------------------+
+ | Field | Value |
+ +===========+============================+
+ | ``data`` | 32 bit tag value |
+ +-----------+----------------------------+
+ | ``mask`` | bit-mask applies to "data" |
+ +-----------+----------------------------+
+ | ``index`` | index of tag to set |
+ +-----------+----------------------------+
+
Negative types
~~~~~~~~~~~~~~
On supported NICs, we can now setup haipin queue which will offload packets
from the wire, backto the wire.
+* **Added flow tag in rte_flow.**
+
+ SET_TAG action and TAG item have been added to support transient flow tag.
+
* **Updated the enic driver.**
* Added support for Geneve with options offload.
sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)),
MK_FLOW_ITEM(MARK, sizeof(struct rte_flow_item_mark)),
MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)),
+ MK_FLOW_ITEM(TAG, sizeof(struct rte_flow_item_tag)),
MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)),
MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)),
MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)),
MK_FLOW_ACTION(DEC_TCP_SEQ, sizeof(rte_be32_t)),
MK_FLOW_ACTION(INC_TCP_ACK, sizeof(rte_be32_t)),
MK_FLOW_ACTION(DEC_TCP_ACK, sizeof(rte_be32_t)),
+ MK_FLOW_ACTION(SET_TAG, sizeof(struct rte_flow_action_set_tag)),
};
static int
* see struct rte_flow_item_higig2_hdr.
*/
RTE_FLOW_ITEM_TYPE_HIGIG2,
+
+ /*
+ * [META]
+ *
+ * Matches a tag value.
+ *
+ * See struct rte_flow_item_tag.
+ */
+ RTE_FLOW_ITEM_TYPE_TAG,
};
/**
};
#endif
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_TAG
+ *
+ * Matches a specified tag value at the specified index.
+ */
+struct rte_flow_item_tag {
+ uint32_t data;
+ uint8_t index;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_TAG. */
+#ifndef __cplusplus
+static const struct rte_flow_item_tag rte_flow_item_tag_mask = {
+ .data = 0xffffffff,
+ .index = 0xff,
+};
+#endif
+
/**
* @warning
* @b EXPERIMENTAL: this structure may change without prior notice
uint32_t id; /**< Integer value to match against. */
};
+/** Default mask for RTE_FLOW_ITEM_TYPE_MARK. */
+#ifndef __cplusplus
+static const struct rte_flow_item_mark rte_flow_item_mark_mask = {
+ .id = 0xffffffff,
+};
+#endif
+
/**
* @warning
* @b EXPERIMENTAL: this structure may change without prior notice
* undefined behavior.
*/
RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK,
+
+ /**
+ * Set Tag.
+ *
+ * Tag is for internal flow usage only and
+ * is not delivered to the application.
+ *
+ * See struct rte_flow_action_set_tag.
+ */
+ RTE_FLOW_ACTION_TYPE_SET_TAG,
};
/**
uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
};
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_SET_TAG
+ *
+ * Set a tag which is a transient data used during flow matching. This is not
+ * delivered to application. Multiple tags are supported by specifying index.
+ */
+struct rte_flow_action_set_tag {
+ uint32_t data;
+ uint32_t mask;
+ uint8_t index;
+};
+
/*
* Definition of a single action.
*