test/bonding: fix RSS test when disable RSS
[dpdk.git] / app / test-pmd / flowgen.c
index e027dbe..1e01120 100644 (file)
@@ -24,7 +24,6 @@
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
-#include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
@@ -100,11 +99,11 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 
        tx_offloads = ports[fs->tx_port].dev_conf.txmode.offloads;
        if (tx_offloads & RTE_ETH_TX_OFFLOAD_VLAN_INSERT)
-               ol_flags |= PKT_TX_VLAN;
+               ol_flags |= RTE_MBUF_F_TX_VLAN;
        if (tx_offloads & RTE_ETH_TX_OFFLOAD_QINQ_INSERT)
-               ol_flags |= PKT_TX_QINQ;
+               ol_flags |= RTE_MBUF_F_TX_QINQ;
        if (tx_offloads & RTE_ETH_TX_OFFLOAD_MACSEC_INSERT)
-               ol_flags |= PKT_TX_MACSEC;
+               ol_flags |= RTE_MBUF_F_TX_MACSEC;
 
        for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
                if (!nb_pkt || !nb_clones) {
@@ -152,7 +151,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
                                                                   sizeof(*ip_hdr));
                        pkt->nb_segs            = 1;
                        pkt->pkt_len            = pkt_size;
-                       pkt->ol_flags           &= EXT_ATTACHED_MBUF;
+                       pkt->ol_flags           &= RTE_MBUF_F_EXTERNAL;
                        pkt->ol_flags           |= ol_flags;
                        pkt->vlan_tci           = vlan_tci;
                        pkt->vlan_tci_outer     = vlan_tci_outer;
@@ -208,9 +207,22 @@ flowgen_begin(portid_t pi)
        return 0;
 }
 
+static void
+flowgen_stream_init(struct fwd_stream *fs)
+{
+       bool rx_stopped, tx_stopped;
+
+       rx_stopped = ports[fs->rx_port].rxq[fs->rx_queue].state ==
+                                               RTE_ETH_QUEUE_STATE_STOPPED;
+       tx_stopped = ports[fs->tx_port].txq[fs->tx_queue].state ==
+                                               RTE_ETH_QUEUE_STATE_STOPPED;
+       fs->disabled = rx_stopped || tx_stopped;
+}
+
 struct fwd_engine flow_gen_engine = {
        .fwd_mode_name  = "flowgen",
        .port_fwd_begin = flowgen_begin,
        .port_fwd_end   = NULL,
+       .stream_init    = flowgen_stream_init,
        .packet_fwd     = pkt_burst_flow_gen,
 };