/*-
* 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
*/
#include <stdio.h>
#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)
#include <rte_hash.h>
-#include <rte_hash_crc.h>
-#include <rte_jhash.h>
#elif (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)
#include <rte_lpm.h>
#else
.rx_adv_conf = {
.rss_conf = {
.rss_key = NULL,
- .rss_hf = ETH_RSS_IPV4,
+ .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
},
},
.txmode = {
+ .mq_mode = ETH_MQ_TX_NONE,
},
};
#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)
+
+#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
+#include <rte_hash_crc.h>
+#define DEFAULT_HASH_FUNC rte_hash_crc
+#else
+#include <rte_jhash.h>
+#define DEFAULT_HASH_FUNC rte_jhash
+#endif
+
struct ipv4_5tuple {
uint32_t ip_dst;
uint32_t ip_src;
.entries = L3FWD_HASH_ENTRIES,
.bucket_entries = 4,
.key_len = sizeof(struct ipv4_5tuple),
- .hash_func = rte_hash_crc,
+ .hash_func = DEFAULT_HASH_FUNC,
.hash_func_init_val = 0,
.socket_id = SOCKET0,
};
if (dst_port >= MAX_PORTS || (enabled_port_mask & 1 << dst_port) == 0)
dst_port = portid;
- /* 00:09:c0:00:00:xx */
+ /* 02:00:00:00:00:xx */
tmp = ð_hdr->d_addr.addr_bytes[0];
- *((uint64_t *)tmp) = 0x000000c00900 + (dst_port << 24);
+ *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
#ifdef DO_RFC_1812_CHECKS
/* Update time to live and header checksum */
/* create the LPM table */
rte_snprintf(s, sizeof(s), "L3FWD_LPM_%d", socketid);
l3fwd_lookup_struct[socketid] = rte_lpm_create(s, socketid,
- L3FWD_LPM_MAX_RULES, RTE_LPM_MEMZONE);
+ L3FWD_LPM_MAX_RULES, 0);
if (l3fwd_lookup_struct[socketid] == NULL)
rte_exit(EXIT_FAILURE, "Unable to create the l3fwd LPM table"
" on socket %d\n", socketid);
rte_exit(EXIT_FAILURE, "init_mem failed\n");
/* init driver */
-#ifdef RTE_LIBRTE_IGB_PMD
- if (rte_igb_pmd_init() < 0)
- rte_exit(EXIT_FAILURE, "Cannot init igb pmd\n");
-#endif
-#ifdef RTE_LIBRTE_IXGBE_PMD
- if (rte_ixgbe_pmd_init() < 0)
- rte_exit(EXIT_FAILURE, "Cannot init ixgbe pmd\n");
-
- if (rte_ixgbevf_pmd_init() < 0)
- rte_exit(EXIT_FAILURE, "Cannot init ixgbevf pmd\n");
-#endif
+ if (rte_pmd_init_all() < 0)
+ rte_exit(EXIT_FAILURE, "Cannot init pmd\n");
if (rte_eal_pci_probe() < 0)
rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");