X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=test%2Ftest%2Ftest_pmd_perf.c;h=f5095c87d16042bdfbe7ed3505624df86d4a9c5c;hb=fc2c498ccb94;hp=73992940186bffc7bc2a7634fed3fd55f811f497;hpb=e2887d5f5796d648af79a77cda62bff7e8bf4249;p=dpdk.git diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index 7399294018..f5095c87d1 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -19,8 +19,8 @@ #define NB_SOCKETS (2) #define MEMPOOL_CACHE_SIZE 250 #define MAX_PKT_BURST (32) -#define RTE_TEST_RX_DESC_DEFAULT (128) -#define RTE_TEST_TX_DESC_DEFAULT (512) +#define RTE_TEST_RX_DESC_DEFAULT (1024) +#define RTE_TEST_TX_DESC_DEFAULT (1024) #define RTE_PORT_ALL (~(uint16_t)0x0) /* how long test would take at full line rate */ @@ -65,14 +65,6 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_NONE, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload enabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .hw_vlan_strip = 0, /**< VLAN strip enabled. */ - .hw_vlan_extend = 0, /**< Extended VLAN disabled. */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ - .enable_scatter = 0, /**< scatter rx disabled */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -97,11 +89,6 @@ static struct rte_eth_txconf tx_conf = { }, .tx_free_thresh = 32, /* Use PMD default values */ .tx_rs_thresh = 32, /* Use PMD default values */ - .txq_flags = (ETH_TXQ_FLAGS_NOMULTSEGS | - ETH_TXQ_FLAGS_NOVLANOFFL | - ETH_TXQ_FLAGS_NOXSUMSCTP | - ETH_TXQ_FLAGS_NOXSUMUDP | - ETH_TXQ_FLAGS_NOXSUMTCP) }; enum { @@ -292,10 +279,10 @@ alloc_lcore(uint16_t socketid) return (uint16_t)-1; } -volatile uint64_t stop; -uint64_t count; -uint64_t drop; -uint64_t idle; +static volatile uint64_t stop; +static uint64_t count; +static uint64_t drop; +static uint64_t idle; static void reset_count(void) @@ -528,7 +515,7 @@ main_loop(__rte_unused void *args) return 0; } -rte_atomic64_t start; +static rte_atomic64_t start; static inline int poll_burst(void *args) @@ -676,7 +663,7 @@ test_pmd_perf(void) signal(SIGUSR1, signal_handler); signal(SIGUSR2, signal_handler); - nb_ports = rte_eth_dev_count(); + nb_ports = rte_eth_dev_count_avail(); if (nb_ports < NB_ETHPORTS_USED) { printf("At least %u port(s) used for perf. test\n", NB_ETHPORTS_USED); @@ -698,7 +685,7 @@ test_pmd_perf(void) reset_count(); num = 0; - for (portid = 0; portid < nb_ports; portid++) { + RTE_ETH_FOREACH_DEV(portid) { if (socketid == -1) { socketid = rte_eth_dev_socket_id(portid); slave_id = alloc_lcore(socketid); @@ -791,7 +778,7 @@ test_pmd_perf(void) return -1; /* port tear down */ - for (portid = 0; portid < nb_ports; portid++) { + RTE_ETH_FOREACH_DEV(portid) { if (socketid != rte_eth_dev_socket_id(portid)) continue; @@ -808,38 +795,29 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode) if (!strcmp(mode, "vector")) { /* vector rx, tx */ - tx_conf.txq_flags = 0xf01; tx_conf.tx_rs_thresh = 32; tx_conf.tx_free_thresh = 32; - port_conf.rxmode.hw_ip_checksum = 0; - port_conf.rxmode.enable_scatter = 0; return 0; } else if (!strcmp(mode, "scalar")) { /* 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; + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM; return 0; } else if (!strcmp(mode, "hybrid")) { /* bulk alloc rx, vector tx * when vec macro not define, * using the same rx/tx as scalar */ - tx_conf.txq_flags = 0xf01; 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; + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM; return 0; } else if (!strcmp(mode, "full")) { /* full feature rx,tx pair */ - tx_conf.txq_flags = 0x0; /* must condition */ tx_conf.tx_rs_thresh = 32; tx_conf.tx_free_thresh = 32; - port_conf.rxmode.hw_ip_checksum = 0; - port_conf.rxmode.enable_scatter = 1; /* must condition */ + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SCATTER; return 0; }