Skip to contentSkip to conversation

pipeline: fix multiple emit pattern detection

PATCH Applied Cristian Dumitrescu 2 participants 2 messages Nov 12, 2020 – Nov 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pipeline: fix multiple emit pattern detection

Fix the detection of instruction pattern with multiple emits followed by TX. Once detected, this is one of the instruction patterns that is internally replaced with a single optimized instruction, as long as none of the instructions to be replaced is referenced by a jump instruction. The fix enforces this check for the TX instruction of the pattern.

Fixes 31035e87b207 ("pipeline: add SWX instruction optimizer")
---
 lib/librte_pipeline/rte_swx_pipeline.c | 3 +++
 1 file changed, 3 insertions(+)
lib/librte_pipeline/rte_swx_pipeline.c +3 -0
index fe8bfc8b3..eaaed7a0a 100644
@@ -5796,6 +5796,9 @@ instr_pattern_emit_many_tx_detect(struct instruction *instr,
 	if (instr[i].type != INSTR_TX)
 		return 0;
 
+	if (data[i].n_users)
+		return 0;
+
 	i++;
 
 	*n_pattern_instr = i;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 11 lines · Cristian Dumitrescu

Fix the detection of instruction pattern with multiple emits followed by TX. Once detected, this is one of the instruction patterns that is internally replaced with a single optimized instruction, as long as none of the instructions to be replaced is referenced by a jump instruction. The fix enforces this check for the TX instruction of the pattern.

Fixes 31035e87b207 ("pipeline: add SWX instruction optimizer")

Applied, thanks.

Signature · 1 line
David Marchand