X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd-jobstats%2Fmain.c;h=9e71ba2d4e507c316006eb395102d12db83caf44;hb=96b37959fb9aa82807a2018017c41c438c7502b2;hp=06280321b1f2084d6333e399d092acee0f4b526f;hpb=04d43857ea3acbd4db4b28939dc2807932b85e72;p=dpdk.git diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 06280321b1..9e71ba2d4e 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -81,7 +80,7 @@ struct lcore_queue_conf { struct rte_jobstats idle_job; struct rte_jobstats_context jobs_context; - rte_atomic16_t stats_read_pending; + uint16_t stats_read_pending; rte_spinlock_t lock; } __rte_cache_aligned; /* >8 End of list of queues to be polled for given lcore. */ @@ -94,7 +93,7 @@ static struct rte_eth_conf port_conf = { .split_hdr_size = 0, }, .txmode = { - .mq_mode = ETH_MQ_TX_NONE, + .mq_mode = RTE_ETH_MQ_TX_NONE, }, }; @@ -155,9 +154,9 @@ show_lcore_stats(unsigned lcore_id) uint64_t collection_time = rte_get_timer_cycles(); /* Ask forwarding thread to give us stats. */ - rte_atomic16_set(&qconf->stats_read_pending, 1); + __atomic_store_n(&qconf->stats_read_pending, 1, __ATOMIC_RELAXED); rte_spinlock_lock(&qconf->lock); - rte_atomic16_set(&qconf->stats_read_pending, 0); + __atomic_store_n(&qconf->stats_read_pending, 0, __ATOMIC_RELAXED); /* Collect context statistics. */ stats_period = ctx->state_time - ctx->start_time; @@ -469,7 +468,7 @@ l2fwd_flush_job(__rte_unused struct rte_timer *timer, __rte_unused void *arg) qconf->next_flush_time[portid] = rte_get_timer_cycles() + drain_tsc; } - /* Pass target to indicate that this job is happy of time interwal + /* Pass target to indicate that this job is happy of time interval * in which it was called. */ rte_jobstats_finish(&qconf->flush_job, qconf->flush_job.target); } @@ -526,8 +525,8 @@ l2fwd_main_loop(void) repeats++; need_manage = qconf->flush_timer.expire < now; /* Check if we was esked to give a stats. */ - stats_read_pending = - rte_atomic16_read(&qconf->stats_read_pending); + stats_read_pending = __atomic_load_n(&qconf->stats_read_pending, + __ATOMIC_RELAXED); need_manage |= stats_read_pending; for (i = 0; i < qconf->n_rx_port && !need_manage; i++) @@ -726,7 +725,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; } @@ -869,9 +868,9 @@ main(int argc, char **argv) "Error during getting device (port %u) info: %s\n", portid, strerror(-ret)); - 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) local_port_conf.txmode.offloads |= - DEV_TX_OFFLOAD_MBUF_FAST_FREE; + RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; /* Configure the RX and TX queues. 8< */ ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf); if (ret < 0)