From b2455b6afa569a1480651335dc5c8d6bb7c4d1a5 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Fri, 23 Mar 2012 10:17:03 +0530 Subject: [PATCH] cuda pb tm should be in a thread of its own + pkt_acq should be as free as possible --- src/runmode-pcap-file.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/runmode-pcap-file.c b/src/runmode-pcap-file.c index e34d079ed8..4128b02e6c 100644 --- a/src/runmode-pcap-file.c +++ b/src/runmode-pcap-file.c @@ -213,9 +213,9 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx) /* create the threads */ ThreadVars *tv_receivepcap = TmThreadCreatePacketHandler("ReceivePcapFile", - "packetpool", "packetpool", - "stream-queue1", "simple", - "pktacqloop"); + "packetpool", "packetpool", + "cuda-pb", "simple", + "pktacqloop"); if (tv_receivepcap == NULL) { printf("ERROR: TmThreadsCreate failed\n"); exit(EXIT_FAILURE); @@ -236,13 +236,6 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx) } TmSlotSetFuncAppend(tv_receivepcap, tm_module, NULL); - tm_module = TmModuleGetByName("StreamTcp"); - if (tm_module == NULL) { - printf("ERROR: TmModuleGetByName StreamTcp failed\n"); - exit(EXIT_FAILURE); - } - TmSlotSetFuncAppend(tv_receivepcap, tm_module, NULL); - TmThreadSetCPU(tv_receivepcap, DECODE_CPU_SET); if (TmThreadSpawn(tv_receivepcap) != TM_ECODE_OK) { @@ -252,7 +245,7 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx) ThreadVars *tv_cuda_PB = TmThreadCreate("CUDA_PB", - "stream-queue1", "simple", + "cuda-pb", "simple", "detect-queue1", "simple", "custom", SCCudaPBTmThreadsSlot1, 0); if (tv_cuda_PB == NULL) { @@ -266,14 +259,20 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx) printf("ERROR: TmModuleGetByName CudaPacketBatcher failed\n"); exit(EXIT_FAILURE); } - TmSlotSetFuncAppend(tv_cuda_PB, tm_module, (void *)de_ctx); + TmSlotSetFuncAppend(tv_cuda_PB, tm_module, de_ctx); - TmThreadSetCPU(tv_cuda_PB, DETECT_CPU_SET); + tm_module = TmModuleGetByName("StreamTcp"); + if (tm_module == NULL) { + printf("ERROR: TmModuleGetByName StreamTcp failed\n"); + exit(EXIT_FAILURE); + } + TmSlotSetFuncAppend(tv_cuda_PB, tm_module, NULL); if (TmThreadSpawn(tv_cuda_PB) != TM_ECODE_OK) { printf("ERROR: TmThreadSpawn failed\n"); exit(EXIT_FAILURE); } + #endif }