X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_sched%2Fmain.c;h=e7c97bd64237c1d4fe75b8c25c9b9819afe7c4e4;hb=50e73d051806f2ef4526fe4d33cc8e0c5761e7db;hp=19a4f85ac74a961681180fb82611c86fbd58d2bf;hpb=add720fce99710cda6a2a7aeba59a9da85ef9a33;p=dpdk.git diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index 19a4f85ac7..e7c97bd642 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -1,34 +1,5 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation */ #include @@ -125,8 +96,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -135,13 +105,13 @@ app_main_loop(__attribute__((unused))void *dummy) else if (mode == (APP_TX_MODE | APP_WT_MODE)) { for (i = 0; i < wt_idx; i++) { wt_confs[i]->m_table = rte_malloc("table_wt", sizeof(struct rte_mbuf *) - * burst_conf.tx_burst, CACHE_LINE_SIZE); + * burst_conf.tx_burst, RTE_CACHE_LINE_SIZE); if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", i, lcore_id, wt_confs[i]->tx_port); } @@ -150,13 +120,12 @@ app_main_loop(__attribute__((unused))void *dummy) else if (mode == APP_TX_MODE) { for (i = 0; i < tx_idx; i++) { tx_confs[i]->m_table = rte_malloc("table_tx", sizeof(struct rte_mbuf *) - * burst_conf.tx_burst, CACHE_LINE_SIZE); + * burst_conf.tx_burst, RTE_CACHE_LINE_SIZE); if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", i, lcore_id, tx_confs[i]->tx_port); } @@ -186,7 +155,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,14 +164,12 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); memcpy(&tx_stats[i], &stats, sizeof(stats)); - //printf("MP = %d\n", rte_mempool_count(conf->app_pktmbuf_pool)); - #if APP_COLLECT_STAT printf("-------+------------+------------+\n"); printf(" | received | dropped |\n"); @@ -223,7 +190,7 @@ app_stat(void) } int -MAIN(int argc, char **argv) +main(int argc, char **argv) { int ret; @@ -252,4 +219,3 @@ MAIN(int argc, char **argv) return 0; } -