diff options
author | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-02-27 19:20:00 +0000 |
---|---|---|
committer | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2015-03-02 11:47:41 +0530 |
commit | 8ba4a34b9614ea7c75d64d1782e1d04703abfe8b (patch) | |
tree | e39aa1701da43ffa7ffcd97ae872562612119ce4 | |
parent | b65a3f78ccb717377a72f7d39c3bd627bf798f7d (diff) |
packet_dpdk: Fixing up setup_pkt_dpdk
- fixing debug messages
- generate socket_id properly
- enable multicast and promiscuous mode by default
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r-- | platform/linux-dpdk/odp_packet_dpdk.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index 033a1d2aa..6072ba8d6 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -87,13 +87,16 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, uint8_t portid = 0, num_intf = 2; uint16_t nbrxq = 0, nbtxq = 0; int ret, i; + pool_entry_t *pool_entry = get_pool_entry(pool); + int sid = rte_eth_dev_socket_id(portid); + int socket_id = sid < 0 ? 0 : sid; - printf("dpdk netdev: %s\n", netdev); - printf("dpdk pool: %lx\n", pool); + ODP_DBG("dpdk netdev: %s\n", netdev); + ODP_DBG("dpdk pool: %lx\n", pool); portid = atoi(netdev); pkt_dpdk->portid = portid; pkt_dpdk->pool = pool; - printf("dpdk portid: %u\n", portid); + ODP_DBG("dpdk portid: %u\n", portid); nbrxq = odp_sys_core_count() / num_intf; nbtxq = nbrxq; @@ -118,8 +121,8 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, fflush(stdout); for (i = 0; i < nbrxq; i++) { ret = rte_eth_rx_queue_setup(portid, i, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, - (struct rte_mempool *)pool); + socket_id, &rx_conf, + pool_entry->s.rte_mempool); if (ret < 0) ODP_ERR("%s rxq:err=%d, port=%u\n", __func__, ret, (unsigned) portid); @@ -130,7 +133,7 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, fflush(stdout); for (i = 0; i < nbtxq; i++) { ret = rte_eth_tx_queue_setup(portid, i, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); + socket_id, &tx_conf); if (ret < 0) ODP_ERR("%s txq:err=%d, port=%u\n", __func__, ret, (unsigned) portid); @@ -142,6 +145,10 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, if (ret < 0) ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", ret, (unsigned) portid); + + rte_eth_promiscuous_enable(portid); + rte_eth_allmulticast_enable(portid); + ODP_DBG("dpdk setup done\n\n"); portinit[portid] = 1; |