X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_pmd_perf.c;h=8f55640dc6a728f6b545641da41a61d7e442cb11;hb=f72a0fa627ac8c6d907bd0035adcb9999560e4c9;hp=1c1f236fd483be8277eb744fbb15ce0d38ca6e69;hpb=002ade70e93391ec43bd3653bfac01253343d111;p=dpdk.git diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 1c1f236fd4..8f55640dc6 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -47,7 +47,6 @@ #define NB_ETHPORTS_USED (1) #define NB_SOCKETS (2) #define MEMPOOL_CACHE_SIZE 250 -#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define MAX_PKT_BURST (32) #define RTE_TEST_RX_DESC_DEFAULT (128) #define RTE_TEST_TX_DESC_DEFAULT (512) @@ -235,8 +234,7 @@ init_traffic(struct rte_mempool *mp, initialize_eth_header(&pkt_eth_hdr, (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, 0, 0); - pkt_eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); + (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, IPV4_ADDR(10, 0, 0, 1), @@ -290,12 +288,9 @@ init_mbufpool(unsigned nb_mbuf) if (mbufpool[socketid] == NULL) { snprintf(s, sizeof(s), "mbuf_pool_%d", socketid); mbufpool[socketid] = - rte_mempool_create(s, nb_mbuf, MBUF_SIZE, - MEMPOOL_CACHE_SIZE, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, - rte_pktmbuf_init, NULL, - socketid, 0); + rte_pktmbuf_pool_create(s, nb_mbuf, + MEMPOOL_CACHE_SIZE, 0, + RTE_MBUF_DEFAULT_BUF_SIZE, socketid); if (mbufpool[socketid] == NULL) rte_exit(EXIT_FAILURE, "Cannot init mbuf pool on socket %d\n", @@ -348,11 +343,8 @@ stats_display(uint8_t port_id) printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: " "%-"PRIu64"\n", stats.ipackets, stats.imissed, stats.ibytes); - printf(" RX-badcrc: %-10"PRIu64" RX-badlen: %-10"PRIu64" RX-errors: " - "%-"PRIu64"\n", - stats.ibadcrc, stats.ibadlen, stats.ierrors); - printf(" RX-nombuf: %-10"PRIu64"\n", - stats.rx_nombuf); + printf(" RX-errors: %-10"PRIu64" RX-nombuf: %-10"PRIu64"\n", + stats.ierrors, stats.rx_nombuf); printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: " "%-"PRIu64"\n", stats.opackets, stats.oerrors, stats.obytes); @@ -592,7 +584,7 @@ poll_burst(void *args) pkts_burst = (struct rte_mbuf **) rte_calloc_socket("poll_burst", total, sizeof(void *), - CACHE_LINE_SIZE, conf->socketid); + RTE_CACHE_LINE_SIZE, conf->socketid); if (!pkts_burst) return -1; @@ -797,7 +789,7 @@ test_pmd_perf(void) rte_calloc_socket("tx_buff", MAX_TRAFFIC_BURST * nb_ports, sizeof(void *), - CACHE_LINE_SIZE, socketid); + RTE_CACHE_LINE_SIZE, socketid); if (!tx_burst) return -1; } @@ -846,10 +838,10 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode) port_conf.rxmode.enable_scatter = 0; return 0; } else if (!strcmp(mode, "scalar")) { - /* bulk alloc rx, simple tx */ - tx_conf.txq_flags = 0xf01; - tx_conf.tx_rs_thresh = 128; - tx_conf.tx_free_thresh = 128; + /* bulk alloc rx, full-featured tx */ + tx_conf.txq_flags = 0; + tx_conf.tx_rs_thresh = 32; + tx_conf.tx_free_thresh = 32; port_conf.rxmode.hw_ip_checksum = 1; port_conf.rxmode.enable_scatter = 0; return 0;