X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_fib%2Frte_fib.h;h=acad20963c936d0dc4989973d74a5648d2b10dae;hb=2b9a66e1b606d3813d72dd81c626949e09706e27;hp=a58ac3caea8cdbf1e1166bd6752103188c8ccbef;hpb=4f66d3be5654990c2f0df948f1a3cc895e9cbfbf;p=dpdk.git diff --git a/lib/librte_fib/rte_fib.h b/lib/librte_fib/rte_fib.h index a58ac3caea..acad20963c 100644 --- a/lib/librte_fib/rte_fib.h +++ b/lib/librte_fib/rte_fib.h @@ -19,6 +19,8 @@ * for IPv4 Longest Prefix Match */ +#include + #include #ifdef __cplusplus @@ -57,6 +59,25 @@ enum rte_fib_dir24_8_nh_sz { RTE_FIB_DIR24_8_8B }; +/** Type of lookup function implementation */ +enum rte_fib_lookup_type { + RTE_FIB_LOOKUP_DEFAULT, + /**< Selects the best implementation based on the max simd bitwidth */ + RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO, + /**< Macro based lookup function */ + RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE, + /**< + * Lookup implementation using inlined functions + * for different next hop sizes + */ + RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI, + /**< + * Unified lookup function for all next hop sizes + */ + RTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512 + /**< Vector implementation using AVX512 */ +}; + /** FIB configuration structure */ struct rte_fib_conf { enum rte_fib_type type; /**< Type of FIB struct */ @@ -195,6 +216,22 @@ __rte_experimental struct rte_rib * rte_fib_get_rib(struct rte_fib *fib); +/** + * Set lookup function based on type + * + * @param fib + * FIB object handle + * @param type + * type of lookup function + * + * @return + * 0 on success + * -EINVAL on failure + */ +__rte_experimental +int +rte_fib_select_lookup(struct rte_fib *fib, enum rte_fib_lookup_type type); + #ifdef __cplusplus } #endif