aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2012-07-21 03:56:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-22 15:13:46 -0400
commit5aa93bcf66f4af094d6f11096e81d5501a0b4ba5 (patch)
tree7bcf045fcae31a7e367e7eb1e0568b3702a25018 /include/net
parente3906486f616da7cc086a3ba06c0df4e5a48b4ab (diff)
sctp: Implement quick failover draft from tsvwg
I've seen several attempts recently made to do quick failover of sctp transports by reducing various retransmit timers and counters. While its possible to implement a faster failover on multihomed sctp associations, its not particularly robust, in that it can lead to unneeded retransmits, as well as false connection failures due to intermittent latency on a network. Instead, lets implement the new ietf quick failover draft found here: http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05 This will let the sctp stack identify transports that have had a small number of errors, and avoid using them quickly until their reliability can be re-established. I've tested this out on two virt guests connected via multiple isolated virt networks and believe its in compliance with the above draft and works well. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yasevich <vyasevich@gmail.com> CC: Sridhar Samudrala <sri@us.ibm.com> CC: "David S. Miller" <davem@davemloft.net> CC: linux-sctp@vger.kernel.org CC: joe@perches.com Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sctp/constants.h1
-rw-r--r--include/net/sctp/structs.h20
-rw-r--r--include/net/sctp/user.h11
3 files changed, 31 insertions, 1 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 942b864f613..d053d2e9987 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -334,6 +334,7 @@ typedef enum {
334typedef enum { 334typedef enum {
335 SCTP_TRANSPORT_UP, 335 SCTP_TRANSPORT_UP,
336 SCTP_TRANSPORT_DOWN, 336 SCTP_TRANSPORT_DOWN,
337 SCTP_TRANSPORT_PF,
337} sctp_transport_cmd_t; 338} sctp_transport_cmd_t;
338 339
339/* These are the address scopes defined mainly for IPv4 addresses 340/* These are the address scopes defined mainly for IPv4 addresses
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 536e439ddf1..fc5e60016e3 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -161,6 +161,12 @@ extern struct sctp_globals {
161 int max_retrans_path; 161 int max_retrans_path;
162 int max_retrans_init; 162 int max_retrans_init;
163 163
164 /* Potentially-Failed.Max.Retrans sysctl value
165 * taken from:
166 * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
167 */
168 int pf_retrans;
169
164 /* 170 /*
165 * Policy for preforming sctp/socket accounting 171 * Policy for preforming sctp/socket accounting
166 * 0 - do socket level accounting, all assocs share sk_sndbuf 172 * 0 - do socket level accounting, all assocs share sk_sndbuf
@@ -258,6 +264,7 @@ extern struct sctp_globals {
258#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) 264#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
259#define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy) 265#define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy)
260#define sctp_max_retrans_path (sctp_globals.max_retrans_path) 266#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
267#define sctp_pf_retrans (sctp_globals.pf_retrans)
261#define sctp_max_retrans_init (sctp_globals.max_retrans_init) 268#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
262#define sctp_sack_timeout (sctp_globals.sack_timeout) 269#define sctp_sack_timeout (sctp_globals.sack_timeout)
263#define sctp_hb_interval (sctp_globals.hb_interval) 270#define sctp_hb_interval (sctp_globals.hb_interval)
@@ -990,10 +997,15 @@ struct sctp_transport {
990 997
991 /* This is the max_retrans value for the transport and will 998 /* This is the max_retrans value for the transport and will
992 * be initialized from the assocs value. This can be changed 999 * be initialized from the assocs value. This can be changed
993 * using SCTP_SET_PEER_ADDR_PARAMS socket option. 1000 * using the SCTP_SET_PEER_ADDR_PARAMS socket option.
994 */ 1001 */
995 __u16 pathmaxrxt; 1002 __u16 pathmaxrxt;
996 1003
1004 /* This is the partially failed retrans value for the transport
1005 * and will be initialized from the assocs value. This can be changed
1006 * using the SCTP_PEER_ADDR_THLDS socket option
1007 */
1008 int pf_retrans;
997 /* PMTU : The current known path MTU. */ 1009 /* PMTU : The current known path MTU. */
998 __u32 pathmtu; 1010 __u32 pathmtu;
999 1011
@@ -1664,6 +1676,12 @@ struct sctp_association {
1664 */ 1676 */
1665 int max_retrans; 1677 int max_retrans;
1666 1678
1679 /* This is the partially failed retrans value for the transport
1680 * and will be initialized from the assocs value. This can be
1681 * changed using the SCTP_PEER_ADDR_THLDS socket option
1682 */
1683 int pf_retrans;
1684
1667 /* Maximum number of times the endpoint will retransmit INIT */ 1685 /* Maximum number of times the endpoint will retransmit INIT */
1668 __u16 max_init_attempts; 1686 __u16 max_init_attempts;
1669 1687
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 0842ef00b2f..1b02d7ad453 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -93,6 +93,7 @@ typedef __s32 sctp_assoc_t;
93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ 93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ 94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
95#define SCTP_AUTO_ASCONF 30 95#define SCTP_AUTO_ASCONF 30
96#define SCTP_PEER_ADDR_THLDS 31
96 97
97/* Internal Socket Options. Some of the sctp library functions are 98/* Internal Socket Options. Some of the sctp library functions are
98 * implemented using these socket options. 99 * implemented using these socket options.
@@ -649,6 +650,7 @@ struct sctp_paddrinfo {
649 */ 650 */
650enum sctp_spinfo_state { 651enum sctp_spinfo_state {
651 SCTP_INACTIVE, 652 SCTP_INACTIVE,
653 SCTP_PF,
652 SCTP_ACTIVE, 654 SCTP_ACTIVE,
653 SCTP_UNCONFIRMED, 655 SCTP_UNCONFIRMED,
654 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ 656 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
@@ -741,4 +743,13 @@ typedef struct {
741 int sd; 743 int sd;
742} sctp_peeloff_arg_t; 744} sctp_peeloff_arg_t;
743 745
746/*
747 * Peer Address Thresholds socket option
748 */
749struct sctp_paddrthlds {
750 sctp_assoc_t spt_assoc_id;
751 struct sockaddr_storage spt_address;
752 __u16 spt_pathmaxrxt;
753 __u16 spt_pathpfthld;
754};
744#endif /* __net_sctp_user_h__ */ 755#endif /* __net_sctp_user_h__ */