57 lines
2.2 KiB
Diff
57 lines
2.2 KiB
Diff
From: Sridhar Samudrala <sri@us.ibm.com>
|
|
Date: Sat, 30 Sep 2006 00:09:05 +0000 (-0700)
|
|
Subject: [SCTP]: Include sk_buff overhead while updating the peer's receive window.
|
|
X-Git-Tag: v2.6.19-rc1
|
|
X-Git-Url: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=cd49788563d3b9e2ec0b316fa57aef1c0cb3bd4b
|
|
|
|
[SCTP]: Include sk_buff overhead while updating the peer's receive window.
|
|
|
|
Currently if the sender is sending small messages, it can cause a receiver
|
|
to run out of receive buffer space even when the advertised receive window
|
|
is still open and results in packet drops and retransmissions. Including
|
|
a overhead while updating the sender's view of peer receive window will
|
|
reduce the chances of receive buffer space overshooting the receive window.
|
|
|
|
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
|
|
--- a/net/sctp/output.c
|
|
+++ b/net/sctp/output.c
|
|
@@ -633,7 +633,7 @@ static sctp_xmit_t sctp_packet_append_da
|
|
* data will fit or delay in hopes of bundling a full
|
|
* sized packet.
|
|
*/
|
|
- if (len < asoc->pathmtu - packet->overhead) {
|
|
+ if (len < asoc->frag_point) {
|
|
retval = SCTP_XMIT_NAGLE_DELAY;
|
|
goto finish;
|
|
}
|
|
@@ -645,7 +645,13 @@ static sctp_xmit_t sctp_packet_append_da
|
|
/* Keep track of how many bytes are in flight to the receiver. */
|
|
asoc->outqueue.outstanding_bytes += datasize;
|
|
|
|
- /* Update our view of the receiver's rwnd. */
|
|
+ /* Update our view of the receiver's rwnd. Include sk_buff overhead
|
|
+ * while updating peer.rwnd so that it reduces the chances of a
|
|
+ * receiver running out of receive buffer space even when receive
|
|
+ * window is still open. This can happen when a sender is sending
|
|
+ * sending small messages.
|
|
+ */
|
|
+ datasize += sizeof(struct sk_buff);
|
|
if (datasize < rwnd)
|
|
rwnd -= datasize;
|
|
else
|
|
--- a/net/sctp/outqueue.c
|
|
+++ b/net/sctp/outqueue.c
|
|
@@ -416,7 +416,8 @@ void sctp_retransmit_mark(struct sctp_ou
|
|
* (Section 7.2.4)), add the data size of those
|
|
* chunks to the rwnd.
|
|
*/
|
|
- q->asoc->peer.rwnd += sctp_data_size(chunk);
|
|
+ q->asoc->peer.rwnd += (sctp_data_size(chunk) +
|
|
+ sizeof(struct sk_buff));
|
|
q->outstanding_bytes -= sctp_data_size(chunk);
|
|
transport->flight_size -= sctp_data_size(chunk);
|
|
|