Commit d7f7f767 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into home.osdl.org:/home/torvalds/v2.5/linux
parents a398aec5 2ee95970
......@@ -185,7 +185,6 @@ struct inet6_skb_parm
int iif;
__u16 ra;
__u16 hop;
__u16 auth;
__u16 dst0;
__u16 srcrt;
__u16 dst1;
......@@ -211,7 +210,6 @@ struct ipv6_pinfo {
rxhlim:1,
hopopts:1,
dstopts:1,
authhdr:1,
rxflow:1;
} bits;
__u8 all;
......
......@@ -583,6 +583,8 @@ enum {
NET_SCTP_PRESERVE_ENABLE = 11,
NET_SCTP_MAX_BURST = 12,
NET_SCTP_ADDIP_ENABLE = 13,
NET_SCTP_RMEM = 14,
NET_SCTP_WMEM = 15,
};
/* /proc/sys/net/bridge */
......
......@@ -323,7 +323,7 @@ typedef enum {
#define SCTP_DEFAULT_COOKIE_LIFE_USEC 0 /* microseconds */
#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
* to which we will raise the P-MTU.
*/
......
......@@ -193,6 +193,10 @@ extern struct sctp_globals {
/* Flag to indicate if addip is enabled. */
int addip_enable;
/* socket receive and send buffer sizes. */
int rmem;
int wmem;
} sctp_globals;
#define sctp_rto_initial (sctp_globals.rto_initial)
......@@ -221,6 +225,8 @@ extern struct sctp_globals {
#define sctp_local_addr_list (sctp_globals.local_addr_list)
#define sctp_local_addr_lock (sctp_globals.local_addr_lock)
#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. */
typedef enum {
......
......@@ -318,12 +318,12 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
#ifdef CONFIG_ECONET_NATIVE
dev_hold(dev);
skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15,
skb = sock_alloc_send_skb(sk, len+LL_RESERVED_SPACE(dev),
msg->msg_flags & MSG_DONTWAIT, &err);
if (skb==NULL)
goto out_unlock;
skb_reserve(skb, (dev->hard_header_len+15)&~15);
skb_reserve(skb, LL_RESERVED_SPACE(dev));
skb->nh.raw = skb->data;
eb = (struct ec_cb *)&skb->cb;
......
......@@ -20,8 +20,7 @@ config IP_VS
be used to choose which server the connection is directed to,
thus load balancing can be achieved among the servers. For more
information and its administration program, please visit the
following URL:
http://www.linuxvirtualserver.org/
following URL: <http://www.linuxvirtualserver.org/>.
If you want to compile it in kernel, say Y. To compile it as a
module, choose M here. If unsure, say N.
......
......@@ -242,10 +242,6 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
struct ipv6_rt_hdr *rthdr = (struct ipv6_rt_hdr *)(skb->nh.raw + opt->srcrt);
put_cmsg(msg, SOL_IPV6, IPV6_RTHDR, (rthdr->hdrlen+1) << 3, rthdr);
}
if (np->rxopt.bits.authhdr && opt->auth) {
u8 *ptr = skb->nh.raw + opt->auth;
put_cmsg(msg, SOL_IPV6, IPV6_AUTHHDR, (ptr[1]+1)<<2, ptr);
}
if (np->rxopt.bits.dstopts && opt->dst1) {
u8 *ptr = skb->nh.raw + opt->dst1;
put_cmsg(msg, SOL_IPV6, IPV6_DSTOPTS, (ptr[1]+1)<<3, ptr);
......@@ -378,26 +374,6 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
opt->dst1opt = hdr;
break;
case IPV6_AUTHHDR:
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_opt_hdr))) {
err = -EINVAL;
goto exit_f;
}
hdr = (struct ipv6_opt_hdr *)CMSG_DATA(cmsg);
len = ((hdr->hdrlen + 2) << 2);
if (cmsg->cmsg_len < CMSG_LEN(len)) {
err = -EINVAL;
goto exit_f;
}
if (len & ~7) {
err = -EINVAL;
goto exit_f;
}
opt->opt_flen += len;
opt->auth = hdr;
break;
case IPV6_RTHDR:
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_rt_hdr))) {
err = -EINVAL;
......
......@@ -518,17 +518,6 @@ static u8 *ipv6_build_exthdr(struct sk_buff *skb, u8 *prev_hdr, u8 type, struct
return &h->nexthdr;
}
static u8 *ipv6_build_authhdr(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_opt_hdr *opt)
{
struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_put(skb, (opt->hdrlen+2)<<2);
memcpy(h, opt, (opt->hdrlen+2)<<2);
h->nexthdr = *prev_hdr;
*prev_hdr = NEXTHDR_AUTH;
return &h->nexthdr;
}
u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt,
struct in6_addr *daddr, u32 jumbolen)
{
......@@ -567,8 +556,6 @@ u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptio
u8 *ipv6_build_frag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt)
{
if (opt->auth)
prev_hdr = ipv6_build_authhdr(skb, prev_hdr, opt->auth);
if (opt->dst1opt)
prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst1opt);
return prev_hdr;
......@@ -608,15 +595,6 @@ static void ipv6_push_exthdr(struct sk_buff *skb, u8 *proto, u8 type, struct ipv
*proto = type;
}
static void ipv6_push_authhdr(struct sk_buff *skb, u8 *proto, struct ipv6_opt_hdr *opt)
{
struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_push(skb, (opt->hdrlen+2)<<2);
memcpy(h, opt, (opt->hdrlen+2)<<2);
h->nexthdr = *proto;
*proto = NEXTHDR_AUTH;
}
void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt,
u8 *proto,
struct in6_addr **daddr)
......@@ -633,8 +611,6 @@ void ipv6_push_frag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, u8 *pr
{
if (opt->dst1opt)
ipv6_push_exthdr(skb, proto, NEXTHDR_DEST, opt->dst1opt);
if (opt->auth)
ipv6_push_authhdr(skb, proto, opt->auth);
}
struct ipv6_txoptions *
......@@ -652,8 +628,6 @@ ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt)
*((char**)&opt2->dst0opt) += dif;
if (opt2->dst1opt)
*((char**)&opt2->dst1opt) += dif;
if (opt2->auth)
*((char**)&opt2->auth) += dif;
if (opt2->srcrt)
*((char**)&opt2->srcrt) += dif;
}
......
......@@ -230,11 +230,6 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval,
retv = 0;
break;
case IPV6_AUTHHDR:
np->rxopt.bits.authhdr = valbool;
retv = 0;
break;
case IPV6_DSTOPTS:
np->rxopt.bits.dstopts = valbool;
retv = 0;
......@@ -623,10 +618,6 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval,
val = np->rxopt.bits.hopopts;
break;
case IPV6_AUTHHDR:
val = np->rxopt.bits.authhdr;
break;
case IPV6_DSTOPTS:
val = np->rxopt.bits.dstopts;
break;
......
......@@ -22,7 +22,7 @@ config IP6_NF_QUEUE
IPv64 Project - Work based in IPv64 draft by Arturo Azcorra.
Universidad Carlos III de Madrid
Universidad Politecnica de Alcala de Henares
email: fanton@it.uc3m.es
email: <fanton@it.uc3m.es>.
To compile it as a module, choose M here. If unsure, say N.
......
......@@ -30,7 +30,7 @@ config NET_SCH_HTB
---help---
Say Y here if you want to use the Hierarchical Token Buckets (HTB)
packet scheduling algorithm for some of your network devices. See
URL http://luxik.cdi.cz/~devik/qos/htb/ for complete manual and
<http://luxik.cdi.cz/~devik/qos/htb/> for complete manual and
in-depth articles.
HTB is very similar to the CBQ regarding its goals however is has
......
......@@ -16,7 +16,7 @@ config IP_SCTP
---help---
Stream Control Transmission Protocol
From RFC 2960 (http://www.ietf.org/rfc/rfc2960.txt)
From RFC 2960 <http://www.ietf.org/rfc/rfc2960.txt>.
"SCTP is a reliable transport protocol operating on top of a
connectionless packet network such as IP. It offers the following
......@@ -37,19 +37,6 @@ config IP_SCTP
If in doubt, say N.
config SCTP_ADLER32
bool "SCTP: Use old checksum (Adler-32)"
depends on IP_SCTP
help
RFC2960 currently specifies the Adler-32 checksum algorithm for SCTP.
This has been deprecated and replaced by an algorithm now referred
to as crc32c.
If you say Y, this will use the Adler-32 algorithm, this might be
useful for interoperation with downlevel peers.
If unsure, say N.
config SCTP_DBG_MSG
bool "SCTP: Debug messages"
depends on IP_SCTP
......
......@@ -9,13 +9,7 @@ sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
transport.o chunk.o sm_make_chunk.o ulpevent.o \
inqueue.o outqueue.o ulpqueue.o command.o \
tsnmap.o bind_addr.o socket.o primitive.o \
output.o input.o debug.o ssnmap.o proc.o
ifeq ($(CONFIG_SCTP_ADLER32), y)
sctp-y += adler32.o
else
sctp-y += crc32c.o
endif
output.o input.o debug.o ssnmap.o proc.o crc32c.o
sctp-$(CONFIG_SCTP_DBG_OBJCNT) += objcnt.o
sctp-$(CONFIG_SYSCTL) += sysctl.o
......
/* SCTP kernel reference Implementation
* Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc.
* Copyright (c) 2003 International Business Machines, Corp.
*
* This file is part of the SCTP kernel reference Implementation
*
* This file has direct heritage from the SCTP user-level reference
* implementation by R. Stewart, et al. These functions implement the
* Adler-32 algorithm as specified by RFC 2960.
*
* The SCTP reference implementation is free software;
* you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* The SCTP reference implementation is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ************************
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU CC; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Please send any bug reports or fixes you make to the
* email address(es):
* lksctp developers <lksctp-developers@lists.sourceforge.net>
*
* Or submit a bug report through the following website:
* http://www.sf.net/projects/lksctp
*
* Written or modified by:
* Randall Stewart <rstewar1@email.mot.com>
* Ken Morneau <kmorneau@cisco.com>
* Qiaobing Xie <qxie1@email.mot.com>
* Sridhar Samudrala <sri@us.ibm.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
*/
/* This is an entry point for external calls
* Define this function in the header file. This is
* direct from rfc1950, ...
*
* The following C code computes the Adler-32 checksum of a data buffer.
* It is written for clarity, not for speed. The sample code is in the
* ANSI C programming language. Non C users may find it easier to read
* with these hints:
*
* & Bitwise AND operator.
* >> Bitwise right shift operator. When applied to an
* unsigned quantity, as here, right shift inserts zero bit(s)
* at the left.
* << Bitwise left shift operator. Left shift inserts zero
* bit(s) at the right.
* ++ "n++" increments the variable n.
* % modulo operator: a % b is the remainder of a divided by b.
*
* Well, the above is a bit of a lie, I have optimized this a small
* tad, but I have commented the original lines below
*/
#include <linux/types.h>
#include <net/sctp/sctp.h>
#define BASE 65521 /* largest prime smaller than 65536 */
/* Performance work as shown this pig to be the
* worst CPU wise guy. I have done what I could think
* of on my flight to Australia but I am sure some
* clever assembly could speed this up, but of
* course this would require the dreaded #ifdef's for
* architecture. If you can speed this up more, pass
* it back and we will incorporate it :-)
*/
unsigned long update_adler32(unsigned long adler,
unsigned char *buf, int len)
{
__u32 s1 = adler & 0xffff;
__u32 s2 = (adler >> 16) & 0xffff;
int n;
for (n = 0; n < len; n++,buf++) {
/* s1 = (s1 + buf[n]) % BASE */
/* first we add */
s1 = (s1 + *buf);
/* Now if we need to, we do a mod by
* subtracting. It seems a bit faster
* since I really will only ever do
* one subtract at the MOST, since buf[n]
* is a max of 255.
*/
if (s1 >= BASE)
s1 -= BASE;
/* s2 = (s2 + s1) % BASE */
/* first we add */
s2 = (s2 + s1);
/* again, it is more efficient (it seems) to
* subtract since the most s2 will ever be
* is (BASE-1 + BASE-1) in the worse case.
* This would then be (2 * BASE) - 2, which
* will still only do one subtract. On Intel
* this is much better to do this way and
* avoid the divide. Have not -pg'd on
* sparc.
*/
if (s2 >= BASE) {
/* s2 %= BASE;*/
s2 -= BASE;
}
}
/* Return the adler32 of the bytes buf[0..len-1] */
return (s2 << 16) + s1;
}
__u32 sctp_start_cksum(__u8 *ptr, __u16 count)
{
/*
* Update a running Adler-32 checksum with the bytes
* buf[0..len-1] and return the updated checksum. The Adler-32
* checksum should be initialized to 1.
*/
__u32 adler = 1L;
__u32 zero = 0L;
/* Calculate the CRC up to the checksum field. */
adler = update_adler32(adler, ptr,
sizeof(struct sctphdr) - sizeof(__u32));
/* Skip over the checksum field. */
adler = update_adler32(adler, (unsigned char *) &zero,
sizeof(__u32));
ptr += sizeof(struct sctphdr);
count -= sizeof(struct sctphdr);
/* Calculate the rest of the Adler-32. */
adler = update_adler32(adler, ptr, count);
return adler;
}
__u32 sctp_update_cksum(__u8 *ptr, __u16 count, __u32 adler)
{
adler = update_adler32(adler, ptr, count);
return adler;
}
__u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 count, __u32 adler)
{
/* Its not worth it to try harder. Adler32 is obsolescent. */
adler = update_adler32(adler, from, count);
memcpy(to, from, count);
return adler;
}
__u32 sctp_end_cksum(__u32 adler)
{
return adler;
}
......@@ -192,7 +192,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc,
asoc->rwnd_over = 0;
/* 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. */
asoc->sndbuf_used = 0;
......@@ -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
* later when we process the INIT.
*/
peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;
peer->ssthresh = sctp_rmem;
peer->partial_bytes_acked = 0;
peer->flight_size = 0;
......
......@@ -148,12 +148,8 @@ struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
sp->autoclose * HZ;
/* Set up the default send/receive buffer space. */
/* FIXME - Should the min and max window size be configurable
* sysctl parameters as opposed to be constants?
*/
sk->sk_rcvbuf = SCTP_DEFAULT_MAXWINDOW;
sk->sk_sndbuf = SCTP_DEFAULT_MAXWINDOW * 2;
sk->sk_rcvbuf = sctp_rmem;
sk->sk_sndbuf = sctp_wmem;
/* Use SCTP specific send buffer space queues. */
sk->sk_write_space = sctp_write_space;
......
/* SCTP kernel reference Implementation
* (C) Copyright IBM Corp. 2001, 2004
* Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc.
* Copyright (c) 2001-2003 International Business Machines, Corp.
* Copyright (c) 2001 Intel Corp.
* Copyright (c) 2001 Nokia, Inc.
* Copyright (c) 2001 La Monte H.P. Yarroll
......@@ -445,7 +445,10 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
memset(&fl, 0x0, sizeof(struct flowi));
fl.fl4_dst = daddr->v4.sin_addr.s_addr;
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)
fl.fl4_src = saddr->v4.sin_addr.s_addr;
......@@ -1046,6 +1049,10 @@ __init int sctp_init(void)
sctp_max_instreams = SCTP_DEFAULT_INSTREAMS;
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.
* The methodology is similar to that of the tcp hash tables.
*/
......
......@@ -170,6 +170,22 @@ static ctl_table sctp_table[] = {
.mode = 0644,
.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 }
};
......
......@@ -768,7 +768,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
needed = ntohs(chunk->chunk_hdr->length);
needed -= sizeof(sctp_data_chunk_t);
} else
needed = SCTP_DEFAULT_MAXWINDOW;
needed = sctp_rmem;
freed = 0;
......
......@@ -71,7 +71,7 @@ static LIST_HEAD(all_tasks);
* rpciod-related stuff
*/
static DECLARE_WAIT_QUEUE_HEAD(rpciod_idle);
static DECLARE_WAIT_QUEUE_HEAD(rpciod_killer);
static DECLARE_COMPLETION(rpciod_killer);
static DECLARE_MUTEX(rpciod_sema);
static unsigned int rpciod_users;
static pid_t rpciod_pid;
......@@ -950,7 +950,6 @@ rpciod_task_pending(void)
static int
rpciod(void *ptr)
{
wait_queue_head_t *assassin = (wait_queue_head_t*) ptr;
int rounds = 0;
lock_kernel();
......@@ -992,11 +991,11 @@ rpciod(void *ptr)
rpciod_killall();
}
rpciod_pid = 0;
wake_up(assassin);
dprintk("RPC: rpciod exiting\n");
unlock_kernel();
rpciod_pid = 0;
complete_and_exit(&rpciod_killer, 0);
return 0;
}
......@@ -1041,7 +1040,7 @@ rpciod_up(void)
/*
* Create the rpciod thread and wait for it to start.
*/
error = kernel_thread(rpciod, &rpciod_killer, 0);
error = kernel_thread(rpciod, NULL, 0);
if (error < 0) {
printk(KERN_WARNING "rpciod_up: create thread failed, error=%d\n", error);
rpciod_users--;
......@@ -1057,8 +1056,6 @@ rpciod_up(void)
void
rpciod_down(void)
{
unsigned long flags;
down(&rpciod_sema);
dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
if (rpciod_users) {
......@@ -1073,27 +1070,8 @@ rpciod_down(void)
}
kill_proc(rpciod_pid, SIGKILL, 1);
/*
* Usually rpciod will exit very quickly, so we
* wait briefly before checking the process id.
*/
clear_thread_flag(TIF_SIGPENDING);
yield();
/*
* Display a message if we're going to wait longer.
*/
while (rpciod_pid) {
dprintk("rpciod_down: waiting for pid %d to exit\n", rpciod_pid);
if (signalled()) {
dprintk("rpciod_down: caught signal\n");
break;
}
interruptible_sleep_on(&rpciod_killer);
}
spin_lock_irqsave(&current->sighand->siglock, flags);
recalc_sigpending();
spin_unlock_irqrestore(&current->sighand->siglock, flags);
out:
wait_for_completion(&rpciod_killer);
out:
up(&rpciod_sema);
}
......
......@@ -1863,14 +1863,19 @@ static int unix_seq_show(struct seq_file *seq, void *v)
sock_i_ino(s));
if (u->addr) {
int i;
int i, len;
seq_putc(seq, ' ');
for (i = 0; i < u->addr->len-sizeof(short); i++)
seq_putc(seq, u->addr->name->sun_path[i]);
if (UNIX_ABSTRACT(s))
i = 0;
len = u->addr->len - sizeof(short);
if (!UNIX_ABSTRACT(s))
len--;
else {
seq_putc(seq, '@');
i++;
}
for ( ; i < len; i++)
seq_putc(seq, u->addr->name->sun_path[i]);
}
unix_state_runlock(s);
seq_putc(seq, '\n');
......
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