Commit 7e7c6dbc authored by Sridhar Samudrala's avatar Sridhar Samudrala

Merge us.ibm.com:/home/sridhar/BK/linux-2.6.1

into us.ibm.com:/home/sridhar/BK/lksctp-2.6.1
parents 7704432c b7b0f33f
...@@ -581,6 +581,8 @@ enum { ...@@ -581,6 +581,8 @@ enum {
NET_SCTP_PRESERVE_ENABLE = 11, NET_SCTP_PRESERVE_ENABLE = 11,
NET_SCTP_MAX_BURST = 12, NET_SCTP_MAX_BURST = 12,
NET_SCTP_ADDIP_ENABLE = 13, NET_SCTP_ADDIP_ENABLE = 13,
NET_SCTP_RMEM = 14,
NET_SCTP_WMEM = 15,
}; };
/* /proc/sys/net/bridge */ /* /proc/sys/net/bridge */
......
...@@ -323,7 +323,7 @@ typedef enum { ...@@ -323,7 +323,7 @@ typedef enum {
#define SCTP_DEFAULT_COOKIE_LIFE_USEC 0 /* microseconds */ #define SCTP_DEFAULT_COOKIE_LIFE_USEC 0 /* microseconds */
#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */
#define SCTP_DEFAULT_MAXWINDOW 32768 /* default rwnd size */ #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */
#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit
* to which we will raise the P-MTU. * to which we will raise the P-MTU.
*/ */
......
...@@ -193,6 +193,10 @@ extern struct sctp_globals { ...@@ -193,6 +193,10 @@ extern struct sctp_globals {
/* Flag to indicate if addip is enabled. */ /* Flag to indicate if addip is enabled. */
int addip_enable; int addip_enable;
/* socket receive and send buffer sizes. */
int rmem;
int wmem;
} sctp_globals; } sctp_globals;
#define sctp_rto_initial (sctp_globals.rto_initial) #define sctp_rto_initial (sctp_globals.rto_initial)
...@@ -221,6 +225,8 @@ extern struct sctp_globals { ...@@ -221,6 +225,8 @@ extern struct sctp_globals {
#define sctp_local_addr_list (sctp_globals.local_addr_list) #define sctp_local_addr_list (sctp_globals.local_addr_list)
#define sctp_local_addr_lock (sctp_globals.local_addr_lock) #define sctp_local_addr_lock (sctp_globals.local_addr_lock)
#define sctp_addip_enable (sctp_globals.addip_enable) #define sctp_addip_enable (sctp_globals.addip_enable)
#define sctp_rmem (sctp_globals.rmem)
#define sctp_wmem (sctp_globals.wmem)
/* SCTP Socket type: UDP or TCP style. */ /* SCTP Socket type: UDP or TCP style. */
typedef enum { typedef enum {
......
...@@ -192,7 +192,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc, ...@@ -192,7 +192,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc,
asoc->rwnd_over = 0; asoc->rwnd_over = 0;
/* Use my own max window until I learn something better. */ /* Use my own max window until I learn something better. */
asoc->peer.rwnd = SCTP_DEFAULT_MAXWINDOW; asoc->peer.rwnd = sctp_rmem;
/* Set the sndbuf size for transmit. */ /* Set the sndbuf size for transmit. */
asoc->sndbuf_used = 0; asoc->sndbuf_used = 0;
...@@ -498,7 +498,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -498,7 +498,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
* so initialize ssthresh to the default value and it will be set * so initialize ssthresh to the default value and it will be set
* later when we process the INIT. * later when we process the INIT.
*/ */
peer->ssthresh = SCTP_DEFAULT_MAXWINDOW; peer->ssthresh = sctp_rmem;
peer->partial_bytes_acked = 0; peer->partial_bytes_acked = 0;
peer->flight_size = 0; peer->flight_size = 0;
......
...@@ -148,12 +148,8 @@ struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, ...@@ -148,12 +148,8 @@ struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
sp->autoclose * HZ; sp->autoclose * HZ;
/* Set up the default send/receive buffer space. */ /* Set up the default send/receive buffer space. */
sk->sk_rcvbuf = sctp_rmem;
/* FIXME - Should the min and max window size be configurable sk->sk_sndbuf = sctp_wmem;
* sysctl parameters as opposed to be constants?
*/
sk->sk_rcvbuf = SCTP_DEFAULT_MAXWINDOW;
sk->sk_sndbuf = SCTP_DEFAULT_MAXWINDOW * 2;
/* Use SCTP specific send buffer space queues. */ /* Use SCTP specific send buffer space queues. */
sk->sk_write_space = sctp_write_space; sk->sk_write_space = sctp_write_space;
......
/* SCTP kernel reference Implementation /* SCTP kernel reference Implementation
* (C) Copyright IBM Corp. 2001, 2004
* Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 1999-2001 Motorola, Inc.
* Copyright (c) 2001-2003 International Business Machines, Corp.
* Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Intel Corp.
* Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 Nokia, Inc.
* Copyright (c) 2001 La Monte H.P. Yarroll * Copyright (c) 2001 La Monte H.P. Yarroll
...@@ -445,7 +445,10 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, ...@@ -445,7 +445,10 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
memset(&fl, 0x0, sizeof(struct flowi)); memset(&fl, 0x0, sizeof(struct flowi));
fl.fl4_dst = daddr->v4.sin_addr.s_addr; fl.fl4_dst = daddr->v4.sin_addr.s_addr;
fl.proto = IPPROTO_SCTP; fl.proto = IPPROTO_SCTP;
if (asoc) {
fl.fl4_tos = RT_CONN_FLAGS(asoc->base.sk);
fl.oif = asoc->base.sk->sk_bound_dev_if;
}
if (saddr) if (saddr)
fl.fl4_src = saddr->v4.sin_addr.s_addr; fl.fl4_src = saddr->v4.sin_addr.s_addr;
...@@ -1046,6 +1049,10 @@ __init int sctp_init(void) ...@@ -1046,6 +1049,10 @@ __init int sctp_init(void)
sctp_max_instreams = SCTP_DEFAULT_INSTREAMS; sctp_max_instreams = SCTP_DEFAULT_INSTREAMS;
sctp_max_outstreams = SCTP_DEFAULT_OUTSTREAMS; sctp_max_outstreams = SCTP_DEFAULT_OUTSTREAMS;
/* Initialize default send & receive buffer sizes. */
sctp_rmem = SCTP_DEFAULT_MAXWINDOW;
sctp_wmem = SCTP_DEFAULT_MAXWINDOW;
/* Size and allocate the association hash table. /* Size and allocate the association hash table.
* The methodology is similar to that of the tcp hash tables. * The methodology is similar to that of the tcp hash tables.
*/ */
......
...@@ -170,6 +170,22 @@ static ctl_table sctp_table[] = { ...@@ -170,6 +170,22 @@ static ctl_table sctp_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = &proc_dointvec
}, },
{
.ctl_name = NET_SCTP_RMEM,
.procname = "rmem",
.data = &sctp_rmem,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.ctl_name = NET_SCTP_WMEM,
.procname = "wmem",
.data = &sctp_wmem,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{ .ctl_name = 0 } { .ctl_name = 0 }
}; };
......
...@@ -768,7 +768,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, ...@@ -768,7 +768,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
needed = ntohs(chunk->chunk_hdr->length); needed = ntohs(chunk->chunk_hdr->length);
needed -= sizeof(sctp_data_chunk_t); needed -= sizeof(sctp_data_chunk_t);
} else } else
needed = SCTP_DEFAULT_MAXWINDOW; needed = sctp_rmem;
freed = 0; freed = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment