Skip to content

Commit

Permalink
rdp: Decrease number of reserved slots in RX queue
Browse files Browse the repository at this point in the history
When deciding wether to ack a packet, we previously would consider the
RX queue as available if there was enough room for window_size * 2
packets.

However with reduced conn_queue_length (the default setting is now 10 in
our setup), this would reduce the maximum allowed window size to 4.

Considering the fact that it is wastefull to reserve this much buffer
space, we have reduced the number to only a single time the window_size.
This would allow the window size to approach the conn_queue_length.

The user should be mindfull that using a window_size of 10, with a
queue_length of 10 could result in dropped packets, since some packets
could be already in the air. So setting window size a bit below is
always recommended.

This is partially in response to issue libcsp#109
  • Loading branch information
Johan De Claville Christiansen committed Aug 21, 2018
1 parent 7f81793 commit ccd004c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transport/csp_rdp.c
Expand Up @@ -454,7 +454,7 @@ int csp_rdp_check_ack(csp_conn_t * conn) {
/* Check all RX queues for spare capacity */
int prio, avail = 1;
for (prio = 0; prio < CSP_RX_QUEUES; prio++) {
if (csp_conf.conn_queue_length - csp_queue_size(conn->rx_queue[prio]) <= 2 * (int32_t)conn->rdp.window_size) {
if (csp_conf.conn_queue_length - csp_queue_size(conn->rx_queue[prio]) < (int32_t)conn->rdp.window_size) {
avail = 0;
break;
}
Expand Down

0 comments on commit ccd004c

Please sign in to comment.