teddy: remove extra control ptr

This commit is contained in:
Justin Viiret 2016-07-06 09:22:31 +10:00 committed by Matthew Barr
parent 85f049edb2
commit b6a77b7329
3 changed files with 58 additions and 77 deletions

View File

@ -82,12 +82,12 @@ do { \
u64a hi = movq(rshiftbyte_m128(var, 8)); \ u64a hi = movq(rshiftbyte_m128(var, 8)); \
if (unlikely(lo)) { \ if (unlikely(lo)) { \
conf_fn(&lo, bucket, offset, confBase, reason, a, ptr, \ conf_fn(&lo, bucket, offset, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(hi)) { \ if (unlikely(hi)) { \
conf_fn(&hi, bucket, offset + 8, confBase, reason, a, ptr, \ conf_fn(&hi, bucket, offset + 8, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
} \ } \
@ -102,22 +102,22 @@ do { \
u32 part4 = movd(rshiftbyte_m128(var, 12)); \ u32 part4 = movd(rshiftbyte_m128(var, 12)); \
if (unlikely(part1)) { \ if (unlikely(part1)) { \
conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \ conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part2)) { \ if (unlikely(part2)) { \
conf_fn(&part2, bucket, offset + 4, confBase, reason, a, ptr, \ conf_fn(&part2, bucket, offset + 4, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part3)) { \ if (unlikely(part3)) { \
conf_fn(&part3, bucket, offset + 8, confBase, reason, a, ptr, \ conf_fn(&part3, bucket, offset + 8, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part4)) { \ if (unlikely(part4)) { \
conf_fn(&part4, bucket, offset + 12, confBase, reason, a, ptr, \ conf_fn(&part4, bucket, offset + 12, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
} \ } \
@ -182,8 +182,7 @@ hwlm_error_t fdr_exec_teddy_msks1(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -229,7 +228,7 @@ hwlm_error_t fdr_exec_teddy_msks1(const struct FDR *fdr,
m128 r_0 = prep_conf_teddy_m1(maskBase, p_mask, val_0); m128 r_0 = prep_conf_teddy_m1(maskBase, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit1_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit1_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -237,8 +236,7 @@ hwlm_error_t fdr_exec_teddy_msks1_pck(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -284,7 +282,7 @@ hwlm_error_t fdr_exec_teddy_msks1_pck(const struct FDR *fdr,
m128 r_0 = prep_conf_teddy_m1(maskBase, p_mask, val_0); m128 r_0 = prep_conf_teddy_m1(maskBase, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -292,8 +290,7 @@ hwlm_error_t fdr_exec_teddy_msks2(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -343,7 +340,7 @@ hwlm_error_t fdr_exec_teddy_msks2(const struct FDR *fdr,
m128 r_0 = prep_conf_teddy_m2(maskBase, &res_old_1, p_mask, val_0); m128 r_0 = prep_conf_teddy_m2(maskBase, &res_old_1, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -351,8 +348,7 @@ hwlm_error_t fdr_exec_teddy_msks2_pck(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -402,7 +398,7 @@ hwlm_error_t fdr_exec_teddy_msks2_pck(const struct FDR *fdr,
m128 r_0 = prep_conf_teddy_m2(maskBase, &res_old_1, p_mask, val_0); m128 r_0 = prep_conf_teddy_m2(maskBase, &res_old_1, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -410,8 +406,7 @@ hwlm_error_t fdr_exec_teddy_msks3(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -464,7 +459,7 @@ hwlm_error_t fdr_exec_teddy_msks3(const struct FDR *fdr,
p_mask, val_0); p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -472,8 +467,7 @@ hwlm_error_t fdr_exec_teddy_msks3_pck(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -526,7 +520,7 @@ hwlm_error_t fdr_exec_teddy_msks3_pck(const struct FDR *fdr,
p_mask, val_0); p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -534,8 +528,7 @@ hwlm_error_t fdr_exec_teddy_msks4(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -589,7 +582,7 @@ hwlm_error_t fdr_exec_teddy_msks4(const struct FDR *fdr,
&res_old_3, p_mask, val_0); &res_old_3, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -597,8 +590,7 @@ hwlm_error_t fdr_exec_teddy_msks4_pck(const struct FDR *fdr,
const struct FDR_Runtime_Args *a) { const struct FDR_Runtime_Args *a) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -652,6 +644,6 @@ hwlm_error_t fdr_exec_teddy_msks4_pck(const struct FDR *fdr,
&res_old_3, p_mask, val_0); &res_old_3, p_mask, val_0);
CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy); CONFIRM_TEDDY(r_0, 8, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }

View File

@ -121,22 +121,22 @@ do { \
u64a part4 = extract64from256(r, 1); \ u64a part4 = extract64from256(r, 1); \
if (unlikely(part1)) { \ if (unlikely(part1)) { \
conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \ conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part2)) { \ if (unlikely(part2)) { \
conf_fn(&part2, bucket, offset + 4, confBase, reason, a, ptr, \ conf_fn(&part2, bucket, offset + 4, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part3)) { \ if (unlikely(part3)) { \
conf_fn(&part3, bucket, offset + 8, confBase, reason, a, ptr, \ conf_fn(&part3, bucket, offset + 8, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part4)) { \ if (unlikely(part4)) { \
conf_fn(&part4, bucket, offset + 12, confBase, reason, a, ptr, \ conf_fn(&part4, bucket, offset + 12, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
} \ } \
@ -158,41 +158,41 @@ do { \
u32 part8 = extract32from256(r, 3); \ u32 part8 = extract32from256(r, 3); \
if (unlikely(part1)) { \ if (unlikely(part1)) { \
conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \ conf_fn(&part1, bucket, offset, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part2)) { \ if (unlikely(part2)) { \
conf_fn(&part2, bucket, offset + 2, confBase, reason, a, ptr, \ conf_fn(&part2, bucket, offset + 2, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
} \ } \
if (unlikely(part3)) { \ if (unlikely(part3)) { \
conf_fn(&part3, bucket, offset + 4, confBase, reason, a, ptr, \ conf_fn(&part3, bucket, offset + 4, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part4)) { \ if (unlikely(part4)) { \
conf_fn(&part4, bucket, offset + 6, confBase, reason, a, ptr, \ conf_fn(&part4, bucket, offset + 6, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part5)) { \ if (unlikely(part5)) { \
conf_fn(&part5, bucket, offset + 8, confBase, reason, a, ptr, \ conf_fn(&part5, bucket, offset + 8, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part6)) { \ if (unlikely(part6)) { \
conf_fn(&part6, bucket, offset + 10, confBase, reason, a, ptr, \ conf_fn(&part6, bucket, offset + 10, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part7)) { \ if (unlikely(part7)) { \
conf_fn(&part7, bucket, offset + 12, confBase, reason, a, ptr, \ conf_fn(&part7, bucket, offset + 12, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
if (unlikely(part8)) { \ if (unlikely(part8)) { \
conf_fn(&part8, bucket, offset + 14, confBase, reason, a, ptr, \ conf_fn(&part8, bucket, offset + 14, confBase, reason, a, ptr, \
control, &last_match); \ &control, &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
} \ } \
@ -208,7 +208,7 @@ do { \
bit_array_fast_teddy(lo, bitArr, &arrCnt, offset); \ bit_array_fast_teddy(lo, bitArr, &arrCnt, offset); \
bit_array_fast_teddy(hi, bitArr, &arrCnt, offset + 2); \ bit_array_fast_teddy(hi, bitArr, &arrCnt, offset + 2); \
for (u32 i = 0; i < arrCnt; i++) { \ for (u32 i = 0; i < arrCnt; i++) { \
conf_fn(bitArr[i], confBase, reason, a, ptr, control, \ conf_fn(bitArr[i], confBase, reason, a, ptr, &control, \
&last_match); \ &last_match); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
@ -484,8 +484,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -532,7 +531,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks1_fat(const struct FDR *fdr,
m256 r_0 = prep_conf_fat_teddy_m1(maskBase, p_mask, val_0); m256 r_0 = prep_conf_fat_teddy_m1(maskBase, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit1_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit1_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -540,8 +539,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -588,7 +586,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fat(const struct FDR *fdr,
m256 r_0 = prep_conf_fat_teddy_m1(maskBase, p_mask, val_0); m256 r_0 = prep_conf_fat_teddy_m1(maskBase, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -596,8 +594,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -647,7 +644,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks2_fat(const struct FDR *fdr,
m256 r_0 = prep_conf_fat_teddy_m2(maskBase, &res_old_1, p_mask, val_0); m256 r_0 = prep_conf_fat_teddy_m2(maskBase, &res_old_1, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -655,8 +652,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -706,7 +702,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks2_pck_fat(const struct FDR *fdr,
m256 r_0 = prep_conf_fat_teddy_m2(maskBase, &res_old_1, p_mask, val_0); m256 r_0 = prep_conf_fat_teddy_m2(maskBase, &res_old_1, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -714,8 +710,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -768,7 +763,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks3_fat(const struct FDR *fdr,
p_mask, val_0); p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -776,8 +771,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -830,7 +824,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks3_pck_fat(const struct FDR *fdr,
p_mask, val_0); p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -838,8 +832,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -896,7 +889,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks4_fat(const struct FDR *fdr,
&res_old_3, p_mask, val_0); &res_old_3, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBitMany_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -904,8 +897,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -962,7 +954,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks4_pck_fat(const struct FDR *fdr,
&res_old_3, p_mask, val_0); &res_old_3, p_mask, val_0);
CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy); CONFIRM_FAT_TEDDY(r_0, 16, 0, VECTORING, do_confWithBit_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -970,8 +962,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -1032,7 +1023,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks1_fast(const struct FDR *fdr,
p_mask); p_mask);
CONFIRM_FAST_TEDDY(res_0, 0, VECTORING, do_confWithBit1_fast_teddy); CONFIRM_FAST_TEDDY(res_0, 0, VECTORING, do_confWithBit1_fast_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }
@ -1040,8 +1031,7 @@ 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) {
const u8 *buf_end = a->buf + a->len; const u8 *buf_end = a->buf + a->len;
const u8 *ptr = a->buf + a->start_offset; const u8 *ptr = a->buf + a->start_offset;
hwlmcb_rv_t controlVal = *a->groups; hwlmcb_rv_t control = *a->groups;
hwlmcb_rv_t *control = &controlVal;
u32 floodBackoff = FLOOD_BACKOFF_START; u32 floodBackoff = FLOOD_BACKOFF_START;
const u8 *tryFloodDetect = a->firstFloodDetect; const u8 *tryFloodDetect = a->firstFloodDetect;
u32 last_match = (u32)-1; u32 last_match = (u32)-1;
@ -1102,7 +1092,7 @@ hwlm_error_t fdr_exec_teddy_avx2_msks1_pck_fast(const struct FDR *fdr,
p_mask); p_mask);
CONFIRM_FAST_TEDDY(res_0, 0, VECTORING, do_confWithBit_fast_teddy); CONFIRM_FAST_TEDDY(res_0, 0, VECTORING, do_confWithBit_fast_teddy);
} }
*a->groups = controlVal; *a->groups = control;
return HWLM_SUCCESS; return HWLM_SUCCESS;
} }

View File

@ -51,8 +51,8 @@ extern const u8 ALIGN_DIRECTIVE p_mask_arr[17][32];
#define CHECK_HWLM_TERMINATE_MATCHING \ #define CHECK_HWLM_TERMINATE_MATCHING \
do { \ do { \
if (unlikely(controlVal == HWLM_TERMINATE_MATCHING)) { \ if (unlikely(control == HWLM_TERMINATE_MATCHING)) { \
*a->groups = controlVal; \ *a->groups = control; \
return HWLM_TERMINATED; \ return HWLM_TERMINATED; \
} \ } \
} while (0); } while (0);
@ -61,8 +61,7 @@ do { \
do { \ do { \
if (unlikely(ptr > tryFloodDetect)) { \ if (unlikely(ptr > tryFloodDetect)) { \
tryFloodDetect = floodDetect(fdr, a, &ptr, tryFloodDetect, \ tryFloodDetect = floodDetect(fdr, a, &ptr, tryFloodDetect, \
&floodBackoff, &controlVal, \ &floodBackoff, &control, iterBytes); \
iterBytes); \
CHECK_HWLM_TERMINATE_MATCHING; \ CHECK_HWLM_TERMINATE_MATCHING; \
} \ } \
} while (0); } while (0);