patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8852, Optimize udp_bind code paths

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8852: Optimize udp_bind code paths

Submitter:  Axel Lin <axellin>
Submitted:  Tue 12 Jan 2016 01:22:59 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Planned Release:  None

Wed 13 Jan 2016 12:26:11 AM UTC, comment #3: 

Hi Dirk,
I also found a problem in patch1.
It should not break out immediately because it needs to check port collisions with rest of the active pcbs.
So please ignore this serial.

Thanks for the review, I'll try to fix it again.

Axel Lin <axellin>
Group Member
Tue 12 Jan 2016 08:31:12 PM UTC, comment #2: 

Just saw the same objection may apply to patch 1

Dirk Ziegelmeier <dziegel>
Group administrator
Tue 12 Jan 2016 08:28:59 PM UTC, comment #1: 

Patch 2: Are you sure the line "  } else if (rebind == 0) {" is correct? The check for collisions with other PCB should also be done when rebinding - the user could have chosen a port that is in use. Also note the IPv4/IPv6 is also checked in the comparison.

In my opinion, it should only be "} else {"

Dirk Ziegelmeier <dziegel>
Group administrator
Tue 12 Jan 2016 01:22:59 AM UTC, original submission:  

[PATCH 1/2] udp_bind: Slightly optimize the rebind code path

udp_pcbs does not have duplicate pcb in the list.
So for a given pcb, it's not possible to match multiple entries in udp_pcbs.
Optimize the code by break out from the for loop once a match is found.

[PATCH 2/2] udp_bind: Optimize the code patch for checking port collision

Move rebind checking earlier then we can optimize the code path for checking
port collision. udp_new_port() already ensures the ephemeral port selected is
unique, so we can avoid the port collision test again for this case.
Just need to check port collision when port != 0 && rebind == 0.

Axel Lin <axellin>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by axellin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-13 dziegel StatusNone Done
        Open/ClosedOpen Closed
    2016-01-13 axellin Attached File- Added 0001-udp_bind-Omit-checking-for-the-same-port-if-no-port-.patch, #36003
    2016-01-12 axellin Attached File- Added 0001-udp_bind-Slightly-optimize-the-rebind-code-path.patch, #35994
        Attached File- Added 0002-udp_bind-Optimize-the-code-patch-for-checking-port-c.patch, #35995

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code