@@ -636,6 +636,7 @@ enum index {
ACTION_MODIFY_FIELD_DST_TYPE_VALUE,
ACTION_MODIFY_FIELD_DST_LEVEL,
ACTION_MODIFY_FIELD_DST_LEVEL_VALUE,
+ ACTION_MODIFY_FIELD_DST_SUB_LEVEL,
ACTION_MODIFY_FIELD_DST_TYPE_ID,
ACTION_MODIFY_FIELD_DST_CLASS_ID,
ACTION_MODIFY_FIELD_DST_OFFSET,
@@ -643,6 +644,7 @@ enum index {
ACTION_MODIFY_FIELD_SRC_TYPE_VALUE,
ACTION_MODIFY_FIELD_SRC_LEVEL,
ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE,
+ ACTION_MODIFY_FIELD_SRC_SUB_LEVEL,
ACTION_MODIFY_FIELD_SRC_TYPE_ID,
ACTION_MODIFY_FIELD_SRC_CLASS_ID,
ACTION_MODIFY_FIELD_SRC_OFFSET,
@@ -859,7 +861,7 @@ static const char *const modify_field_ids[] = {
"ipv6_proto",
"flex_item",
"hash_result",
- "geneve_opt_type", "geneve_opt_class", "geneve_opt_data", NULL
+ "geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls", NULL
};
static const char *const meter_colors[] = {
@@ -2300,6 +2302,7 @@ static const enum index next_action_sample[] = {
static const enum index action_modify_field_dst[] = {
ACTION_MODIFY_FIELD_DST_LEVEL,
+ ACTION_MODIFY_FIELD_DST_SUB_LEVEL,
ACTION_MODIFY_FIELD_DST_TYPE_ID,
ACTION_MODIFY_FIELD_DST_CLASS_ID,
ACTION_MODIFY_FIELD_DST_OFFSET,
@@ -2309,6 +2312,7 @@ static const enum index action_modify_field_dst[] = {
static const enum index action_modify_field_src[] = {
ACTION_MODIFY_FIELD_SRC_LEVEL,
+ ACTION_MODIFY_FIELD_SRC_SUB_LEVEL,
ACTION_MODIFY_FIELD_SRC_TYPE_ID,
ACTION_MODIFY_FIELD_SRC_CLASS_ID,
ACTION_MODIFY_FIELD_SRC_OFFSET,
@@ -6397,6 +6401,15 @@ static const struct token token_list[] = {
.call = parse_vc_modify_field_level,
.comp = comp_none,
},
+ [ACTION_MODIFY_FIELD_DST_SUB_LEVEL] = {
+ .name = "dst_sub_level",
+ .help = "destination field sub level",
+ .next = NEXT(action_modify_field_dst,
+ NEXT_ENTRY(COMMON_UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field,
+ dst.sub_level)),
+ .call = parse_vc_conf,
+ },
[ACTION_MODIFY_FIELD_DST_TYPE_ID] = {
.name = "dst_type_id",
.help = "destination field type ID",
@@ -6450,6 +6463,15 @@ static const struct token token_list[] = {
.call = parse_vc_modify_field_level,
.comp = comp_none,
},
+ [ACTION_MODIFY_FIELD_SRC_SUB_LEVEL] = {
+ .name = "stc_sub_level",
+ .help = "source field sub level",
+ .next = NEXT(action_modify_field_src,
+ NEXT_ENTRY(COMMON_UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field,
+ src.sub_level)),
+ .call = parse_vc_conf,
+ },
[ACTION_MODIFY_FIELD_SRC_TYPE_ID] = {
.name = "src_type_id",
.help = "source field type ID",
@@ -2939,6 +2939,10 @@ as well as any tag element in the tag array:
For the tag array (in case of multiple tags are supported and present)
``level`` translates directly into the array index.
+- ``sub_level`` is the index of the header inside encapsulation level.
+ It is used for modify either ``VLAN`` or ``MPLS`` headers which multiple of
+ them might be supported in same encapsulation level.
+
``type`` is used to specify (along with ``class_id``) the Geneve option which
is being modified.
This field is relevant only for ``RTE_FLOW_FIELD_GENEVE_OPT_XXXX`` type.
@@ -3004,6 +3008,8 @@ value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, xxx}.
+-----------------+----------------------------------------------------------+
| ``level`` | encapsulation level of a packet field or tag array index |
+-----------------+----------------------------------------------------------+
+ | ``sub_level`` | header level inside encapsulation level |
+ +-----------------+----------------------------------------------------------+
| ``type`` | geneve option type |
+-----------------+----------------------------------------------------------+
| ``class_id`` | geneve option class ID |
@@ -3740,8 +3740,8 @@ enum rte_flow_field_id {
RTE_FLOW_FIELD_START = 0, /**< Start of a packet. */
RTE_FLOW_FIELD_MAC_DST, /**< Destination MAC Address. */
RTE_FLOW_FIELD_MAC_SRC, /**< Source MAC Address. */
- RTE_FLOW_FIELD_VLAN_TYPE, /**< 802.1Q Tag Identifier. */
- RTE_FLOW_FIELD_VLAN_ID, /**< 802.1Q VLAN Identifier. */
+ RTE_FLOW_FIELD_VLAN_TYPE, /**< VLAN Tag Identifier. */
+ RTE_FLOW_FIELD_VLAN_ID, /**< VLAN Identifier. */
RTE_FLOW_FIELD_MAC_TYPE, /**< EtherType. */
RTE_FLOW_FIELD_IPV4_DSCP, /**< IPv4 DSCP. */
RTE_FLOW_FIELD_IPV4_TTL, /**< IPv4 Time To Live. */
@@ -3775,7 +3775,8 @@ enum rte_flow_field_id {
RTE_FLOW_FIELD_HASH_RESULT, /**< Hash result. */
RTE_FLOW_FIELD_GENEVE_OPT_TYPE, /**< GENEVE option type */
RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class */
- RTE_FLOW_FIELD_GENEVE_OPT_DATA /**< GENEVE option data */
+ RTE_FLOW_FIELD_GENEVE_OPT_DATA, /**< GENEVE option data */
+ RTE_FLOW_FIELD_MPLS /**< MPLS header. */
};
/**
@@ -3821,22 +3822,38 @@ struct rte_flow_action_modify_data {
* Values other than @p 0 are not
* necessarily supported.
*
+ * @note that for MPLS field,
+ * encapsulation level also include
+ * tunnel since MPLS may appear in
+ * outer, inner or tunnel.
+ *
* For RTE_FLOW_FIELD_TAG it represents
* the tag element in the tag array.
*/
uint8_t level;
- /**
- * Geneve option type. relevant only
- * for RTE_FLOW_FIELD_GENEVE_OPT_XXXX
- * modification type.
- */
- uint8_t type;
- /**
- * Geneve option class. relevant only
- * for RTE_FLOW_FIELD_GENEVE_OPT_XXXX
- * modification type.
- */
- rte_be16_t class_id;
+ union {
+ /**
+ * Header level inside
+ * encapsulation level.
+ */
+ uint8_t sub_level;
+ /**
+ * Geneve option identifier.
+ * relevant only for
+ * RTE_FLOW_FIELD_GENEVE_OPT_XXXX
+ * modification type.
+ */
+ struct {
+ /**
+ * Geneve option type.
+ */
+ uint8_t type;
+ /**
+ * Geneve option class.
+ */
+ rte_be16_t class_id;
+ };
+ };
};
struct rte_flow_item_flex_handle *flex_handle;
};