aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2012-06-29 23:04:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-01 01:44:35 -0400
commit4244854d22bf8f782698c5224b9191c8d2d42610 (patch)
tree1c6d81517625a33e427a183587783a966960e135 /include/net/sctp
parent0e90b49ca4b891f085b57559a3071a4feefb496c (diff)
sctp: be more restrictive in transport selection on bundled sacks
It was noticed recently that when we send data on a transport, its possible that we might bundle a sack that arrived on a different transport. While this isn't a major problem, it does go against the SHOULD requirement in section 6.4 of RFC 2960: An endpoint SHOULD transmit reply chunks (e.g., SACK, HEARTBEAT ACK, etc.) to the same destination transport address from which it received the DATA or control chunk to which it is replying. This rule should also be followed if the endpoint is bundling DATA chunks together with the reply chunk. This patch seeks to correct that. It restricts the bundling of sack operations to only those transports which have moved the ctsn of the association forward since the last sack. By doing this we guarantee that we only bundle outbound saks on a transport that has received a chunk since the last sack. This brings us into stricter compliance with the RFC. Vlad had initially suggested that we strictly allow only sack bundling on the transport that last moved the ctsn forward. While this makes sense, I was concerned that doing so prevented us from bundling in the case where we had received chunks that moved the ctsn on multiple transports. In those cases, the RFC allows us to select any of the transports having received chunks to bundle the sack on. so I've modified the approach to allow for that, by adding a state variable to each transport that tracks weather it has moved the ctsn since the last sack. This I think keeps our behavior (and performance), close enough to our current profile that I think we can do this without a sysctl knob to enable/disable it. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yaseivch <vyasevich@gmail.com> CC: David S. Miller <davem@davemloft.net> CC: linux-sctp@vger.kernel.org Reported-by: Michele Baldessari <michele@redhat.com> Reported-by: sorin serban <sserban@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/structs.h4
-rw-r--r--include/net/sctp/tsnmap.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e4652fe58958..fecdf31816f2 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -912,6 +912,9 @@ struct sctp_transport {
912 /* Is this structure kfree()able? */ 912 /* Is this structure kfree()able? */
913 malloced:1; 913 malloced:1;
914 914
915 /* Has this transport moved the ctsn since we last sacked */
916 __u32 sack_generation;
917
915 struct flowi fl; 918 struct flowi fl;
916 919
917 /* This is the peer's IP address and port. */ 920 /* This is the peer's IP address and port. */
@@ -1584,6 +1587,7 @@ struct sctp_association {
1584 */ 1587 */
1585 __u8 sack_needed; /* Do we need to sack the peer? */ 1588 __u8 sack_needed; /* Do we need to sack the peer? */
1586 __u32 sack_cnt; 1589 __u32 sack_cnt;
1590 __u32 sack_generation;
1587 1591
1588 /* These are capabilities which our peer advertised. */ 1592 /* These are capabilities which our peer advertised. */
1589 __u8 ecn_capable:1, /* Can peer do ECN? */ 1593 __u8 ecn_capable:1, /* Can peer do ECN? */
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index e7728bc14ccf..2c5d2b4d5d1e 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -117,7 +117,8 @@ void sctp_tsnmap_free(struct sctp_tsnmap *map);
117int sctp_tsnmap_check(const struct sctp_tsnmap *, __u32 tsn); 117int sctp_tsnmap_check(const struct sctp_tsnmap *, __u32 tsn);
118 118
119/* Mark this TSN as seen. */ 119/* Mark this TSN as seen. */
120int sctp_tsnmap_mark(struct sctp_tsnmap *, __u32 tsn); 120int sctp_tsnmap_mark(struct sctp_tsnmap *, __u32 tsn,
121 struct sctp_transport *trans);
121 122
122/* Mark this TSN and all lower as seen. */ 123/* Mark this TSN and all lower as seen. */
123void sctp_tsnmap_skip(struct sctp_tsnmap *map, __u32 tsn); 124void sctp_tsnmap_skip(struct sctp_tsnmap *map, __u32 tsn);