X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fpipeline.h;h=278775c2d0fcff0b735cba9525d75562753fd92f;hb=105add6bc30e3a060c0e37decb734121af0673aa;hp=64efbed89b892eb412a2252c00cec56527496adf;hpb=a3a95b7d58b9403d9d8bb6c87e2f42dbe212ac91;p=dpdk.git diff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h index 64efbed89b..278775c2d0 100644 --- a/examples/ip_pipeline/pipeline.h +++ b/examples/ip_pipeline/pipeline.h @@ -27,6 +27,7 @@ enum port_in_type { PORT_IN_TAP, PORT_IN_KNI, PORT_IN_SOURCE, + PORT_IN_CRYPTODEV, }; struct port_in_params { @@ -48,6 +49,12 @@ struct port_in_params { const char *file_name; uint32_t n_bytes_per_pkt; } source; + + struct { + uint16_t queue_id; + void *f_callback; + void *arg_callback; + } cryptodev; }; uint32_t burst_size; @@ -62,6 +69,7 @@ enum port_out_type { PORT_OUT_TAP, PORT_OUT_KNI, PORT_OUT_SINK, + PORT_OUT_CRYPTODEV, }; struct port_out_params { @@ -76,6 +84,11 @@ struct port_out_params { const char *file_name; uint32_t max_n_pkts; } sink; + + struct { + uint16_t queue_id; + uint32_t op_offset; + } cryptodev; }; uint32_t burst_size; int retry; @@ -130,6 +143,10 @@ struct table_params { const char *action_profile_name; }; +struct table_rule; + +TAILQ_HEAD(table_rule_list, table_rule); + struct port_in { struct port_in_params params; struct port_in_action_profile *ap; @@ -140,6 +157,8 @@ struct table { struct table_params params; struct table_action_profile *ap; struct rte_table_action *a; + struct table_rule_list rules; + struct table_rule *rule_default; }; struct pipeline { @@ -260,6 +279,7 @@ struct table_rule_match { struct table_rule_action { uint64_t action_mask; struct rte_table_action_fwd_params fwd; + struct rte_table_action_lb_params lb; struct rte_table_action_mtr_params mtr; struct rte_table_action_tm_params tm; struct rte_table_action_encap_params encap; @@ -267,6 +287,16 @@ struct table_rule_action { struct rte_table_action_ttl_params ttl; struct rte_table_action_stats_params stats; struct rte_table_action_time_params time; + struct rte_table_action_sym_crypto_params sym_crypto; + struct rte_table_action_tag_params tag; + struct rte_table_action_decap_params decap; +}; + +struct table_rule { + TAILQ_ENTRY(table_rule) node; + struct table_rule_match match; + struct table_rule_action action; + void *data; }; int @@ -299,13 +329,95 @@ int pipeline_table_rule_add(const char *pipeline_name, uint32_t table_id, struct table_rule_match *match, - struct table_rule_action *action, - void **data); + struct table_rule_action *action); + +int +pipeline_table_rule_add_bulk(const char *pipeline_name, + uint32_t table_id, + struct table_rule_list *list, + uint32_t *n_rules_added, + uint32_t *n_rules_not_added); int pipeline_table_rule_add_default(const char *pipeline_name, uint32_t table_id, - struct table_rule_action *action, - void **data); + struct table_rule_action *action); + +int +pipeline_table_rule_delete(const char *pipeline_name, + uint32_t table_id, + struct table_rule_match *match); + +int +pipeline_table_rule_delete_default(const char *pipeline_name, + uint32_t table_id); + +int +pipeline_table_rule_stats_read(const char *pipeline_name, + uint32_t table_id, + struct table_rule_match *match, + struct rte_table_action_stats_counters *stats, + int clear); + +int +pipeline_table_mtr_profile_add(const char *pipeline_name, + uint32_t table_id, + uint32_t meter_profile_id, + struct rte_table_action_meter_profile *profile); + +int +pipeline_table_mtr_profile_delete(const char *pipeline_name, + uint32_t table_id, + uint32_t meter_profile_id); + +int +pipeline_table_rule_mtr_read(const char *pipeline_name, + uint32_t table_id, + struct table_rule_match *match, + struct rte_table_action_mtr_counters *stats, + int clear); + +int +pipeline_table_dscp_table_update(const char *pipeline_name, + uint32_t table_id, + uint64_t dscp_mask, + struct rte_table_action_dscp_table *dscp_table); + +int +pipeline_table_rule_ttl_read(const char *pipeline_name, + uint32_t table_id, + struct table_rule_match *match, + struct rte_table_action_ttl_counters *stats, + int clear); + +int +pipeline_table_rule_time_read(const char *pipeline_name, + uint32_t table_id, + struct table_rule_match *match, + uint64_t *timestamp); + +struct table_rule * +table_rule_find(struct table *table, + struct table_rule_match *match); + +void +table_rule_add(struct table *table, + struct table_rule *rule); + +void +table_rule_add_bulk(struct table *table, + struct table_rule_list *list, + uint32_t n_rules); + +void +table_rule_delete(struct table *table, + struct table_rule_match *match); + +void +table_rule_default_add(struct table *table, + struct table_rule *rule); + +void +table_rule_default_delete(struct table *table); #endif /* _INCLUDE_PIPELINE_H_ */