X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd-crypto%2Fmain.c;h=a96cb94cc4bae3ce8f19a73441190ddac2b9df05;hb=70a3ee6bb74ea089751abbc4954ffc850a5ed46e;hp=7c84b40ff501353e08fac7b233659e48460968a8;hpb=22e5c73bd181ddae758189295146154542b63360;p=dpdk.git diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 7c84b40ff5..a96cb94cc4 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -43,7 +43,7 @@ #include #include #include -#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER +#ifdef RTE_CRYPTO_SCHEDULER #include #endif @@ -334,6 +334,8 @@ print_stats(void) total_packets_dropped, total_packets_errors); printf("\n====================================================\n"); + + fflush(stdout); } static int @@ -872,8 +874,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) if (unlikely(timer_tsc >= (uint64_t)timer_period)) { - /* do this only on master core */ - if (lcore_id == rte_get_master_lcore() + /* do this only on main core */ + if (lcore_id == rte_get_main_lcore() && options->refresh_period) { print_stats(); timer_tsc = 0; @@ -1732,6 +1734,7 @@ check_all_ports_link_status(uint32_t port_mask) uint8_t 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); @@ -1751,14 +1754,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", - portid, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex\n")); - else - printf("Port %d Link Down\n", 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 */ @@ -2274,12 +2273,12 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, * (one for the header, one for the private data) */ if (!strcmp(dev_info.driver_name, "crypto_scheduler")) { -#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER - uint32_t nb_slaves = - rte_cryptodev_scheduler_slaves_get(cdev_id, +#ifdef RTE_CRYPTO_SCHEDULER + uint32_t nb_workers = + rte_cryptodev_scheduler_workers_get(cdev_id, NULL); - sessions_needed = enabled_cdev_count * nb_slaves; + sessions_needed = enabled_cdev_count * nb_workers; #endif } else sessions_needed = enabled_cdev_count; @@ -2589,7 +2588,13 @@ initialize_ports(struct l2fwd_crypto_options *options) return -1; } - rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); + retval = rte_eth_macaddr_get(portid, + &l2fwd_ports_eth_addr[portid]); + if (retval < 0) { + printf("rte_eth_macaddr_get :err=%d, port=%u\n", + retval, portid); + return -1; + } printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", portid, @@ -2794,8 +2799,8 @@ main(int argc, char **argv) /* launch per-lcore init on every lcore */ rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, (void *)&options, - CALL_MASTER); - RTE_LCORE_FOREACH_SLAVE(lcore_id) { + CALL_MAIN); + RTE_LCORE_FOREACH_WORKER(lcore_id) { if (rte_eal_wait_lcore(lcore_id) < 0) return -1; }