Skip to content

Conversation

@jafingerhut
Copy link
Contributor

It is true that packets in/out are recorded to pcap files during BMv2 tests, and this is definitely useful. I am currently debugging an issue in recently built open source P4 code where the packets recorded in the pcap files seem to be different than what is logged by BMv2 with the --dump-packet-data 10240 option given to BMv2, so it can be very useful to have this enabled all of the time.

The cost for enabling it is just a few extra lines in the BMv2 log files, typically two extra lines per packet, where typically there are hundreds of lines of log file output per packet for other (useful) reasons, so enabling this option is a negligible extra overhead in logging.

@jafingerhut
Copy link
Contributor Author

OK, I recall now a few months back that enabling this causes BMv2 to assert and crash if it sends out a length 0 packet, which a few test cases do.

There is a fix committed to avoid this assert in BMv2 here p4lang/behavioral-model@d12eefc

However, p4c tests using BMv2 are I believe still using a BMv2 binary built from source code circa Aug 2023 or thereabouts, until we update p4c CI to do otherwise.

The good news is that hopefully quite soon we should have a part-time professional to help improve such things, but of course others are always welcome to tackle such issues if they are interested.

@fruffy fruffy added core Topics concerning the core segments of the compiler (frontend, midend, parser) bmv2 Topics related to BMv2 or v1model and removed core Topics concerning the core segments of the compiler (frontend, midend, parser) labels Jul 4, 2025
@fruffy
Copy link
Collaborator

fruffy commented Jul 4, 2025

However, p4c tests using BMv2 are I believe still using a BMv2 binary built from source code circa Aug 2023 or thereabouts, until we update p4c CI to do otherwise.

We could just build BMv2 from scratch, like it is done for the Fedora build. But that would CI time and could possibly break...

@jafingerhut
Copy link
Contributor Author

However, p4c tests using BMv2 are I believe still using a BMv2 binary built from source code circa Aug 2023 or thereabouts, until we update p4c CI to do otherwise.

We could just build BMv2 from scratch, like it is done for the Fedora build. But that would CI time and could possibly break...

I think it is fine to wait just a bit longer until our new hired CI help can consider how they would like to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bmv2 Topics related to BMv2 or v1model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants