OpenDataPlane / odp

The ODP project is an open-source, cross-platform set of application programming interfaces (APIs) for the networking data plane
https://opendataplane.org
Other
176 stars 133 forks source link

[PATCH v1] test/performance: fix IPv4 checksum #2079

Closed rahul-bhansali closed 1 month ago

rahul-bhansali commented 2 months ago

An issue of incorrect IPv4 checksum is observed when sources are compiled in release mode with optimization flags -fno-var-tracking-assignments. On annotating, it was observed that few IP header fields are updated after checksum calculation routine.

Using this API odph_ipv4_csum_update() solves the issue as it synchronizes the load/store instructions.

JereLeppanen commented 1 month ago

@rahul-bhansali In PR #2096 we're suggesting that this should be fixed with the may_alias attribute, please have a look.

rahul-bhansali commented 1 month ago

@rahul-bhansali In PR #2096 we're suggesting that this should be fixed with the may_alias attribute, please have a look.

Ack. That may_alias is also fine. So for other than linux-generic platforms, need to add may_alias or other way of handling in respective odp_chksum_ones_comp16() API to fix this.

JereLeppanen commented 1 month ago

Yes, exactly. I'm closing this PR now, but thanks for reporting the issue, it was a good catch.