doc: add Meson coding style to contributors guide
[dpdk.git] / lib / librte_fib / rte_fib6.h
index 4268704..0e193b8 100644 (file)
@@ -8,12 +8,25 @@
 
 /**
  * @file
+ *
+ * RTE FIB6 library.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * FIB (Forwarding information base) implementation
  * for IPv6 Longest Prefix Match
  */
 
+#include <stdint.h>
+
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define RTE_FIB6_IPV6_ADDR_SIZE                16
 /** Maximum depth value possible for IPv6 FIB. */
 #define RTE_FIB6_MAXDEPTH       128
@@ -24,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 */
@@ -42,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 */
@@ -190,4 +211,24 @@ __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
+
 #endif /* _RTE_FIB6_H_ */