vdpa/sfc: get max supported queue count
[dpdk.git] / app / test / test_pmd_perf.c
index 4db816a..1df86ce 100644 (file)
@@ -62,12 +62,11 @@ static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
 
 static struct rte_eth_conf port_conf = {
        .rxmode = {
-               .mq_mode = ETH_MQ_RX_NONE,
-               .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+               .mq_mode = RTE_ETH_MQ_RX_NONE,
                .split_hdr_size = 0,
        },
        .txmode = {
-               .mq_mode = ETH_MQ_TX_NONE,
+               .mq_mode = RTE_ETH_MQ_TX_NONE,
        },
        .lpbk_mode = 1,  /* enable loopback */
 };
@@ -156,7 +155,7 @@ check_all_ports_link_status(uint16_t port_num, 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;
                        }
@@ -606,10 +605,10 @@ timeout:
 static int
 exec_burst(uint32_t flags, int lcore)
 {
-       unsigned i, portid, nb_tx = 0;
+       unsigned int portid, nb_tx = 0;
        struct lcore_conf *conf;
        uint32_t pkt_per_port;
-       int num, idx = 0;
+       int num, i, idx = 0;
        int diff_tsc;
 
        conf = &lcore_conf[lcore];
@@ -628,16 +627,14 @@ exec_burst(uint32_t flags, int lcore)
                rte_atomic64_set(&start, 1);
 
        /* start xmit */
+       i = 0;
        while (num) {
                nb_tx = RTE_MIN(MAX_PKT_BURST, num);
-               for (i = 0; i < conf->nb_ports; i++) {
-                       portid = conf->portlist[i];
-                       nb_tx = rte_eth_tx_burst(portid, 0,
-                                        &tx_burst[idx], nb_tx);
-                       idx += nb_tx;
-                       num -= nb_tx;
-               }
-
+               portid = conf->portlist[i];
+               nb_tx = rte_eth_tx_burst(portid, 0, &tx_burst[idx], nb_tx);
+               idx += nb_tx;
+               num -= nb_tx;
+               i = (i >= conf->nb_ports - 1) ? 0 : (i + 1);
        }
 
        sleep(5);
@@ -825,7 +822,7 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode)
                /* bulk alloc rx, full-featured tx */
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM;
+               port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_CHECKSUM;
                return 0;
        } else if (!strcmp(mode, "hybrid")) {
                /* bulk alloc rx, vector tx
@@ -834,13 +831,13 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode)
                 */
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM;
+               port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_CHECKSUM;
                return 0;
        } else if (!strcmp(mode, "full")) {
                /* full feature rx,tx pair */
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SCATTER;
+               port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_SCATTER;
                return 0;
        }