Skip to content

TCP Packet loss happens due to running of out of Mailbox size. #11517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/lwipstack/lwip-sys/arch/sys_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef struct {
} sys_mutex_t;

// === MAIL BOX ===
#define MB_SIZE 8
#define MB_SIZE MBED_CONF_LWIP_MBOX_SIZE

typedef struct {
osEventFlagsId_t id;
Expand Down
5 changes: 3 additions & 2 deletions features/lwipstack/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@
#define LWIP_RAW 0
#endif

#define TCPIP_MBOX_SIZE 8
#define DEFAULT_TCP_RECVMBOX_SIZE 8
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
#define TCPIP_MBOX_SIZE MBED_CONF_LWIP_TCPIP_MBOX_SIZE
#define DEFAULT_TCP_RECVMBOX_SIZE MBED_CONF_LWIP_DEFAULT_TCP_RECVMBOX_SIZE
#define DEFAULT_UDP_RECVMBOX_SIZE 8
#define DEFAULT_RAW_RECVMBOX_SIZE 8
#define DEFAULT_ACCEPTMBOX_SIZE 8
Expand Down
16 changes: 16 additions & 0 deletions features/lwipstack/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,26 @@
"help": "Number of simultaneously queued TCP segments. Current default (used if null here) is set to 16 in opt.h, unless overridden by target Ethernet drivers.",
"value": null
},
"memp-num-tcpip-msg-inpkt": {
"help": "Number of simultaneously queued TCP messages that are received",
"value": 8
},
"tcp-mss": {
"help": "TCP Maximum segment size. Current default (used if null here) is set to 536 in opt.h, unless overridden by target Ethernet drivers.",
"value": null
},
"tcpip-mbox-size": {
"help": "TCPIP mailbox size",
"value": 8
},
"default-tcp-recvmbox-size": {
"help": "Default TCPIP receive mailbox size",
"value": 8
},
"mbox-size": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting doesn't exist in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, It looks like the TCP Fast timer will send packets but meanwhile if the new TCP data is received ( and receive mailbox is not full) then new TCP Data arrives first before the failed TCP packet.

I am fine with having a separate PR for this TCP bug.

I am fine with this PR for configuration options alone.

I had the mbox-size and tcp receive mailbox size, default tcp mail box size in targert overrides sections in mbed_app.json , I will move into this mbed_lib.json.

"help": "mailbox size",
"value": 8
},
"tcp-snd-buf": {
"help": "TCP sender buffer space (bytes). Current default (used if null here) is set to (2 * TCP_MSS) in opt.h, unless overridden by target Ethernet drivers.",
"value": null
Expand Down