diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-02-22 11:19:43 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-02-22 11:19:43 -0500 |
| commit | 32ad372a22daf4a5a425f5271faa23e1c914e333 (patch) | |
| tree | c60335b98ef34cb2ec643b116d5a3fb45e9dba96 /include | |
| parent | 3160222e5d173a6e726526cd3beeb0dfb9396d19 (diff) | |
| parent | 539bc6a481e050ad0dd202adefaa0da2a0c6f542 (diff) | |
Merge pobox.com:/garz/repo/linux-2.6
into pobox.com:/garz/repo/libata-2.6
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-m32r/bitops.h | 5 | ||||
| -rw-r--r-- | include/asm-ppc/pgtable.h | 4 | ||||
| -rw-r--r-- | include/asm-sparc64/compat.h | 59 | ||||
| -rw-r--r-- | include/asm-sparc64/uaccess.h | 6 | ||||
| -rw-r--r-- | include/linux/compat.h | 2 | ||||
| -rw-r--r-- | include/linux/fs.h | 35 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 1 | ||||
| -rw-r--r-- | include/linux/tcp.h | 57 | ||||
| -rw-r--r-- | include/net/tcp.h | 75 |
9 files changed, 157 insertions, 87 deletions
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h index dd8c7eb7263a..e78443981349 100644 --- a/include/asm-m32r/bitops.h +++ b/include/asm-m32r/bitops.h @@ -405,9 +405,10 @@ static __inline__ unsigned long ffz(unsigned long word) * @offset: The bitnumber to start searching at * @size: The maximum size to search */ -static __inline__ int find_next_zero_bit(void *addr, int size, int offset) +static __inline__ int find_next_zero_bit(const unsigned long *addr, + int size, int offset) { - unsigned long *p = ((unsigned long *) addr) + (offset >> 5); + const unsigned long *p = addr + (offset >> 5); unsigned long result = offset & ~31UL; unsigned long tmp; diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index fb6af1716074..642c86b74121 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -560,12 +560,12 @@ extern void flush_hash_one_pte(pte_t *ptep); static inline int ptep_test_and_clear_young(pte_t *ptep) { unsigned long old; - old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED); + old = pte_update(ptep, _PAGE_ACCESSED, 0); #if _PAGE_HASHPTE != 0 if (old & _PAGE_HASHPTE) flush_hash_one_pte(ptep); #endif - return old != 0; + return (old & _PAGE_ACCESSED) != 0; } static inline int ptep_test_and_clear_dirty(pte_t *ptep) diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index da9c81a6af5a..2950279dd776 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h @@ -24,6 +24,7 @@ typedef u16 compat_ipc_pid_t; typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; +typedef s32 compat_key_t; typedef s32 compat_int_t; typedef s32 compat_long_t; @@ -139,4 +140,62 @@ static __inline__ void __user *compat_alloc_user_space(long len) return (void __user *) (usp - len); } +struct compat_ipc64_perm { + compat_key_t key; + __kernel_uid_t uid; + __kernel_gid_t gid; + __kernel_uid_t cuid; + __kernel_gid_t cgid; + unsigned short __pad1; + compat_mode_t mode; + unsigned short __pad2; + unsigned short seq; + unsigned long __unused1; /* yes they really are 64bit pads */ + unsigned long __unused2; +}; + +struct compat_semid64_ds { + struct compat_ipc64_perm sem_perm; + unsigned int __pad1; + compat_time_t sem_otime; + unsigned int __pad2; + compat_time_t sem_ctime; + u32 sem_nsems; + u32 __unused1; + u32 __unused2; +}; + +struct compat_msqid64_ds { + struct compat_ipc64_perm msg_perm; + unsigned int __pad1; + compat_time_t msg_stime; + unsigned int __pad2; + compat_time_t msg_rtime; + unsigned int __pad3; + compat_time_t msg_ctime; + unsigned int msg_cbytes; + unsigned int msg_qnum; + unsigned int msg_qbytes; + compat_pid_t msg_lspid; + compat_pid_t msg_lrpid; + unsigned int __unused1; + unsigned int __unused2; +}; + +struct compat_shmid64_ds { + struct compat_ipc64_perm shm_perm; + unsigned int __pad1; + compat_time_t shm_atime; + unsigned int __pad2; + compat_time_t shm_dtime; + unsigned int __pad3; + compat_time_t shm_ctime; + compat_size_t shm_segsz; + compat_pid_t shm_cpid; + compat_pid_t shm_lpid; + unsigned int shm_nattch; + unsigned int __unused1; + unsigned int __unused2; +}; + #endif /* _ASM_SPARC64_COMPAT_H */ diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 28a52769dfc4..56646813a6af 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h @@ -49,10 +49,10 @@ do { \ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" ((val).seg)); \ } while(0) -#define __user_ok(addr,size) 1 +#define __user_ok(addr,size) ((void)(addr), (void)(size), 1) #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) -#define __access_ok(addr,size) 1 -#define access_ok(type,addr,size) 1 +#define __access_ok(addr,size) ((void)(addr), (void)(size), 1) +#define access_ok(type,addr,size) ((void)(type), (void)(addr), (void)(size), 1) static inline int verify_area(int type, const void __user * addr, unsigned long size) { diff --git a/include/linux/compat.h b/include/linux/compat.h index a62f5c960c75..f67748fda899 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -18,6 +18,8 @@ #define compat_jiffies_to_clock_t(x) \ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) +struct rusage; + struct compat_itimerspec { struct compat_timespec it_interval; struct compat_timespec it_value; diff --git a/include/linux/fs.h b/include/linux/fs.h index 84b3b114f943..30cb440cb6c8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -7,25 +7,8 @@ */ #include <linux/config.h> -#include <linux/linkage.h> #include <linux/limits.h> -#include <linux/wait.h> -#include <linux/types.h> -#include <linux/kdev_t.h> #include <linux/ioctl.h> -#include <linux/dcache.h> -#include <linux/stat.h> -#include <linux/cache.h> -#include <linux/kobject.h> -#include <asm/atomic.h> - -struct iovec; -struct nameidata; -struct pipe_inode_info; -struct poll_table_struct; -struct kstatfs; -struct vm_area_struct; -struct vfsmount; /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change @@ -216,14 +199,32 @@ extern int dir_notify_enable; #ifdef __KERNEL__ +#include <linux/linkage.h> +#include <linux/wait.h> +#include <linux/types.h> +#include <linux/kdev_t.h> +#include <linux/dcache.h> +#include <linux/stat.h> +#include <linux/cache.h> +#include <linux/kobject.h> #include <linux/list.h> #include <linux/radix-tree.h> #include <linux/prio_tree.h> #include <linux/audit.h> #include <linux/init.h> + +#include <asm/atomic.h> #include <asm/semaphore.h> #include <asm/byteorder.h> +struct iovec; +struct nameidata; +struct pipe_inode_info; +struct poll_table_struct; +struct kstatfs; +struct vm_area_struct; +struct vfsmount; + /* Used to be a macro which just called the function, now just a function */ extern void update_atime (struct inode *); diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 06bdf80154fb..33642be4ce00 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -344,6 +344,7 @@ enum NET_TCP_DEFAULT_WIN_SCALE=105, NET_TCP_MODERATE_RCVBUF=106, NET_TCP_TSO_WIN_DIVISOR=107, + NET_TCP_BIC_BETA=108, }; enum { diff --git a/include/linux/tcp.h b/include/linux/tcp.h index b31ca0400372..f56e734c1da0 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -210,6 +210,27 @@ enum tcp_congestion_algo { TCP_BIC, }; +struct tcp_options_received { +/* PAWS/RTTM data */ + long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ + __u32 ts_recent; /* Time stamp to echo next */ + __u32 rcv_tsval; /* Time stamp value */ + __u32 rcv_tsecr; /* Time stamp echo reply */ + char saw_tstamp; /* Saw TIMESTAMP on last packet */ + char tstamp_ok; /* TIMESTAMP seen on SYN packet */ + char sack_ok; /* SACK seen on SYN packet */ + char wscale_ok; /* Wscale seen on SYN packet */ + __u8 snd_wscale; /* Window scaling received from sender */ + __u8 rcv_wscale; /* Window scaling to send to receiver */ +/* SACKs data */ + __u8 dsack; /* D-SACK is scheduled */ + __u8 eff_sacks; /* Size of SACK array to send with next packet */ + __u8 num_sacks; /* Number of SACK blocks */ + __u8 __pad; + __u16 user_mss; /* mss requested by user in ioctl */ + __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ +}; + struct tcp_sock { /* inet_sock has to be the first member of tcp_sock */ struct inet_sock inet; @@ -262,22 +283,19 @@ struct tcp_sock { __u32 pmtu_cookie; /* Last pmtu seen by socket */ __u32 mss_cache; /* Cached effective mss, not including SACKS */ __u16 mss_cache_std; /* Like mss_cache, but without TSO */ - __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ __u16 ext2_header_len;/* Options depending on route */ __u8 ca_state; /* State of fast-retransmit machine */ __u8 retransmits; /* Number of unrecovered RTO timeouts. */ + __u32 frto_highmark; /* snd_nxt when RTO occurred */ __u8 reordering; /* Packet reordering metric. */ __u8 frto_counter; /* Number of new acks after RTO */ - __u32 frto_highmark; /* snd_nxt when RTO occurred */ __u8 adv_cong; /* Using Vegas, Westwood, or BIC */ __u8 defer_accept; /* User waits for some data after accept() */ - /* one byte hole, try to pack */ /* RTT measurement */ - __u8 backoff; /* backoff */ __u32 srtt; /* smoothed round trip time << 3 */ __u32 mdev; /* medium deviation */ __u32 mdev_max; /* maximal mdev for the last rtt period */ @@ -288,7 +306,15 @@ struct tcp_sock { __u32 packets_out; /* Packets which are "in flight" */ __u32 left_out; /* Packets which leaved network */ __u32 retrans_out; /* Retransmitted packets out */ + __u8 backoff; /* backoff */ +/* + * Options received (usually on last packet, some only on SYN packets). + */ + __u8 nonagle; /* Disable Nagle algorithm? */ + __u8 keepalive_probes; /* num of allowed keep alive probes */ + __u8 probes_out; /* unanswered 0 window probes */ + struct tcp_options_received rx_opt; /* * Slow start and congestion control (see also Nagle, and Karn & Partridge) @@ -314,40 +340,19 @@ struct tcp_sock { __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ __u32 pushed_seq; /* Last pushed seq, required to talk to windows */ __u32 copied_seq; /* Head of yet unread data */ -/* - * Options received (usually on last packet, some only on SYN packets). - */ - char tstamp_ok, /* TIMESTAMP seen on SYN packet */ - wscale_ok, /* Wscale seen on SYN packet */ - sack_ok; /* SACK seen on SYN packet */ - char saw_tstamp; /* Saw TIMESTAMP on last packet */ - __u8 snd_wscale; /* Window scaling received from sender */ - __u8 rcv_wscale; /* Window scaling to send to receiver */ - __u8 nonagle; /* Disable Nagle algorithm? */ - __u8 keepalive_probes; /* num of allowed keep alive probes */ - -/* PAWS/RTTM data */ - __u32 rcv_tsval; /* Time stamp value */ - __u32 rcv_tsecr; /* Time stamp echo reply */ - __u32 ts_recent; /* Time stamp to echo next */ - long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ /* SACKs data */ - __u16 user_mss; /* mss requested by user in ioctl */ - __u8 dsack; /* D-SACK is scheduled */ - __u8 eff_sacks; /* Size of SACK array to send with next packet */ struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ __u32 window_clamp; /* Maximal window to advertise */ __u32 rcv_ssthresh; /* Current window clamp */ - __u8 probes_out; /* unanswered 0 window probes */ - __u8 num_sacks; /* Number of SACK blocks */ __u16 advmss; /* Advertised MSS */ __u8 syn_retries; /* num of allowed syn retries */ __u8 ecn_flags; /* ECN status bits. */ __u16 prior_ssthresh; /* ssthresh saved at recovery start */ + __u16 __pad1; __u32 lost_out; /* Lost packets */ __u32 sacked_out; /* SACK'd packets */ __u32 fackets_out; /* FACK'd packets */ diff --git a/include/net/tcp.h b/include/net/tcp.h index 1a54cdba14ba..7355606725d4 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -505,9 +505,8 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk) # define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG) #endif -#define BICTCP_1_OVER_BETA 8 /* - * Fast recovery - * multiplicative decrease factor +#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation + * max_cwnd = snd_cwnd * beta */ #define BICTCP_MAX_INCREMENT 32 /* * Limit on the amount of @@ -606,6 +605,7 @@ extern int sysctl_tcp_nometrics_save; extern int sysctl_tcp_bic; extern int sysctl_tcp_bic_fast_convergence; extern int sysctl_tcp_bic_low_window; +extern int sysctl_tcp_bic_beta; extern int sysctl_tcp_moderate_rcvbuf; extern int sysctl_tcp_tso_win_divisor; @@ -832,9 +832,9 @@ static __inline__ void tcp_delack_init(struct tcp_sock *tp) memset(&tp->ack, 0, sizeof(tp->ack)); } -static inline void tcp_clear_options(struct tcp_sock *tp) +static inline void tcp_clear_options(struct tcp_options_received *rx_opt) { - tp->tstamp_ok = tp->sack_ok = tp->wscale_ok = tp->snd_wscale = 0; + rx_opt->tstamp_ok = rx_opt->sack_ok = rx_opt->wscale_ok = rx_opt->snd_wscale = 0; } enum tcp_tw_status @@ -883,7 +883,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, extern int tcp_listen_start(struct sock *sk); extern void tcp_parse_options(struct sk_buff *skb, - struct tcp_sock *tp, + struct tcp_options_received *opt_rx, int estab); /* @@ -1071,7 +1071,7 @@ static __inline__ void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) static __inline__ void tcp_fast_path_on(struct tcp_sock *tp) { - __tcp_fast_path_on(tp, tp->snd_wnd>>tp->snd_wscale); + __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); } static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) @@ -1244,15 +1244,16 @@ static inline __u32 tcp_recalc_ssthresh(struct tcp_sock *tp) if (tcp_is_bic(tp)) { if (sysctl_tcp_bic_fast_convergence && tp->snd_cwnd < tp->bictcp.last_max_cwnd) - tp->bictcp.last_max_cwnd - = (tp->snd_cwnd * (2*BICTCP_1_OVER_BETA-1)) - / (BICTCP_1_OVER_BETA/2); + tp->bictcp.last_max_cwnd = (tp->snd_cwnd * + (BICTCP_BETA_SCALE + + sysctl_tcp_bic_beta)) + / (2 * BICTCP_BETA_SCALE); else tp->bictcp.last_max_cwnd = tp->snd_cwnd; if (tp->snd_cwnd > sysctl_tcp_bic_low_window) - return max(tp->snd_cwnd - (tp->snd_cwnd/BICTCP_1_OVER_BETA), - 2U); + return max((tp->snd_cwnd * sysctl_tcp_bic_beta) + / BICTCP_BETA_SCALE, 2U); } return max(tp->snd_cwnd >> 1U, 2U); @@ -1322,7 +1323,7 @@ static inline __u32 tcp_current_ssthresh(struct tcp_sock *tp) static inline void tcp_sync_left_out(struct tcp_sock *tp) { - if (tp->sack_ok && + if (tp->rx_opt.sack_ok && (tp->sacked_out >= tp->packets_out - tp->lost_out)) tp->sacked_out = tp->packets_out - tp->lost_out; tp->left_out = tp->sacked_out + tp->lost_out; @@ -1648,39 +1649,39 @@ static __inline__ void tcp_done(struct sock *sk) tcp_destroy_sock(sk); } -static __inline__ void tcp_sack_reset(struct tcp_sock *tp) +static __inline__ void tcp_sack_reset(struct tcp_options_received *rx_opt) { - tp->dsack = 0; - tp->eff_sacks = 0; - tp->num_sacks = 0; + rx_opt->dsack = 0; + rx_opt->eff_sacks = 0; + rx_opt->num_sacks = 0; } static __inline__ void tcp_build_and_update_options(__u32 *ptr, struct tcp_sock *tp, __u32 tstamp) { - if (tp->tstamp_ok) { + if (tp->rx_opt.tstamp_ok) { *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); *ptr++ = htonl(tstamp); - *ptr++ = htonl(tp->ts_recent); + *ptr++ = htonl(tp->rx_opt.ts_recent); } - if (tp->eff_sacks) { - struct tcp_sack_block *sp = tp->dsack ? tp->duplicate_sack : tp->selective_acks; + if (tp->rx_opt.eff_sacks) { + struct tcp_sack_block *sp = tp->rx_opt.dsack ? tp->duplicate_sack : tp->selective_acks; int this_sack; *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | (TCPOPT_SACK << 8) | (TCPOLEN_SACK_BASE + - (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK))); - for(this_sack = 0; this_sack < tp->eff_sacks; this_sack++) { + (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK))); + for(this_sack = 0; this_sack < tp->rx_opt.eff_sacks; this_sack++) { *ptr++ = htonl(sp[this_sack].start_seq); *ptr++ = htonl(sp[this_sack].end_seq); } - if (tp->dsack) { - tp->dsack = 0; - tp->eff_sacks--; + if (tp->rx_opt.dsack) { + tp->rx_opt.dsack = 0; + tp->rx_opt.eff_sacks--; } } } @@ -1826,17 +1827,17 @@ static inline void tcp_synq_drop(struct sock *sk, struct open_request *req, } static __inline__ void tcp_openreq_init(struct open_request *req, - struct tcp_sock *tp, + struct tcp_options_received *rx_opt, struct sk_buff *skb) { req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ req->rcv_isn = TCP_SKB_CB(skb)->seq; - req->mss = tp->mss_clamp; - req->ts_recent = tp->saw_tstamp ? tp->rcv_tsval : 0; - req->tstamp_ok = tp->tstamp_ok; - req->sack_ok = tp->sack_ok; - req->snd_wscale = tp->snd_wscale; - req->wscale_ok = tp->wscale_ok; + req->mss = rx_opt->mss_clamp; + req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; + req->tstamp_ok = rx_opt->tstamp_ok; + req->sack_ok = rx_opt->sack_ok; + req->snd_wscale = rx_opt->snd_wscale; + req->wscale_ok = rx_opt->wscale_ok; req->acked = 0; req->ecn_ok = 0; req->rmt_port = skb->h.th->source; @@ -1885,11 +1886,11 @@ static inline int tcp_fin_time(const struct tcp_sock *tp) return fin_timeout; } -static inline int tcp_paws_check(const struct tcp_sock *tp, int rst) +static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int rst) { - if ((s32)(tp->rcv_tsval - tp->ts_recent) >= 0) + if ((s32)(rx_opt->rcv_tsval - rx_opt->ts_recent) >= 0) return 0; - if (xtime.tv_sec >= tp->ts_recent_stamp + TCP_PAWS_24DAYS) + if (xtime.tv_sec >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS) return 0; /* RST segments are not recommended to carry timestamp, @@ -1904,7 +1905,7 @@ static inline int tcp_paws_check(const struct tcp_sock *tp, int rst) However, we can relax time bounds for RST segments to MSL. */ - if (rst && xtime.tv_sec >= tp->ts_recent_stamp + TCP_PAWS_MSL) + if (rst && xtime.tv_sec >= rx_opt->ts_recent_stamp + TCP_PAWS_MSL) return 0; return 1; } |
