mtcp-stack / mtcp

mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems
Other
1.98k stars 435 forks source link

Hardware TCP checksum offload #277

Open ppnaik1890 opened 4 years ago

ppnaik1890 commented 4 years ago

I noticed that TCPCalcChecksum is consuming CPU in my workload profile. I want to offload this calculation to hardware/NIC. I noticed DISABLE_HWCSUM flag in tcp_in.c etc. Where should I disable this flag to enable hardware checksum calculation? Or is there any other way to do this. Thanks

ajamshed commented 4 years ago

@ppnaik1890,

Which NIC are you using for your experiments? mTCP should automatically offload hardware checksum for all Intel NICs (and a few non-Intel NICs). You can also check whether hardware checksum is enabled by having a look at line 13 of mtcp/src/Makefile. HWCSUM should be equal to 1.

Are you using VF for your experiments?

ppnaik1890 commented 4 years ago

Hi Asim, I am using Intel XL710 NICs. My code runs on the host server using the physical NIC. The Makefile also has HWCSUM=1. I am using the netmap based setup. Thanks

ajamshed commented 4 years ago

Hi @ppnaik,

Apologies for the delayed response. Does netmap provide TCP offload features (such as checksum offloading)? Please see the 5th bullet point of the "Common problems" subsection of this link: https://github.com/luigirizzo/netmap/blob/master/LINUX/README.md. By the way, the HWCSUM macro in Makefile only controls the dpdk driver module.

If you are able to program the netmap driver to support checksum offloading, please let me know. I can then patch up the mTCP stack to enable checksum offloading for netmap driver as well. Thanks!