Closed Bug 898234 Opened 11 years ago Closed 9 years ago

Wasted work in sctp_setopt()

Categories

(Core :: Networking, defect)

x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: pchang9, Assigned: pchang9)

Details

(Keywords: perf, Whiteboard: patch)

Attachments

(1 file)

Attached patch Suggested patchSplinter Review
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 (Beta/Release)
Build ID: 20130116073211

Steps to reproduce:

The problem appears in changeset 138350:18467a85acf6. I have attached a simple one-line patch that fixes it.

In method sctp_setopt() in netwerk/sctp/src/netinet/sctp_usrreq.c, the loop on line 4755 should break immediately after "found" is set to "1". All the iterations after "found" is set to "1" do not perform any useful work, at best they just set "found" again to "1".



Expected results:

Break loop after "found" is set to "1".
Keywords: perf
OS: Windows 7 → All
Version: 18 Branch → Trunk
>In method sctp_setopt() in netwerk/sctp/src/netinet/sctp_usrreq.c, the loop on line 4755

https://hg.mozilla.org/mozilla-central/file/18467a85acf6/netwerk/sctp/src/netinet/sctp_usrreq.c#l4754
Assignee: nobody → pchang9
Component: Untriaged → Networking
Product: Firefox → Core
Whiteboard: patch
Attachment #781395 - Attachment is patch: true
pchang9 - thanks.

I believe this is imported code and it would be better in this case to just work the patch directly with the upstream repo which we will eventually inherit. But Randell would know for sure and can provide any pointers.
-> Tuexen to resolve in upstream (I see no need to land this before we pick it up from upstream).

Thanks pchang9!
Status: UNCONFIRMED → NEW
Ever confirmed: true
Fixed upstream in
http://code.google.com/p/sctp-refimpl/source/detail?r=8555
http://code.google.com/p/sctp-refimpl/source/detail?r=8556
The fix also cleans up the code a bit.

Thanks for bringing this up.

Best regards
Michael
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: