buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51326, tcpflags_t is too small for TF_RTO...

 
 

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

bug #51326: tcpflags_t is too small for TF_RTO for some configurations

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Tue 27 Jun 2017 05:56:39 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Joel Cunningham <jcunningham>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Wed 28 Jun 2017 07:48:08 PM UTC, comment #3:

> I do wonder how much we should put into this kind of optimization.


No, not too much, you're right there. I've just pushed your patch.

Simon Goldschmidt <goldsimon>
Project Administrator
Tue 27 Jun 2017 09:00:45 PM UTC, comment #2:

What I'm seeing with MSVC 2013 (and win32 port) is that struct tcp_pcb is 200 bytes regardless of whether tcpflags_t is a u8_t or u16_t.

From deeper investigation of the u8_t case, remote_port starts on byte 68 (4 byte boundary) and then we have 6 bytes (2 for remote_port + 4 u8_ts). This means for tmr to be on the next 4 byte boundary, there are two bytes of padding.

Here's the offsets:

Attached patch changes to u16_t

I do wonder how much we should put into this kind of optimization. There is an enum in TCP_PCB_COMMON and depending on compiler options (GCC can make enums storage only big enough for the defined values) this could throw off calculations

(file #41058)

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.
Tue 27 Jun 2017 07:43:30 PM UTC, comment #1:

Good catch. I originally had the flag depend on LWIP_TCP_ABC but we ended up removing that config option during review.

I can do an analysis of the tcp_pcb. I think we might be out of padding holes

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.
Tue 27 Jun 2017 05:56:39 PM UTC, original submission:

Maybe we should make tcp_pcb->flags u16_t always...
But that should be done with care to avoid 3 bytes of padding.

Simon Goldschmidt <goldsimon>
Project Administrator

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jcunningham (Posted a comment)
  • -unavailable- added by goldsimon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jun 2017 07:48:08 PM UTCgoldsimonStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 27 Jun 2017 09:00:45 PM UTCjcunninghamAttached File-=>Added 0001-tcp-switch-tcpflags_t-to-u16_t-for-all-cases-bug-513.patch, #41058
    Tue 27 Jun 2017 07:43:30 PM UTCjcunninghamAssigned toNone=>jcunningham

    Back to the top


    Powered by Savane 3.1-cleanup1