On Wed, Jan 06, 2021 at 01:32:05PM +0100, Marek Behún wrote: > 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.
Hi Marek It does require that the MAC is DSA aware. The Freescale FEC for example cannot do such csum, because the DSA header confuses it, and it cannot find the IP header, etc. So if you do look at a generic way to implement this, you need the MAC driver to indicate it has the needed support. Andrew