Page MenuHomeFreeBSD

Fix comparison function in LRO
ClosedPublic

Authored by • hselasky on Feb 10 2016, 7:59 AM.
Tags
None
Referenced Files
F173663589: D5239.diff
Sun, Sep 27, 1:51 PM
Unknown Object (File)
Tue, Sep 22, 8:48 PM
Unknown Object (File)
Tue, Sep 22, 3:29 AM
Unknown Object (File)
Fri, Sep 11, 4:55 PM
Unknown Object (File)
Fri, Sep 11, 9:41 AM
Unknown Object (File)
Aug 27 2026, 2:28 PM
Unknown Object (File)
Aug 22 2026, 3:37 AM
Unknown Object (File)
Aug 16 2026, 9:46 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
352

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
352

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.