Comment by eqvinox
Improvement on this is more likely to come from switchdev than from Tofino & P4. (though these don't necessarily contradict each other)
You can already run plain Debian on a Mellanox Spectrum device, treat it like a Linux software router, and by the power of magic your routes get pushed into hardware. (Source: device on my table to my right :D) Microchip's SparX-5 should be similar though I don't have one of those to test.