X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fpipeline%2Frte_swx_pipeline.h;h=490ff60c0d02e0a96003b35d225b5405a7c1f005;hb=28dde5da503ed09f10cdfb295e390b114df7330a;hp=5afca2bc20fb0fb4071e3d3d15f1b316b7759d77;hpb=cef3896928b7de97aa1a74f20fada796996a68d9;p=dpdk.git diff --git a/lib/pipeline/rte_swx_pipeline.h b/lib/pipeline/rte_swx_pipeline.h index 5afca2bc20..490ff60c0d 100644 --- a/lib/pipeline/rte_swx_pipeline.h +++ b/lib/pipeline/rte_swx_pipeline.h @@ -676,6 +676,73 @@ rte_swx_pipeline_selector_config(struct rte_swx_pipeline *p, const char *name, struct rte_swx_pipeline_selector_params *params); +/** Pipeline learner table parameters. */ +struct rte_swx_pipeline_learner_params { + /** The set of match fields for the current table. + * Restriction: All the match fields of the current table need to be + * part of the same struct, i.e. either all the match fields are part of + * the same header or all the match fields are part of the meta-data. + */ + const char **field_names; + + /** The number of match fields for the current table. Must be non-zero. + */ + uint32_t n_fields; + + /** The set of actions for the current table. */ + const char **action_names; + + /** The number of actions for the current table. Must be at least one. + */ + uint32_t n_actions; + + /** The default table action that gets executed on lookup miss. Must be + * one of the table actions included in the *action_names*. + */ + const char *default_action_name; + + /** Default action data. The size of this array is the action data size + * of the default action. Must be NULL if the default action data size + * is zero. + */ + uint8_t *default_action_data; + + /** If non-zero (true), then the default action of the current table + * cannot be changed. If zero (false), then the default action can be + * changed in the future with another action from the *action_names* + * list. + */ + int default_action_is_const; +}; + +/** + * Pipeline learner table configure + * + * @param[out] p + * Pipeline handle. + * @param[in] name + * Learner table name. + * @param[in] params + * Learner table parameters. + * @param[in] size + * The maximum number of table entries. Must be non-zero. + * @param[in] timeout + * Table entry timeout in seconds. Must be non-zero. + * @return + * 0 on success or the following error codes otherwise: + * -EINVAL: Invalid argument; + * -ENOMEM: Not enough space/cannot allocate memory; + * -EEXIST: Learner table with this name already exists; + * -ENODEV: Learner table creation error. + */ +__rte_experimental +int +rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p, + const char *name, + struct rte_swx_pipeline_learner_params *params, + uint32_t size, + uint32_t timeout); + /** * Pipeline register array configure *