af-packet: count only CPUs once

pull/3223/head
Eric Leblond 8 years ago committed by Victor Julien
parent 8030e3f66b
commit 194751654f

@ -314,6 +314,9 @@ static int AFPGetDevFlags(int fd, const char *ifname);
static int AFPDerefSocket(AFPPeer* peer);
static int AFPRefSocket(AFPPeer* peer);
static unsigned int nr_cpus;
/**
* \brief Registration Function for RecieveAFP.
* \todo Unit tests are needed for this module.
@ -330,6 +333,8 @@ void TmModuleReceiveAFPRegister (void)
tmm_modules[TMM_RECEIVEAFP].RegisterTests = NULL;
tmm_modules[TMM_RECEIVEAFP].cap_flags = SC_CAP_NET_RAW;
tmm_modules[TMM_RECEIVEAFP].flags = TM_FLAG_RECEIVE_TM;
nr_cpus = UtilCpuGetNumProcessorsConfigured();
}
@ -2265,7 +2270,6 @@ TmEcode AFPSetBPFFilter(AFPThreadVars *ptv)
*/
static int AFPInsertHalfFlow(int mapd, void *key, uint64_t inittime)
{
unsigned int nr_cpus = UtilCpuGetNumProcessorsConfigured();
struct pair value[nr_cpus];
unsigned int i;

Loading…
Cancel
Save