update copyright date to 2013
[dpdk.git] / lib / librte_hash / rte_fbk_hash.h
index 2d16046..93160b2 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without 
@@ -30,7 +30,6 @@
  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * 
- *  version: DPDK.L.1.2.3-3
  */
 
 #ifndef _RTE_FBK_HASH_H_
@@ -49,7 +48,6 @@
 #include <stdint.h>
 #include <errno.h>
 #include <sys/queue.h>
-#include <rte_hash_crc.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -58,8 +56,14 @@ extern "C" {
 #include <string.h>
 
 #ifndef RTE_FBK_HASH_FUNC_DEFAULT
+#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
+#include <rte_hash_crc.h>
 /** Default four-byte key hash function if none is specified. */
 #define RTE_FBK_HASH_FUNC_DEFAULT              rte_hash_crc_4byte
+#else
+#include <rte_jhash.h>
+#define RTE_FBK_HASH_FUNC_DEFAULT              rte_jhash_1word
+#endif
 #endif
 
 #ifndef RTE_FBK_HASH_INIT_VAL_DEFAULT
@@ -97,7 +101,7 @@ union rte_fbk_hash_entry {
                uint16_t value;         /**< Value returned by lookup. */
                uint32_t key;           /**< Key used to find value. */
        } entry;                        /**< For accessing each entry part. */
-} ;
+};
 
 
 
@@ -179,7 +183,7 @@ rte_fbk_hash_add_key(struct rte_fbk_hash_table *ht,
                }
        }
 
-       return -ENOSPC; /* No space in bucket. */
+       return -ENOSPC; /* No space in bucket. */       
 }
 
 /**