#include <numa.h>
#define BURST_SIZE 32
+static struct timeval machine_start_time = { 0, 0 };
/**
* \brief Structure to hold thread specific variables.
uint16_t queue_id;
struct rte_mempool *pkt_mempool;
struct rte_mbuf *received_mbufs[BURST_SIZE];
- struct timeval machine_start_time;
} DPDKThreadVars;
static TmEcode ReceiveDPDKThreadInit(ThreadVars *, const void *, void **);
new_tv->tv_usec = (usec % 1000000);
}
-static void DPDKSetTimevalOfMachineStart(struct timeval *tv)
+void DPDKSetTimevalOfMachineStart(void)
{
- gettimeofday(tv, NULL);
- tv->tv_sec -= DPDKGetSeconds();
+ gettimeofday(&machine_start_time, NULL);
+ machine_start_time.tv_sec -= DPDKGetSeconds();
}
/**
p->flags |= PKT_IGNORE_CHECKSUM;
}
- DPDKSetTimevalReal(&ptv->machine_start_time, &p->ts);
+ DPDKSetTimevalReal(&machine_start_time, &p->ts);
p->dpdk_v.mbuf = ptv->received_mbufs[i];
p->ReleasePacket = DPDKReleasePacket;
p->dpdk_v.copy_mode = ptv->copy_mode;
ptv->pkts = 0;
ptv->bytes = 0;
ptv->livedev = LiveGetDevice(dpdk_config->iface);
- DPDKSetTimevalOfMachineStart(&ptv->machine_start_time);
ptv->capture_dpdk_packets = StatsRegisterCounter("capture.packets", ptv->tv);
ptv->capture_dpdk_rx_errs = StatsRegisterCounter("capture.rx_errors", ptv->tv);