On Wed, 6 Jan 2021 12:56:08 +0100 Marek Behún <ka...@kernel.org> wrote:
> I also to write a simple NAT masquerading program. I think XDP can > increase NAT throughput to 2.5gbps as well. BTW currently if XDP modifies the packet, it has to modify the checksums accordingly. There is a helper for that even, bpf_csum_diff. But many drivers can offload csum computation, mvneta and mvpp2 for example. But for this, somehow the XDP program has to let the driver know what kind of csum it needs to be computed (L3, L4 TCP/UDP). This could theoretically be communicated with the driver via metadata prepended to the packet. But a abstraction is needed, so that every driver does it in the same way. Maybe someone is already working on this, I don't know... Marek