Can NVIDIA NICs handle two hardware meters per packet?¶
In our recent posts, we explored the limits of hardware-offloaded egress meters on NVIDIA NICs, metering either all traffic or individual flows. Real-world DDoS mitigation often needs more than that: multiple levels of metering, where each packet passes through several meters in a row. This time, we tested whether offloading two meters per packet is practical.
We used the following RTE Flow rules:
flow group 0 priority 0 egress pattern actions jump group 1
flow group 1 priority 0 egress
pattern ipv4 dst spec 10.33.X.Y dst mask 255.255.255.255
actions count identifier 0 meter_mark color_mode 0 state 1 jump group 2
flow group 2 priority 0 egress
pattern ipv4 dst spec 10.33.X.Y dst mask 255.255.255.255
actions count identifier 0 meter_mark color_mode 1 state 1 jump group 3
flow group 3 priority 0 egress
pattern meter_color is red
actions count identifier 0 drop
The first meter is color-blind, and the second is color-aware, so it builds on the first meter's result. Packets marked red are dropped. By varying X.Y, we scaled the setup to many destination hosts, each with its own pair of meters.
The chart shows throughput by number of rules, each rule carrying 2 meter actions. Key findings:
-
ConnectX-6: performance drops significantly.
-
ConnectX-7: an interesting anomaly appears between metering a single IP destination and metering multiple destinations.
-
ConnectX-7 and BlueField-3: both sustain the full 100 Gbps with 64 B packets with up to 64 rules (2 meters each).
On newer NVIDIA hardware, multi-level metering can be fully offloaded without sacrificing line rate, at least at moderate rule counts.