Obtaining More Accurate Timestamps from simple_switch Logs for bmV2

Hi,

Is there any way to get more accurate timestamps for the simple_switch logs?

For example, take a look at the logs below:

[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Processing packet received on port 2
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Parser ‘parser’: start
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Parser ‘parser’ entering state ‘start’
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Extracting header ‘ethernet’
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Parser state ‘start’: key is 0027
[16:24:38.133] [bmv2] [T] [thread 28315] [794.0] [cxt 0] Bytes parsed: 14
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Parser ‘parser’: end
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Pipeline ‘ingress’: start
[16:24:38.133] [bmv2] [T] [thread 28315] [794.0] [cxt 0] Applying table ‘MyIngress.phy_forward’
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Looking up key:

  • standard_metadata.ingress_port: 0002

[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Table ‘MyIngress.phy_forward’: hit with handle 0
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Dumping entry 0
Match key:

  • standard_metadata.ingress_port: EXACT 0002
    Action entry: MyIngress.forward - 1,

[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Action entry is MyIngress.forward - 1,
[16:24:38.133] [bmv2] [T] [thread 28315] [794.0] [cxt 0] Action MyIngress.forward
[16:24:38.133] [bmv2] [T] [thread 28315] [794.0] [cxt 0] parsertest.p4(220) Primitive standard_metadata.egress_spec = port
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Pipeline ‘ingress’: end
[16:24:38.133] [bmv2] [D] [thread 28315] [794.0] [cxt 0] Egress port is 1
[16:24:38.133] [bmv2] [D] [thread 28317] [794.0] [cxt 0] Pipeline ‘egress’: start
[16:24:38.133] [bmv2] [D] [thread 28317] [794.0] [cxt 0] Pipeline ‘egress’: end
[16:24:38.133] [bmv2] [D] [thread 28317] [794.0] [cxt 0] Deparser ‘deparser’: start
[16:24:38.133] [bmv2] [D] [thread 28317] [794.0] [cxt 0] Deparsing header ‘ethernet’
[16:24:38.133] [bmv2] [D] [thread 28317] [794.0] [cxt 0] Deparser ‘deparser’: end
[16:24:38.133] [bmv2] [D] [thread 28320] [794.0] [cxt 0] Transmitting packet of size 60 out of port 1

As of now, each process of the bmv2 is timestamped to milliseconds. Is there any way to obtain much more accurate timestamps that is precise upto micro or nano seconds?

The only way I know to do this would be to modify the source code of BMv2, recompile it, and install that modified binary on your system.

Oh I see. Thank you very much. Are there any ongoing projects for making bmv2 production grade?

It depends on what you mean by “production grade”. If you mean “intended to forward packets in a production environment, as efficiently as any other software switch can do”, then I suspect the answer is “no”. There are significant development efforts being put right now into the open source p4c compiler’s DPDK back end, I believe with the intent of making it become useful in production scenarios.

1 Like