patchlwIP - A Lightweight TCP/IP stack - Patches: patch #6823, tcp_in.c - small optimization

 
 

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

patch #6823: tcp_in.c - small optimization

Submitter:  Bill Auerbach <billauerbach>
Submitted:  Tue 05 May 2009 06:11:33 PM UTC
   
 
Category:  None Priority:  3 - Low
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 07 May 2009 05:48:26 AM UTC, comment #3: 


> How do changes get put out for testing/trial before being
> considered for inclusion in the code base?


By putting/discussing them here and/or on lwip_devel.

> Can I upload the patch for the tcp.h macro improvements?


Of course!

Simon Goldschmidt <goldsimon>
Group administrator
Wed 06 May 2009 05:54:36 PM UTC, comment #2: 

Yeah, I don't like to rely on optimizers to fix things - it may have corrected the first line, but no compiler can change the second (it cannot remove a sequence point).

I don't think I posted this before, maybe mentioned it.  Can I upload the patch for the tcp.h macro improvements?  Hopefully we'll get some feedback on code size savings (and speed if one cares to benchmark).  I was not able to test big endian, but I don't see problems and think there is little effect on those platforms.

How do changes get put out for testing/trial before being considered for inclusion in the code base?

Bill

Bill Auerbach <billauerbach>
Wed 06 May 2009 05:31:03 PM UTC, comment #1: 

Small but correct. I've checked it in. Didn't you write that on the list already? It's a good example of how things can get lost there ;-)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 05 May 2009 06:11:33 PM UTC, original submission:  

Index: tcp_in.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/tcp_in.c,v
retrieving revision 1.107
diff -u -r1.107 tcp_in.c
--- tcp_in.c 19 Apr 2009 12:17:59 -0000 1.107
+++ tcp_in.c 5 May 2009 18:08:58 -0000
@@ -169,8 +169,8 @@
   ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
   tcphdr->wnd = ntohs(tcphdr->wnd);
 
-  flags = TCPH_FLAGS(tcphdr) & TCP_FLAGS;
-  tcplen = p->tot_len + ((flags & TCP_FIN || flags & TCP_SYN)? 1: 0);
+  flags = TCPH_FLAGS(tcphdr);
+  tcplen = p->tot_len + ((flags & (TCP_FIN|TCP_SYN))? 1: 0);
 
   /* Demultiplex an incoming segment. First, we check if it is destined
      for an active connection. */

Bill Auerbach <billauerbach>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by billauerbach (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-05-06 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code