X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fmain.c;h=b159291d77cee354667ff82d203fa8b4f9c0da93;hb=3cc977704be6d4db3655da5afb2e87f114cd42d3;hp=17b38406fca2885d7fc651002221f6e37a574c64;hpb=a8d0d473a0a89b3c50813e3e144e9a5377429f24;p=dpdk.git diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 17b38406fc..b159291d77 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -51,17 +51,10 @@ static uint32_t enabled_port_mask; static volatile bool force_quit; -/****************/ -static const struct rte_eth_conf port_conf_default = { - .rxmode = { - .max_rx_pkt_len = RTE_ETHER_MAX_LEN, - }, -}; - static inline int port_init(uint16_t port, struct rte_mempool *mbuf_pool) { - struct rte_eth_conf port_conf = port_conf_default; + struct rte_eth_conf port_conf; const uint16_t rx_rings = 1, tx_rings = 1; int retval; uint16_t q; @@ -71,6 +64,8 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) if (!rte_eth_dev_is_valid_port(port)) return -1; + memset(&port_conf, 0, sizeof(struct rte_eth_conf)); + retval = rte_eth_dev_info_get(port, &dev_info); if (retval != 0) { printf("Error during getting device (port %u) info: %s\n", @@ -78,9 +73,9 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) port_conf.txmode.offloads |= - DEV_TX_OFFLOAD_MBUF_FAST_FREE; + RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); @@ -121,10 +116,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned int)port, - addr.addr_bytes[0], addr.addr_bytes[1], - addr.addr_bytes[2], addr.addr_bytes[3], - addr.addr_bytes[4], addr.addr_bytes[5]); + (unsigned int)port, RTE_ETHER_ADDR_BYTES(&addr)); /* Enable RX in promiscuous mode for the Ethernet device. */ retval = rte_eth_promiscuous_enable(port); @@ -206,6 +198,7 @@ parse_args(int argc, char **argv) } if (branch_ratio <= 0.0 || branch_ratio > 100.0) { printf("invalid branch ratio specified\n"); + free(oob_enable); return -1; } for (i = 0; i < ci->core_count; i++) { @@ -277,7 +270,7 @@ check_all_ports_link_status(uint32_t port_mask) continue; } /* clear all_ports_up flag if any link down */ - if (link.link_status == ETH_LINK_DOWN) { + if (link.link_status == RTE_ETH_LINK_DOWN) { all_ports_up = 0; break; } @@ -393,7 +386,7 @@ main(int argc, char **argv) "Cannot init port %"PRIu8 "\n", portid); - for (w = 0; w < MAX_VFS; w++) { + for (w = 0; w < RTE_POWER_MAX_VFS; w++) { eth.addr_bytes[5] = w + 0xf0; ret = -ENOTSUP; @@ -467,5 +460,8 @@ main(int argc, char **argv) free(ci->cd); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; }