tcp_get_recvwindow: Make this match the reality (tcp_datahandler)
It doesn't make much sense to advertize more than we can actually accept, especially when we don't queue partial segments.
This commit is contained in:
parent
af64912833
commit
ca0f2bdb95
@ -143,6 +143,7 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
recvwndo = (uint16_t)rwnd;
|
recvwndo = (uint16_t)rwnd;
|
||||||
}
|
}
|
||||||
|
#if CONFIG_IOB_THROTTLE > 0
|
||||||
else if (IOB_QEMPTY(&conn->readahead))
|
else if (IOB_QEMPTY(&conn->readahead))
|
||||||
{
|
{
|
||||||
/* Advertise maximum segment size for window edge if here is no
|
/* Advertise maximum segment size for window edge if here is no
|
||||||
@ -150,16 +151,17 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev,
|
|||||||
*
|
*
|
||||||
* Note: hopefully, a single mss-sized packet can be queued by
|
* Note: hopefully, a single mss-sized packet can be queued by
|
||||||
* the throttled=false case in tcp_datahandler().
|
* the throttled=false case in tcp_datahandler().
|
||||||
*
|
|
||||||
* Revisit: I (yamamoto) am a bit skeptical on this logic.
|
|
||||||
* - Probably this should depend on IOB throttling.
|
|
||||||
* - IOB_BUFSIZE can be smaller than MSS. It seems wrong to
|
|
||||||
* advertize a larger window when no IOBs are available
|
|
||||||
* than when eg. a single IOB is available.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int niob_avail_no_throttle = iob_navail(false);
|
||||||
|
|
||||||
recvwndo = tcp_rx_mss(dev);
|
recvwndo = tcp_rx_mss(dev);
|
||||||
|
if (recvwndo > niob_avail_no_throttle * CONFIG_IOB_BUFSIZE)
|
||||||
|
{
|
||||||
|
recvwndo = niob_avail_no_throttle * CONFIG_IOB_BUFSIZE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else /* nqentry_avail == 0 || niob_avail == 0 */
|
else /* nqentry_avail == 0 || niob_avail == 0 */
|
||||||
{
|
{
|
||||||
/* No IOB chains or noIOBs are available.
|
/* No IOB chains or noIOBs are available.
|
||||||
|
Loading…
Reference in New Issue
Block a user