From d5df09b77201b87ad9356c45ae2ffdb1c67b35d1 Mon Sep 17 00:00:00 2001 From: Fabian Ruffy <5960321+fruffy@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:36:32 +0200 Subject: [PATCH] Update some stale DPDK reference files. Make sure that the dpdk test runner throws an error when the reference file is stale. (#4705) --- backends/dpdk/run-dpdk-test.py | 2 +- .../pna-example-ipsec-err1.p4 | 2 +- .../pna-example-ipsec-err2.p4 | 2 +- .../pna-example-ipsec-err3.p4 | 2 +- .../pna-example-ipsec-err4.p4 | 2 +- .../pna-dpdk-direct-counter-err-1.p4 | 2 +- .../pna-dpdk-direct-counter-err-2.p4 | 2 +- .../pna-dpdk-direct-counter-err-3.p4 | 2 +- .../pna-dpdk-direct-counter-err-4.p4 | 2 +- .../pna-dpdk-direct-counter-err.p4 | 2 +- .../pna-dpdk-direct-meter-err-2.p4 | 2 +- .../pna-dpdk-direct-meter-err-3.p4 | 2 +- .../pna-dpdk-direct-meter-err-4.p4 | 2 +- .../pna-dpdk-direct-meter-err.p4 | 2 +- .../pna-dpdk-direct-counter-err-3.p4-error | 3 +++ .../pna-dpdk-direct-meter-err-4.p4-error | 27 ++++++++++++++++--- 16 files changed, 41 insertions(+), 17 deletions(-) diff --git a/backends/dpdk/run-dpdk-test.py b/backends/dpdk/run-dpdk-test.py index f5ae62e817..c733c671c7 100755 --- a/backends/dpdk/run-dpdk-test.py +++ b/backends/dpdk/run-dpdk-test.py @@ -181,7 +181,7 @@ def check_generated_files(options, tmpdir, expecteddir): result = compare_files(options, produced, expected, file[-6:] == "-error") # We do not want to compare stderr output generated by p4c-dpdk if result != SUCCESS and (file[-6:] == "-error"): - return SUCCESS + return result if result != SUCCESS and not ignoreStderr(options): return result if produced.endswith(".spec") and environ.get("DPDK_PIPELINE") is not None: diff --git a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err1.p4 b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err1.p4 index 5def0ed0f5..0836da47b0 100644 --- a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err1.p4 +++ b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err1.p4 @@ -15,7 +15,7 @@ limitations under the License. */ #include -#include +#include #define inbound(meta) (istd.direction == PNA_Direction_t.NET_TO_HOST) diff --git a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err2.p4 b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err2.p4 index 7611559c64..e1bda36a56 100644 --- a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err2.p4 +++ b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err2.p4 @@ -15,7 +15,7 @@ limitations under the License. */ #include -#include +#include #define inbound(meta) (istd.direction == PNA_Direction_t.NET_TO_HOST) diff --git a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err3.p4 b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err3.p4 index 322a1f0fe0..40eb3481d8 100644 --- a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err3.p4 +++ b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err3.p4 @@ -15,7 +15,7 @@ limitations under the License. */ #include -#include +#include #define inbound(meta) (istd.direction == PNA_Direction_t.NET_TO_HOST) diff --git a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err4.p4 b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err4.p4 index 1c16f82492..03bc26d96f 100644 --- a/testdata/p4_16_dpdk_errors/pna-example-ipsec-err4.p4 +++ b/testdata/p4_16_dpdk_errors/pna-example-ipsec-err4.p4 @@ -15,7 +15,7 @@ limitations under the License. */ #include -#include +#include #define inbound(meta) (istd.direction == PNA_Direction_t.NET_TO_HOST) diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-1.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-1.p4 index 86940ae5d0..075e07696d 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-1.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-1.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-2.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-2.p4 index 1185b2d51c..65c3c0bf25 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-2.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-2.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; const bit<8> ETHERNET_HEADER_LEN = 14; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-3.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-3.p4 index dcf4f83b79..63f1167c2d 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-3.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-3.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; const bit<8> ETHERNET_HEADER_LEN = 14; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-4.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-4.p4 index afaa7a6d8a..e91189b8bf 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-4.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err-4.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err.p4 index 54084e467d..1267e79bb1 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-counter-err.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; const bit<8> ETHERNET_HEADER_LEN = 14; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-2.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-2.p4 index 28bb08ce13..94b7968f94 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-2.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-2.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; const bit<8> ETHERNET_HEADER_LEN = 14; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-3.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-3.p4 index fa745f7efb..dad2be82f2 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-3.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-3.p4 @@ -1,5 +1,5 @@ #include -#include "dpdk/pna.p4" +#include typedef bit<48> EthernetAddress; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-4.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-4.p4 index d71b9c0ba7..639419c420 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-4.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err-4.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; diff --git a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err.p4 b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err.p4 index 54084e467d..1267e79bb1 100644 --- a/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err.p4 +++ b/testdata/p4_16_pna_errors/pna-dpdk-direct-meter-err.p4 @@ -1,5 +1,5 @@ #include -#include +#include typedef bit<48> EthernetAddress; const bit<8> ETHERNET_HEADER_LEN = 14; diff --git a/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-counter-err-3.p4-error b/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-counter-err-3.p4-error index af7ef25674..17ff5d758b 100644 --- a/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-counter-err-3.p4-error +++ b/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-counter-err-3.p4-error @@ -1,3 +1,6 @@ pna.p4(401): [--Werror=unexpected] error: count method of per_prefix_pkt_bytes_count extern can only be invoked from within action of ownertable void count(in bit<32> pkt_len); ^^^^^ +pna.p4(401): [--Werror=unexpected] error: count method of per_prefix_bytes_count extern can only be invoked from within action of ownertable + void count(in bit<32> pkt_len); + ^^^^^ diff --git a/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-meter-err-4.p4-error b/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-meter-err-4.p4-error index e5fb1b51d3..e3d200c83c 100644 --- a/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-meter-err-4.p4-error +++ b/testdata/p4_16_pna_errors_outputs/pna-dpdk-direct-meter-err-4.p4-error @@ -1,3 +1,24 @@ -pna-dpdk-direct-meter-err-4.p4(118): [--Werror=expected] error: Expected default action default_route_drop to have 'dpdk_execute' method call for DirectMeter extern instance MainControlImpl.meter0 - action default_route_drop() { - ^^^^^^^^^^^^^^^^^^ +pna-dpdk-direct-meter-err-4.p4(111): [--Werror=type-error] error: meter0.execute: extern DirectMeter does not have method matching this call + out1 = meter0.execute(color_in, 32w1024); + ^^^^^^^^^^^^^^ +pna.p4(444) +extern DirectMeter { + ^^^^^^^^^^^ +pna-dpdk-direct-meter-err-4.p4(113): [--Werror=type-error] error: meter1.execute: extern DirectMeter does not have method matching this call + color_out = meter1.execute(color_in, 32w1024); + ^^^^^^^^^^^^^^ +pna.p4(444) +extern DirectMeter { + ^^^^^^^^^^^ +pna-dpdk-direct-meter-err-4.p4(119): [--Werror=type-error] error: meter0.execute: extern DirectMeter does not have method matching this call + out1 = meter0.execute(color_in, 32w1024); + ^^^^^^^^^^^^^^ +pna.p4(444) +extern DirectMeter { + ^^^^^^^^^^^ +pna-dpdk-direct-meter-err-4.p4(148): [--Werror=type-error] error: meter1.execute: extern DirectMeter does not have method matching this call + color_out = meter1.execute(color_in, 32w1024); + ^^^^^^^^^^^^^^ +pna.p4(444) +extern DirectMeter { + ^^^^^^^^^^^