pipeline: fix validate header instruction

Message ID 20221121142438.3740561-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series pipeline: fix validate header instruction |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Cristian Dumitrescu Nov. 21, 2022, 2:24 p.m. UTC
  From: Yogesh Jangra <yogesh.jangra@intel.com>

The exported data structure for the header validate instruction did
not populate its struct_id field, which results in segmentation fault.

Fixes: 216bc906d00 ("pipeline: export pipeline instructions to file")
Cc: stable@dpdk.org

Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/pipeline/rte_swx_pipeline.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon Nov. 22, 2022, 12:32 p.m. UTC | #1
21/11/2022 15:24, Cristian Dumitrescu:
> From: Yogesh Jangra <yogesh.jangra@intel.com>
> 
> The exported data structure for the header validate instruction did
> not populate its struct_id field, which results in segmentation fault.
> 
> Fixes: 216bc906d00 ("pipeline: export pipeline instructions to file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 232dafb95e..0e631dea2b 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -11793,10 +11793,12 @@  instr_hdr_validate_export(struct instruction *instr, FILE *f)
 		"\t\t.type = %s,\n"
 		"\t\t.valid = {\n"
 		"\t\t\t.header_id = %u,\n"
+		"\t\t\t.struct_id = %u,\n"
 		"\t\t},\n"
 		"\t},\n",
 		instr_type_to_name(instr),
-		instr->valid.header_id);
+		instr->valid.header_id,
+		instr->valid.struct_id);
 }
 
 static void