| ``context`` | user input flow context |
+--------------+---------------------------------+
+Action: ``SAMPLE``
+^^^^^^^^^^^^^^^^^^
+
+Adds a sample action to a matched flow.
+
+The matching packets will be duplicated with the specified ``ratio`` and
+applied with own set of actions with a fate action, the packets sampled
+equals is '1/ratio'. All the packets continue to the target destination.
+
+When the ``ratio`` is set to 1 then the packets will be 100% mirrored.
+``actions`` represent the different set of actions for the sampled or mirrored
+packets, and must have a fate action.
+
+.. _table_rte_flow_action_sample:
+
+.. table:: SAMPLE
+
+ +--------------+---------------------------------+
+ | Field | Value |
+ +==============+=================================+
+ | ``ratio`` | 32 bits sample ratio value |
+ +--------------+---------------------------------+
+ | ``actions`` | sub-action list for sampling |
+ +--------------+---------------------------------+
+
Negative types
~~~~~~~~~~~~~~
whether PMD supports thread safe operations. If PMD doesn't set the flag,
rte_flow API level functions will protect the flow operations with mutex.
+* **Added flow-based traffic sampling support.**
+
+ Added new action: ``RTE_FLOW_ACTION_TYPE_SAMPLE`` to duplicate the matching
+ packets with specified ratio, and apply with own set of actions with a fate
+ action. When the ratio is set to 1 then the packets will be 100% mirrored.
+
* **Updated Broadcom bnxt driver.**
Updated the Broadcom bnxt driver with new features and improvements, including:
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)),
MK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)),
+ MK_FLOW_ACTION(SAMPLE, sizeof(struct rte_flow_action_sample)),
};
int
* see enum RTE_ETH_EVENT_FLOW_AGED
*/
RTE_FLOW_ACTION_TYPE_AGE,
+
+ /**
+ * The matching packets will be duplicated with specified ratio and
+ * applied with own set of actions with a fate action.
+ *
+ * See struct rte_flow_action_sample.
+ */
+ RTE_FLOW_ACTION_TYPE_SAMPLE,
};
/**
*/
struct rte_flow;
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_SAMPLE
+ *
+ * Adds a sample action to a matched flow.
+ *
+ * The matching packets will be duplicated with specified ratio and applied
+ * with own set of actions with a fate action, the sampled packet could be
+ * redirected to queue or port. All the packets continue processing on the
+ * default flow path.
+ *
+ * When the sample ratio is set to 1 then the packets will be 100% mirrored.
+ * Additional action list be supported to add for sampled or mirrored packets.
+ */
+struct rte_flow_action_sample {
+ uint32_t ratio; /**< packets sampled equals to '1/ratio'. */
+ const struct rte_flow_action *actions;
+ /**< sub-action list specific for the sampling hit cases. */
+};
+
/**
* Verbose error types.
*