Closed rjarry closed 2 months ago
On the principle, it looks good, but I suspect it has a non negligeable impact on performance.
Out of curiosity, I ran a simple IP forwarding performance test, before and after this patch.
before: 23.56 MPPS
GROUT: main: starting grout version v0.1-1-gbed15f4ef48e
NODE CALLS PACKETS PKTS/CALL CYCLES/CALL CYCLES/PKT
ip_input 1988 315693 158.8 8367.9 52.7
port_rx 2176 315693 145.1 5573.3 38.4
port_tx 1988 315693 158.8 4400.9 27.7
eth_input 2176 315693 145.1 3263.6 22.5
ip_output 1988 315693 158.8 3168.4 20.0
eth_output 1988 315693 158.8 3135.6 19.7
ip_forward 1988 315693 158.8 1741.1 11.0
after: 23.56 MPPS
GROUT: main: starting grout version v0.1-2-ge3133c7c1c80
NODE CALLS PACKETS PKTS/CALL CYCLES/CALL CYCLES/PKT
ip_input 2354 315196 133.9 7055.5 52.7
port_rx 2624 315196 120.1 4626.7 38.5
port_tx 2354 315196 133.9 3678.2 27.5
eth_input 2624 315196 120.1 2708.8 22.6
ip_output 2354 315196 133.9 2681.7 20.0
eth_output 2354 315196 133.9 2621.4 19.6
ip_forward 2354 315196 133.9 1455.5 10.9
If this patch has any impact, it is not noticeable in this particular test.
If the -t, --test-mode flag is used, enable packet tracing instead of relying on an undocumented compilation flag. The performance impact should be minimal when it is not enabled.