X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fmain.c;h=75d5b5364f1ca5bfd2b77f699872c096f16c9b1c;hb=6a2cf58a045f58c9744194f4d44394c7af1a0027;hp=77797b1e164c5f2a07e77df4aa8d7e57286b2988;hpb=95f648ff9eedc11f9c888f2cc331aadb95cb9b47;p=dpdk.git diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 77797b1e16..75d5b5364f 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -31,13 +31,13 @@ #include "vm_power_cli.h" #include "oob_monitor.h" #include "parse.h" -#ifdef RTE_LIBRTE_IXGBE_PMD +#ifdef RTE_NET_IXGBE #include #endif -#ifdef RTE_LIBRTE_I40E_PMD +#ifdef RTE_NET_I40E #include #endif -#ifdef RTE_LIBRTE_BNXT_PMD +#ifdef RTE_NET_BNXT #include #endif @@ -144,10 +144,7 @@ parse_portmask(const char *portmask) /* parse hexadecimal string */ pm = strtoul(portmask, &end, 16); if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0')) - return -1; - - if (pm == 0) - return -1; + return 0; return pm; } @@ -209,6 +206,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++) { @@ -249,6 +247,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid, count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -272,15 +271,10 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf("Port %d Link Up - speed %u " - "Mbps - %s\n", (uint16_t)portid, - (unsigned int)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint16_t)portid); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ @@ -404,16 +398,16 @@ main(int argc, char **argv) eth.addr_bytes[5] = w + 0xf0; ret = -ENOTSUP; -#ifdef RTE_LIBRTE_IXGBE_PMD +#ifdef RTE_NET_IXGBE ret = rte_pmd_ixgbe_set_vf_mac_addr(portid, w, ð); #endif -#ifdef RTE_LIBRTE_I40E_PMD +#ifdef RTE_NET_I40E if (ret == -ENOTSUP) ret = rte_pmd_i40e_set_vf_mac_addr( portid, w, ð); #endif -#ifdef RTE_LIBRTE_BNXT_PMD +#ifdef RTE_NET_BNXT if (ret == -ENOTSUP) ret = rte_pmd_bnxt_set_vf_mac_addr( portid, w, ð);