Improve configure messages. Make sure CUDA doesn't try to process packets that are too big.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent e14331cbb2
commit 1fb11e939a

@ -635,7 +635,7 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
])
# enable debug validation functions & macro's output
AC_ARG_ENABLE(debug,
AC_ARG_ENABLE(debug-validation,
AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
AS_IF([test "x$enable_debug_validation" = "xyes"], [
CFLAGS="${CFLAGS} -DDEBUG_VALIDATION"
@ -685,7 +685,7 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
# enable CUDA output
AC_ARG_ENABLE(cuda,
AS_HELP_STRING([--enable-cuda], [Enable CUDA pattern matching]),,[enable_cuda=no])
AS_HELP_STRING([--enable-cuda], [Enable experimental CUDA pattern matching]),,[enable_cuda=no])
AS_IF([test "x$enable_cuda" = "xyes"], [
AC_ARG_WITH(cuda_includes,
[ --with-cuda-includes=DIR cuda include directory],

@ -518,6 +518,13 @@ TmEcode SCCudaPBBatchPackets(ThreadVars *tv, Packet *p, void *data, PacketQueue
* we end up buffering the packet or not */
p->cuda_mpm_enabled = 0;
/* packets that are too big are handled by the cpu */
if (p->payload_len > SC_CUDA_PB_MAX_PAYLOAD_SIZE) {
SCLogDebug("p->payload_len %"PRIu16" > %d, inspecting on the CPU.",
p->payload_len, SC_CUDA_PB_MAX_PAYLOAD_SIZE);
return TM_ECODE_OK;
}
SCCudaPBThreadCtx *tctx = data;
/* the packets buffer */
SCCudaPBPacketsBuffer *pb = (SCCudaPBPacketsBuffer *)tctx->curr_pb;

@ -20,6 +20,9 @@
* be enabling cuda. We will only end up screwing performance */
#define SC_CUDA_PB_MIN_NO_OF_PACKETS 4000
/* the maximum payload size we're sending to the card (defined in decode.h) */
#define SC_CUDA_PB_MAX_PAYLOAD_SIZE CUDA_MAX_PAYLOAD_SIZE
/**
* \brief Implement the template SCDQGenericQData to transfer the cuda
* packet buffer from the cuda batcher thread to the dispatcher
@ -87,7 +90,7 @@ typedef struct SCCudaPBPacketDataForGPU_ {
unsigned int payload_len;
/* holds the payload. While we actually store the payload in the buffer,
* we may not end up using the entire 1480 bytes if the payload is smaller */
uint8_t payload[1480];
uint8_t payload[SC_CUDA_PB_MAX_PAYLOAD_SIZE];
} SCCudaPBPacketDataForGPU;
/**

@ -57,6 +57,10 @@
#include "detect-reference.h"
#ifdef __SC_CUDA_SUPPORT__
#define CUDA_MAX_PAYLOAD_SIZE 1500
#endif
/* forward declaration */
struct DetectionEngineThreadCtx_;
@ -384,7 +388,7 @@ typedef struct Packet_
SCMutex cuda_mutex;
SCCondT cuda_cond;
/* the extra 1 in the 1481, is to hold the no_of_matches from the mpm run */
uint16_t mpm_offsets[1481];
uint16_t mpm_offsets[CUDA_MAX_PAYLOAD_SIZE + 1];
#endif
} Packet;

Loading…
Cancel
Save