diff --git a/backends/ebpf/README.md b/backends/ebpf/README.md index 0ee14ed370a..918398c07c1 100644 --- a/backends/ebpf/README.md +++ b/backends/ebpf/README.md @@ -280,7 +280,7 @@ state transition | `goto` statement `extract` | load/shift/mask data from packet buffer #### Translating match-action pipelines -## + P4 Construct | C Translation ----------|------------ table | 2 eBPF tables: second one used just for the default action @@ -385,7 +385,7 @@ The C extern could be also allowed to access packet’s payload, but this featur The custom C extern function should be explicitly declared in the P4 program making use of that extern. For example: -```C +```c /** Declaration of the C extern function. */ extern bool verify_ipv4_checksum(in IPv4_h iphdr); ``` diff --git a/backends/ebpf/psa/README.md b/backends/ebpf/psa/README.md index d45fa482bb1..90ed1c3918f 100644 --- a/backends/ebpf/psa/README.md +++ b/backends/ebpf/psa/README.md @@ -378,7 +378,7 @@ or member. Before action execution, following source code will be generated (and some additional comments to it) for table lookup, which has implementation `ActionSelector`: -```c +``` c struct ingress_as_value * as_value = NULL; // pointer to an action data u32 as_action_ref = value->ingress_as_ref; // value->ingress_as_ref is entry from table (reference) u8 as_group_state = 0; // which map contains action data diff --git a/backends/p4tools/modules/testgen/README.md b/backends/p4tools/modules/testgen/README.md index 339427bdb96..d1709749d16 100644 --- a/backends/p4tools/modules/testgen/README.md +++ b/backends/p4tools/modules/testgen/README.md @@ -115,6 +115,7 @@ P4Testgen supports the use of custom externs to restrict the breadth of possible #### Restricted Tests `testgen_assume(expr)` will add `expr` as a necessary path constraints to all subsequent execution. For example, for the following snippet ``` P4 + state parse_ethernet { packet.extract(headers.ethernet); testgen_assume(headers.ethernet.ether_type == 0x800); @@ -131,6 +132,7 @@ only inputs which have `0x800` as Ethertype will be generated. This mode is enab Conversely, `testgen_assert(expr)` can be used to find violations in a particular P4 program. By default, `testgen_assert` behaves like `testgen_assume`. If the flag `--assertion-mode` is enabled, P4Testgen will only generate tests that will cause `expr` to be false and, hence, violate the assertion. For example, for ``` P4 + state parse_ethernet { packet.extract(headers.ethernet); transition select(headers.ethernet.ether_type) {