Page MenuHomeFreeBSD

Fix comparison function in LRO
ClosedPublic

Authored by hselasky on Feb 10 2016, 7:59 AM.
Tags
None
Referenced Files
F114399701: D5239.id13211.diff
Sat, Apr 12, 3:41 AM
Unknown Object (File)
Tue, Apr 1, 3:06 AM
Unknown Object (File)
Mon, Mar 31, 9:36 AM
Unknown Object (File)
Mar 3 2025, 5:28 AM
Unknown Object (File)
Feb 1 2025, 4:20 PM
Unknown Object (File)
Jan 29 2025, 2:50 PM
Unknown Object (File)
Jan 17 2025, 11:21 PM
Unknown Object (File)
Jan 7 2025, 9:54 PM
Subscribers

Details

Summary

When comparing 32-bit signed integers we need either to use a 64-bit variable, or check the two cases that can happen. Else we risk incorrect sorting results.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

hselasky retitled this revision from to Fix comparison function in LRO.
hselasky updated this object.
hselasky edited the test plan for this revision. (Show Details)
hselasky added reviewers: gallatin, gnn.
hselasky set the repository for this revision to rS FreeBSD src repository - subversion.
sys/netinet/tcp_lro.c
351

This seems like an overly complicated way to say "return 1" and "return -1". Perhaps you could simplify it, and eliminate the gotos ?

sys/netinet/tcp_lro.c
351

It produces the least assembly code vs ret = 1 ... ret = -1. Another alternative is to mask away the 31st bit of the flowid.

gnn requested changes to this revision.Feb 10 2016, 2:00 PM
gnn edited edge metadata.

We are programming in C and not assembler. Please make the requested change to a typically C idiom.

This revision now requires changes to proceed.Feb 10 2016, 2:00 PM
hselasky edited edge metadata.

Make C-code more easily readable.

gnn edited edge metadata.

Thank you.

This revision is now accepted and ready to land.Feb 10 2016, 2:10 PM
This revision was automatically updated to reflect the committed changes.