[V2,18/24] pipeline: introduce custom instructions
Checks
Commit Message
For better performance, the option to create custom instructions when
the program is translated and add them on-the-fly to the pipeline is
now provided. Multiple regular instructions can now be consolidated
into a single C function optimized by the C compiler directly.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/pipeline/rte_swx_pipeline.c | 6 +++++-
lib/pipeline/rte_swx_pipeline_internal.h | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
@@ -6592,7 +6592,11 @@ instruction_config(struct rte_swx_pipeline *p,
typedef void (*instr_exec_t)(struct rte_swx_pipeline *);
-static instr_exec_t instruction_table[] = {
+#ifndef RTE_SWX_PIPELINE_INSTRUCTION_TABLE_SIZE_MAX
+#define RTE_SWX_PIPELINE_INSTRUCTION_TABLE_SIZE_MAX 256
+#endif
+
+static instr_exec_t instruction_table[RTE_SWX_PIPELINE_INSTRUCTION_TABLE_SIZE_MAX] = {
[INSTR_RX] = instr_rx_exec,
[INSTR_TX] = instr_tx_exec,
[INSTR_TX_I] = instr_tx_i_exec,
@@ -541,6 +541,9 @@ enum instruction_type {
* Return from action
*/
INSTR_RETURN,
+
+ /* Start of custom instructions. */
+ INSTR_CUSTOM_0,
};
struct instr_operand {