X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fark%2Fark_pktgen.c;h=6195ef997f1c6f5b11411c4a267af7e1a663b5bc;hb=6baa15684c5a2ea3f4d7a6f4cfc7f30d86a51fea;hp=4a02662a46e795e8ab60fa423bcbf8a91c4d7f7d;hpb=1502d443d8857fd473f474a170b81dc30809bdfd;p=dpdk.git diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c index 4a02662a46..6195ef997f 100644 --- a/drivers/net/ark/ark_pktgen.c +++ b/drivers/net/ark/ark_pktgen.c @@ -2,15 +2,10 @@ * Copyright (c) 2015-2018 Atomic Rules LLC */ -#include -#include -#include #include +#include #include -#include - -#include #include #include "ark_pktgen.h" @@ -112,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 @@ -470,3 +465,18 @@ ark_pktgen_setup(ark_pkt_gen_t handle) ark_pktgen_run(handle); } } + +void * +ark_pktgen_delay_start(void *arg) +{ + struct ark_pkt_gen_inst *inst = (struct ark_pkt_gen_inst *)arg; + + /* This function is used exclusively for regression testing, We + * 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; +}