Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 508862e4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

parents 9cf93d7b 049b3ff5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -715,6 +715,7 @@ enum {
	NET_SCTP_PRSCTP_ENABLE		 = 14,
	NET_SCTP_SNDBUF_POLICY		 = 15,
	NET_SCTP_SACK_TIMEOUT		 = 16,
	NET_SCTP_RCVBUF_POLICY		 = 17,
};

/* /proc/sys/net/bridge */
+4 −3
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ typedef union {
	int error;
	sctp_state_t state;
	sctp_event_timeout_t to;
	unsigned long zero;
	void *ptr;
	struct sctp_chunk *chunk;
	struct sctp_association *asoc;
@@ -148,17 +149,17 @@ static inline sctp_arg_t SCTP_NULL(void)
}
static inline sctp_arg_t SCTP_NOFORCE(void)
{
	sctp_arg_t retval; retval.i32 = 0; return retval;
	sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval;
}
static inline sctp_arg_t SCTP_FORCE(void)
{
	sctp_arg_t retval; retval.i32 = 1; return retval;
	sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval;
}

#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
static inline sctp_arg_t	\
SCTP_## name (type arg)		\
{ sctp_arg_t retval; retval.elt = arg; return retval; }
{ sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; }

SCTP_ARG_CONSTRUCTOR(I32,	__s32, i32)
SCTP_ARG_CONSTRUCTOR(U32,	__u32, u32)
+16 −3
Original line number Diff line number Diff line
@@ -161,6 +161,13 @@ extern struct sctp_globals {
	 */
	int sndbuf_policy;

	/*
	 * Policy for preforming sctp/socket accounting
	 * 0   - do socket level accounting, all assocs share sk_rcvbuf
	 * 1   - do sctp accounting, each asoc may use sk_rcvbuf bytes
	 */
	int rcvbuf_policy;

	/* Delayed SACK timeout  200ms default*/
	int sack_timeout;

@@ -218,6 +225,7 @@ extern struct sctp_globals {
#define sctp_cookie_preserve_enable	(sctp_globals.cookie_preserve_enable)
#define sctp_max_retrans_association	(sctp_globals.max_retrans_association)
#define sctp_sndbuf_policy	 	(sctp_globals.sndbuf_policy)
#define sctp_rcvbuf_policy	 	(sctp_globals.rcvbuf_policy)
#define sctp_max_retrans_path		(sctp_globals.max_retrans_path)
#define sctp_max_retrans_init		(sctp_globals.max_retrans_init)
#define sctp_sack_timeout		(sctp_globals.sack_timeout)
@@ -1222,11 +1230,11 @@ struct sctp_endpoint {
	int last_key;
	int key_changed_at;

	/* Default timeouts.  */
	int timeouts[SCTP_NUM_TIMEOUT_TYPES];

	/* sendbuf acct. policy.	*/
	__u32 sndbuf_policy;

	/* rcvbuf acct. policy.	*/
	__u32 rcvbuf_policy;
};

/* Recover the outter endpoint structure. */
@@ -1553,6 +1561,11 @@ struct sctp_association {
	 */
	int sndbuf_used;

	/* This is the amount of memory that this association has allocated
	 * in the receive path at any given time.
	 */
	atomic_t rmem_alloc;

	/* This is the wait queue head for send requests waiting on
	 * the association sndbuf space.
	 */
+6 −2
Original line number Diff line number Diff line
@@ -699,12 +699,14 @@ static int __init inet6_init(void)
	/* Register the family here so that the init calls below will
	 * be able to create sockets. (?? is this dangerous ??)
	 */
	(void) sock_register(&inet6_family_ops);
	err = sock_register(&inet6_family_ops);
	if (err)
		goto out_unregister_raw_proto;

	/* Initialise ipv6 mibs */
	err = init_ipv6_mibs();
	if (err)
		goto out_unregister_raw_proto;
		goto out_unregister_sock;
	
	/*
	 *	ipngwg API draft makes clear that the correct semantics
@@ -796,6 +798,8 @@ static int __init inet6_init(void)
	ipv6_sysctl_unregister();
#endif
	cleanup_ipv6_mibs();
out_unregister_sock:
	sock_unregister(PF_INET6);
out_unregister_raw_proto:
	proto_unregister(&rawv6_prot);
out_unregister_udp_proto:
+29 −4
Original line number Diff line number Diff line
@@ -128,9 +128,29 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
	 */
	asoc->max_burst = sctp_max_burst;

	/* Copy things from the endpoint.  */
	/* initialize association timers */
	asoc->timeouts[SCTP_EVENT_TIMEOUT_NONE] = 0;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE] = asoc->rto_initial;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] = asoc->rto_initial;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = asoc->rto_initial;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX] = 0;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO] = 0;

	/* sctpimpguide Section 2.12.2
	 * If the 'T5-shutdown-guard' timer is used, it SHOULD be set to the
	 * recommended value of 5 times 'RTO.Max'.
	 */
        asoc->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD]
		= 5 * asoc->rto_max;

	asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] =
		SCTP_DEFAULT_TIMEOUT_SACK;
	asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] =
		sp->autoclose * HZ;
	
	/* Initilizes the timers */
	for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) {
		asoc->timeouts[i] = ep->timeouts[i];
		init_timer(&asoc->timers[i]);
		asoc->timers[i].function = sctp_timer_events[i];
		asoc->timers[i].data = (unsigned long) asoc;
@@ -157,10 +177,10 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
	 * RFC 6 - A SCTP receiver MUST be able to receive a minimum of
	 * 1500 bytes in one SCTP packet.
	 */
	if (sk->sk_rcvbuf < SCTP_DEFAULT_MINWINDOW)
	if ((sk->sk_rcvbuf/2) < SCTP_DEFAULT_MINWINDOW)
		asoc->rwnd = SCTP_DEFAULT_MINWINDOW;
	else
		asoc->rwnd = sk->sk_rcvbuf;
		asoc->rwnd = sk->sk_rcvbuf/2;

	asoc->a_rwnd = asoc->rwnd;

@@ -172,6 +192,9 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
	/* Set the sndbuf size for transmit.  */
	asoc->sndbuf_used = 0;

	/* Initialize the receive memory counter */
	atomic_set(&asoc->rmem_alloc, 0);

	init_waitqueue_head(&asoc->wait);

	asoc->c.my_vtag = sctp_generate_tag(ep);
@@ -380,6 +403,8 @@ static void sctp_association_destroy(struct sctp_association *asoc)
		spin_unlock_bh(&sctp_assocs_id_lock);
	}

	BUG_TRAP(!atomic_read(&asoc->rmem_alloc));

	if (asoc->base.malloced) {
		kfree(asoc);
		SCTP_DBG_OBJCNT_DEC(assoc);
Loading