doc: add Meson coding style to contributors guide
[dpdk.git] / lib / librte_fib / rte_fib6.h
index bbfcf23..0e193b8 100644 (file)
@@ -19,6 +19,8 @@
  * for IPv6 Longest Prefix Match
  */
 
+#include <stdint.h>
+
 #include <rte_compat.h>
 
 #ifdef __cplusplus
@@ -35,8 +37,7 @@ struct rte_rib6;
 /** Type of FIB struct */
 enum rte_fib6_type {
        RTE_FIB6_DUMMY,         /**< RIB6 tree based FIB */
-       RTE_FIB6_TRIE,          /**< TRIE based fib  */
-       RTE_FIB6_TYPE_MAX
+       RTE_FIB6_TRIE           /**< TRIE based fib  */
 };
 
 /** Modify FIB function */
@@ -53,12 +54,21 @@ enum rte_fib6_op {
        RTE_FIB6_DEL,
 };
 
+/** Size of nexthop (1 << nh_sz) bits for TRIE based FIB */
 enum rte_fib_trie_nh_sz {
        RTE_FIB6_TRIE_2B = 1,
        RTE_FIB6_TRIE_4B,
        RTE_FIB6_TRIE_8B
 };
 
+/** Type of lookup function implementation */
+enum rte_fib6_lookup_type {
+       RTE_FIB6_LOOKUP_DEFAULT,
+       /**< Selects the best implementation based on the max simd bitwidth */
+       RTE_FIB6_LOOKUP_TRIE_SCALAR, /**< Scalar lookup function implementation*/
+       RTE_FIB6_LOOKUP_TRIE_VECTOR_AVX512 /**< Vector implementation using AVX512 */
+};
+
 /** FIB configuration structure */
 struct rte_fib6_conf {
        enum rte_fib6_type type; /**< Type of FIB struct */
@@ -201,6 +211,22 @@ __rte_experimental
 struct rte_rib6 *
 rte_fib6_get_rib(struct rte_fib6 *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_fib6_select_lookup(struct rte_fib6 *fib, enum rte_fib6_lookup_type type);
+
 #ifdef __cplusplus
 }
 #endif