app/testpmd: fix use of indirect action after port close
[dpdk.git] / drivers / net / ark / ark_pktgen.c
index 28a44f7..6195ef9 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <unistd.h>
+#include <pthread.h>
 
 #include <rte_string_fns.h>
 #include <rte_malloc.h>
@@ -106,7 +107,7 @@ ark_pktgen_paused(ark_pkt_gen_t handle)
        struct ark_pkt_gen_inst *inst = (struct ark_pkt_gen_inst *)handle;
        uint32_t r = inst->regs->pkt_start_stop;
 
-       return (((r >> 16) & 1) == 1);
+       return (((r >> 24) & 1) == 1) || (((r >> 16) & 1) == 1)  || (r == 0);
 }
 
 void
@@ -474,6 +475,7 @@ ark_pktgen_delay_start(void *arg)
         * perform a blind sleep here to ensure that the external test
         * application has time to setup the test before we generate packets
         */
+       pthread_detach(pthread_self());
        usleep(100000);
        ark_pktgen_run(inst);
        return NULL;