/*-
* 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
* (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_
#include <stdint.h>
#include <errno.h>
#include <sys/queue.h>
-#include <rte_hash_crc.h>
#ifdef __cplusplus
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
uint16_t value; /**< Value returned by lookup. */
uint32_t key; /**< Key used to find value. */
} entry; /**< For accessing each entry part. */
-} ;
+};
}
}
- return -ENOSPC; /* No space in bucket. */
+ return -ENOSPC; /* No space in bucket. */
}
/**