eal: split compat header file
[dpdk.git] / lib / librte_lpm / rte_lpm.h
index 12c22a6..26303e6 100644 (file)
 #include <stdlib.h>
 #include <rte_branch_prediction.h>
 #include <rte_byteorder.h>
+#include <rte_config.h>
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_vect.h>
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -87,7 +87,7 @@ struct rte_lpm_tbl_entry_v20 {
         */
        uint8_t valid_group :1;
        uint8_t depth       :6; /**< Rule depth. */
-};
+} __rte_aligned(sizeof(uint16_t));
 
 __extension__
 struct rte_lpm_tbl_entry {
@@ -120,7 +120,7 @@ struct rte_lpm_tbl_entry_v20 {
                uint8_t group_idx;
                uint8_t next_hop;
        };
-};
+} __rte_aligned(sizeof(uint16_t));
 
 __extension__
 struct rte_lpm_tbl_entry {
@@ -353,6 +353,10 @@ rte_lpm_lookup(struct rte_lpm *lpm, uint32_t ip, uint32_t *next_hop)
        ptbl = (const uint32_t *)(&lpm->tbl24[tbl24_index]);
        tbl_entry = *ptbl;
 
+       /* Memory ordering is not required in lookup. Because dataflow
+        * dependency exists, compiler or HW won't be able to re-order
+        * the operations.
+        */
        /* Copy tbl8 entry (only if needed) */
        if (unlikely((tbl_entry & RTE_LPM_VALID_EXT_ENTRY_BITMASK) ==
                        RTE_LPM_VALID_EXT_ENTRY_BITMASK)) {
@@ -441,7 +445,7 @@ rte_lpm_lookup_bulk_func(const struct rte_lpm *lpm, const uint32_t *ips,
  * @param hop
  *   Next hop of the most specific rule found for IP (valid on lookup hit only).
  *   This is an 4 elements array of two byte values.
- *   If the lookup was succesfull for the given IP, then least significant byte
+ *   If the lookup was successful for the given IP, then least significant byte
  *   of the corresponding element is the  actual next hop and the most
  *   significant byte is zero.
  *   If the lookup for the given IP failed, then corresponding element would