[dpdk-dev] [PATCH 29/40] pipeline: add pipeline flush
Cristian Dumitrescu
cristian.dumitrescu at intel.com
Wed Aug 26 17:14:34 CEST 2020
Flush the packets currently buffered by the pipeline output ports.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu at 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(+)
diff --git a/lib/librte_pipeline/rte_pipeline_version.map b/lib/librte_pipeline/rte_pipeline_version.map
index bb992fdd0..730e11a0c 100644
--- a/lib/librte_pipeline/rte_pipeline_version.map
+++ b/lib/librte_pipeline/rte_pipeline_version.map
@@ -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;
diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c
index 6963f63a2..64fc187c4 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.c
+++ b/lib/librte_pipeline/rte_swx_pipeline.c
@@ -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.
*/
diff --git a/lib/librte_pipeline/rte_swx_pipeline.h b/lib/librte_pipeline/rte_swx_pipeline.h
index fb83a8820..203e394d6 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.h
+++ b/lib/librte_pipeline/rte_swx_pipeline.h
@@ -547,6 +547,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
*
--
2.17.1
More information about the dev
mailing list