Page MenuHomeFreeBSD

Fix comparison function in LRO
ClosedPublic

Authored by hselasky on Feb 10 2016, 7:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 1:16 AM
Unknown Object (File)
Nov 20 2024, 1:29 AM
Unknown Object (File)
Oct 22 2024, 12:11 AM
Unknown Object (File)
Oct 22 2024, 12:11 AM
Unknown Object (File)
Sep 26 2024, 5:58 PM
Unknown Object (File)
Sep 26 2024, 1:48 AM
Unknown Object (File)
Sep 25 2024, 8:50 PM
Unknown Object (File)
Sep 22 2024, 8:22 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.