Flush the packets currently buffered by the SWX pipeline output ports.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/librte_pipeline/rte_pipeline_version.map | 1 +
lib/librte_pipeline/rte_swx_pipeline.c | 13 +++++++++++++
lib/librte_pipeline/rte_swx_pipeline.h | 12 ++++++++++++
3 files changed, 26 insertions(+)
@@ -74,6 +74,7 @@ EXPERIMENTAL {
rte_swx_pipeline_build;
rte_swx_pipeline_free;
rte_swx_pipeline_run;
+ rte_swx_pipeline_flush;
rte_swx_pipeline_table_state_get;
rte_swx_pipeline_table_state_set;
rte_swx_ctl_pipeline_info_get;
@@ -6951,6 +6951,19 @@ rte_swx_pipeline_run(struct rte_swx_pipeline *p, uint32_t n_instructions)
instr_exec(p);
}
+void
+rte_swx_pipeline_flush(struct rte_swx_pipeline *p)
+{
+ uint32_t i;
+
+ for (i = 0; i < p->n_ports_out; i++) {
+ struct port_out_runtime *port = &p->out[i];
+
+ if (port->flush)
+ port->flush(port->obj);
+ }
+}
+
/*
* Control.
*/
@@ -656,6 +656,18 @@ void
rte_swx_pipeline_run(struct rte_swx_pipeline *p,
uint32_t n_instructions);
+/**
+ * Pipeline flush
+ *
+ * Flush all output ports of the pipeline.
+ *
+ * @param[in] p
+ * Pipeline handle.
+ */
+__rte_experimental
+void
+rte_swx_pipeline_flush(struct rte_swx_pipeline *p);
+
/**
* Pipeline free
*