X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_pipeline%2Frte_table_action.h;h=c7f751aae532c57465731f5de69f359a71b95723;hb=aed545af1b5ed6b7baa2eb41bad63486d6c95226;hp=e9b30ab2fe20aadbf6eddf1cf533aaa092c5bdfe;hpb=2c3558c6bf3db40cf895fff2360572df71f75626;p=dpdk.git diff --git a/lib/librte_pipeline/rte_table_action.h b/lib/librte_pipeline/rte_table_action.h index e9b30ab2fe..c7f751aae5 100644 --- a/lib/librte_pipeline/rte_table_action.h +++ b/lib/librte_pipeline/rte_table_action.h @@ -61,6 +61,7 @@ extern "C" { #include #include #include +#include #include "rte_pipeline.h" @@ -69,6 +70,9 @@ enum rte_table_action_type { /** Forward to next pipeline table, output port or drop. */ RTE_TABLE_ACTION_FWD = 0, + /** Load balance. */ + RTE_TABLE_ACTION_LB, + /** Traffic Metering and Policing. */ RTE_TABLE_ACTION_MTR, @@ -116,6 +120,54 @@ struct rte_table_action_fwd_params { uint32_t id; }; +/** + * RTE_TABLE_ACTION_LB + */ +/** Load balance key size min (number of bytes). */ +#define RTE_TABLE_ACTION_LB_KEY_SIZE_MIN 8 + +/** Load balance key size max (number of bytes). */ +#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX 64 + +/** Load balance table size. */ +#define RTE_TABLE_ACTION_LB_TABLE_SIZE 8 + +/** Load balance action configuration (per table action profile). */ +struct rte_table_action_lb_config { + /** Key size (number of bytes). */ + uint32_t key_size; + + /** Key offset within the input packet buffer. Offset 0 points to the + * first byte of the MBUF structure. + */ + uint32_t key_offset; + + /** Key mask (*key_size* bytes are valid). */ + uint8_t key_mask[RTE_TABLE_ACTION_LB_KEY_SIZE_MAX]; + + /** Hash function. */ + rte_table_hash_op_hash f_hash; + + /** Seed value for *f_hash*. */ + uint64_t seed; + + /** Output value offset within the input packet buffer. Offset 0 points + * to the first byte of the MBUF structure. + */ + uint32_t out_offset; +}; + +/** Load balance action parameters (per table rule). */ +struct rte_table_action_lb_params { + /** Table defining the output values and their weights. The weights are + * set in 1/RTE_TABLE_ACTION_LB_TABLE_SIZE increments. To assign a + * weight of N/RTE_TABLE_ACTION_LB_TABLE_SIZE to a given output value + * (0 <= N <= RTE_TABLE_ACTION_LB_TABLE_SIZE), the same output value + * needs to show up exactly N times in this table. + */ + uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE]; +}; + /** * RTE_TABLE_ACTION_MTR */