Xilinx-CNS / onload

OpenOnload high performance user-level network stack
Other
583 stars 95 forks source link

Refactor tcp/udp checksum calculating #198

Closed okt-sergeyn closed 9 months ago

okt-sergeyn commented 10 months ago

Refactor tcp/udp checksum calculating and follow some RFC recommendations.

The main purpose of the patch series is to make Onload checksum calculations similar to Linux for the case of 0xffff tcp checksum. Onload calculates it as 0. ci_analyse_pkt() output for such packets is: [onload] TCP ***** bad checksum ffff (I get 0) *****

Refactor checksum API and unify the callers to call directly ef* functions instead of ci* wrappers. This also brings in the include/etherfabric API change. As I understand it is a kind of public API, so I'd appreciate any comments about that.

Fix ci_{tcp,udp}_csum_correct() functions to handle ffff checksum. Fix tcp tx checksum computing to replace 0 with ffff (follow udp recommendations).

Add a simple unit test for ef_tcp_checksum().

ivatet-amd commented 9 months ago

I want to study this PR and merge it tomorrow morning.