Skip to content

Commit

Permalink
Small fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy committed Aug 14, 2024
1 parent 4076b42 commit 1c53750
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 1 addition & 2 deletions backends/ebpf/psa/examples/simple.p4
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ struct local_metadata_t {

parser packet_parser(packet_in packet, out headers_t headers, inout local_metadata_t local_metadata, in psa_ingress_parser_input_metadata_t standard_metadata, in empty_metadata_t resub_meta, in empty_metadata_t recirc_meta) {
state start {
packet.extract(headers.ethernet);
transition accept;
}
}

control packet_deparser(packet_out packet, out empty_metadata_t clone_i2e_meta, out empty_metadata_t resubmit_meta, out empty_metadata_t normal_meta, inout headers_t headers, in local_metadata_t local_metadata, in psa_ingress_output_metadata_t istd) {
apply {
packet.emit(headers.ethernet);
}
}

Expand All @@ -78,6 +76,7 @@ control ingress(inout headers_t headers, inout local_metadata_t local_metadata,

apply {
// tbl_switching.apply();
send_to_port(ostd, (PortId_t) PORT0);
}

}
Expand Down
9 changes: 9 additions & 0 deletions backends/ebpf/psa/examples/simple.p4info.txtpb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
pkg_info {
arch: "psa"
}

actions {
preamble {
id: 27646489
name: "send_to_port"
alias: "send_to_port"
annotations: "@noWarn(\"unused\")"
}
}
1 change: 0 additions & 1 deletion backends/ebpf/runtime/ebpf_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/


/// This file contains all functions and definitions necessary for the kernel target C
/// code to compile. It must be included with any file generated by the p4c-ebpf kernel
/// compiler.
Expand Down
4 changes: 2 additions & 2 deletions backends/ebpf/tests/ptf/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ def runTest(self) -> None:
# check no connectivity if switching rules are not installed
pkt = testutils.simple_udp_packet(eth_dst="00:00:00:00:00:03")
testutils.send_packet(self, PORT0, pkt)
# testutils.verify_packet(self, pkt, PORT0)
testutils.verify_any_packet_any_port(self, [pkt], ALL_PORTS)
testutils.verify_packet(self, pkt, PORT0)
# testutils.verify_any_packet_any_port(self, [], ALL_PORTS)

0 comments on commit 1c53750

Please sign in to comment.