static never_inline
hwlm_error_t fdr_engine_exec(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
- hwlmcb_rv_t control = *a->groups;
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
u32 floodBackoff = FLOOD_BACKOFF_START;
u32 last_match_id = INVALID_MATCH_ID;
u64a domain_mask_adjusted = fdr->domainMask << 1;
#define ONLY_AVX2(func) NULL
#endif
-typedef hwlm_error_t (*FDRFUNCTYPE)(const struct FDR *fdr, const struct FDR_Runtime_Args *a);
+typedef hwlm_error_t (*FDRFUNCTYPE)(const struct FDR *fdr,
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
+
static const FDRFUNCTYPE funcs[] = {
fdr_engine_exec,
ONLY_AVX2(fdr_exec_teddy_avx2_msks1_fast),
start,
cb,
ctxt,
- &groups,
nextFloodDetect(buf, len, FLOOD_BACKOFF_START),
0
};
return HWLM_SUCCESS;
} else {
assert(funcs[fdr->engineID]);
- return funcs[fdr->engineID](fdr, &a);
+ return funcs[fdr->engineID](fdr, &a, groups);
}
}
start,
cb,
ctxt,
- &groups,
nextFloodDetect(buf, len, FLOOD_BACKOFF_START),
/* we are guaranteed to always have 16 initialised bytes at the end of
* the history buffer (they may be garbage). */
ret = HWLM_SUCCESS;
} else {
assert(funcs[fdr->engineID]);
- ret = funcs[fdr->engineID](fdr, &a);
+ ret = funcs[fdr->engineID](fdr, &a, groups);
}
fdrPackState(fdr, &a, stream_state);
size_t start_offset;
HWLMCallback cb;
void *ctxt;
- hwlm_group_t *groups;
const u8 *firstFloodDetect;
const u64a histBytes;
};
}
hwlm_error_t fdr_exec_teddy_msks1(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks1_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks2(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks2_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks3(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks3_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks4(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_msks4_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
#ifndef TEDDY_H_
#define TEDDY_H_
+#include "hwlm/hwlm.h" // for hwlm_group_t
+
struct FDR; // forward declaration from fdr_internal.h
struct FDR_Runtime_Args;
hwlm_error_t fdr_exec_teddy_msks1(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks1_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks2(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks2_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks3(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks3_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks4(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_msks4_pck(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
#if defined(__AVX2__)
hwlm_error_t fdr_exec_teddy_avx2_msks1_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks2_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks2_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks3_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks3_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks4_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks4_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
hwlm_error_t fdr_exec_teddy_avx2_msks1_fast(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
-hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fast(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a);
+hwlm_error_t
+fdr_exec_teddy_avx2_msks1_pck_fast(const struct FDR *fdr,
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control);
#endif /* __AVX2__ */
}
hwlm_error_t fdr_exec_teddy_avx2_msks1_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks2_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks2_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks3_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks3_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks4_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks4_pck_fat(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks1_fast(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;
}
hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fast(const struct FDR *fdr,
- const struct FDR_Runtime_Args *a) {
+ const struct FDR_Runtime_Args *a,
+ hwlm_group_t control) {
const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset;
- hwlmcb_rv_t control = *a->groups;
u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1;