ACTION_SET_META,
ACTION_SET_META_DATA,
ACTION_SET_META_MASK,
+ ACTION_SET_IPV4_DSCP,
+ ACTION_SET_IPV4_DSCP_VALUE,
+ ACTION_SET_IPV6_DSCP,
+ ACTION_SET_IPV6_DSCP_VALUE,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
ACTION_RAW_DECAP,
ACTION_SET_TAG,
ACTION_SET_META,
+ ACTION_SET_IPV4_DSCP,
+ ACTION_SET_IPV6_DSCP,
ZERO,
};
ZERO,
};
+static const enum index action_set_ipv4_dscp[] = {
+ ACTION_SET_IPV4_DSCP_VALUE,
+ ACTION_NEXT,
+ ZERO,
+};
+
+static const enum index action_set_ipv6_dscp[] = {
+ ACTION_SET_IPV6_DSCP_VALUE,
+ ACTION_NEXT,
+ ZERO,
+};
+
static int parse_set_raw_encap_decap(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
(struct rte_flow_action_set_meta, mask)),
.call = parse_vc_conf,
},
+ [ACTION_SET_IPV4_DSCP] = {
+ .name = "set_ipv4_dscp",
+ .help = "set DSCP value",
+ .priv = PRIV_ACTION(SET_IPV4_DSCP,
+ sizeof(struct rte_flow_action_set_dscp)),
+ .next = NEXT(action_set_ipv4_dscp),
+ .call = parse_vc,
+ },
+ [ACTION_SET_IPV4_DSCP_VALUE] = {
+ .name = "dscp_value",
+ .help = "new IPv4 DSCP value to set",
+ .next = NEXT(action_set_ipv4_dscp, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY
+ (struct rte_flow_action_set_dscp, dscp)),
+ .call = parse_vc_conf,
+ },
+ [ACTION_SET_IPV6_DSCP] = {
+ .name = "set_ipv6_dscp",
+ .help = "set DSCP value",
+ .priv = PRIV_ACTION(SET_IPV6_DSCP,
+ sizeof(struct rte_flow_action_set_dscp)),
+ .next = NEXT(action_set_ipv6_dscp),
+ .call = parse_vc,
+ },
+ [ACTION_SET_IPV6_DSCP_VALUE] = {
+ .name = "dscp_value",
+ .help = "new IPv6 DSCP value to set",
+ .next = NEXT(action_set_ipv6_dscp, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY
+ (struct rte_flow_action_set_dscp, dscp)),
+ .call = parse_vc_conf,
+ },
};
/** Remove and return last entry from argument stack. */
| ``mask`` | bit-mask applies to "data" |
+----------+----------------------------+
+Action: ``SET_IPV4_DSCP``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Set IPv4 DSCP.
+
+Modify DSCP in IPv4 header.
+
+It must be used with RTE_FLOW_ITEM_TYPE_IPV4 in pattern.
+Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error will be returned.
+
+.. _table_rte_flow_action_set_ipv4_dscp:
+
+.. table:: SET_IPV4_DSCP
+
+ +-----------+---------------------------------+
+ | Field | Value |
+ +===========+=================================+
+ | ``dscp`` | DSCP in low 6 bits, rest ignore |
+ +-----------+---------------------------------+
+
+Action: ``SET_IPV6_DSCP``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Set IPv6 DSCP.
+
+Modify DSCP in IPv6 header.
+
+It must be used with RTE_FLOW_ITEM_TYPE_IPV6 in pattern.
+Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error will be returned.
+
+.. _table_rte_flow_action_set_ipv6_dscp:
+
+.. table:: SET_IPV6_DSCP
+
+ +-----------+---------------------------------+
+ | Field | Value |
+ +===========+=================================+
+ | ``dscp`` | DSCP in low 6 bits, rest ignore |
+ +-----------+---------------------------------+
+
Negative types
~~~~~~~~~~~~~~
- ``value {unsigned}``: Value to decrease TCP acknowledgment number by.
+- ``set_ipv4_dscp``: Set IPv4 DSCP value with specified value
+
+ - ``dscp_value {unsigned}``: The new DSCP value to be set
+
+- ``set_ipv6_dscp``: Set IPv6 DSCP value with specified value
+
+ - ``dscp_value {unsigned}``: The new DSCP value to be set
+
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
MK_FLOW_ACTION(DEC_TCP_ACK, sizeof(rte_be32_t)),
MK_FLOW_ACTION(SET_TAG, sizeof(struct rte_flow_action_set_tag)),
MK_FLOW_ACTION(SET_META, sizeof(struct rte_flow_action_set_meta)),
+ MK_FLOW_ACTION(SET_IPV4_DSCP, sizeof(struct rte_flow_action_set_dscp)),
+ MK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct rte_flow_action_set_dscp)),
};
int
* See struct rte_flow_action_set_meta.
*/
RTE_FLOW_ACTION_TYPE_SET_META,
+
+ /**
+ * Modify IPv4 DSCP in the outermost IP header.
+ *
+ * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4,
+ * then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
+ *
+ * See struct rte_flow_action_set_dscp.
+ */
+ RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP,
+
+ /**
+ * Modify IPv6 DSCP in the outermost IP header.
+ *
+ * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV6,
+ * then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
+ *
+ * See struct rte_flow_action_set_dscp.
+ */
+ RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP,
};
/**
uint32_t mask;
};
+/**
+ * RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP
+ * RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP
+ *
+ * Set the DSCP value for IPv4/IPv6 header.
+ * DSCP in low 6 bits, rest ignored.
+ */
+struct rte_flow_action_set_dscp {
+ uint8_t dscp;
+};
+
/* Mbuf dynamic field offset for metadata. */
extern int rte_flow_dynf_metadata_offs;