]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/tg3-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Tue, 20 Dec 2005 00:46:14 +0000 (16:46 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 20 Dec 2005 00:46:14 +0000 (16:46 -0800)
16 files changed:
arch/arm/kernel/calls.S
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
drivers/char/Kconfig
include/linux/rtnetlink.h
include/net/xfrm.h
net/bridge/br_netfilter.c
net/ipv4/netfilter/Makefile
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/netfilter/Kconfig
net/ipv6/route.c
net/ipv6/xfrm6_policy.c
net/sctp/socket.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c

index 2ad4aa2a1536c1ca22e1843352cdd9d2ac9cfbb7..55076a75e5bf3794de942c7f7abe3e1993bfb18e 100644 (file)
@@ -131,7 +131,7 @@ __syscall_start:
                .long   sys_wait4
 /* 115 */      .long   sys_swapoff
                .long   sys_sysinfo
-               .long   sys_ipc_wrapper
+               .long   sys_ipc
                .long   sys_fsync
                .long   sys_sigreturn_wrapper
 /* 120 */      .long   sys_clone_wrapper
@@ -254,7 +254,7 @@ __syscall_start:
                .long   sys_fremovexattr
                .long   sys_tkill
                .long   sys_sendfile64
-/* 240 */      .long   sys_futex_wrapper
+/* 240 */      .long   sys_futex
                .long   sys_sched_setaffinity
                .long   sys_sched_getaffinity
                .long   sys_io_setup
@@ -284,7 +284,7 @@ __syscall_start:
                .long   sys_fstatfs64
                .long   sys_tgkill
                .long   sys_utimes
-/* 270 */      .long   sys_arm_fadvise64_64_wrapper
+/* 270 */      .long   sys_arm_fadvise64_64
                .long   sys_pciconfig_iobase
                .long   sys_pciconfig_read
                .long   sys_pciconfig_write
@@ -333,7 +333,7 @@ __syscall_start:
                .long   sys_inotify_init
                .long   sys_inotify_add_watch
                .long   sys_inotify_rm_watch
-               .long   sys_mbind_wrapper
+               .long   sys_mbind
 /* 320 */      .long   sys_get_mempolicy
                .long   sys_set_mempolicy
 __syscall_end:
index d9fb819bf7cc3960aedb4b9836451371458a4893..2a8d27e18fa7765c13229cbb91f31a113c1b113d 100644 (file)
@@ -611,6 +611,47 @@ ENTRY(__switch_to)
        .globl  __kuser_helper_start
 __kuser_helper_start:
 
+/*
+ * Reference prototype:
+ *
+ *     void __kernel_memory_barrier(void)
+ *
+ * Input:
+ *
+ *     lr = return address
+ *
+ * Output:
+ *
+ *     none
+ *
+ * Clobbered:
+ *
+ *     the Z flag might be lost
+ *
+ * Definition and user space usage example:
+ *
+ *     typedef void (__kernel_dmb_t)(void);
+ *     #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
+ *
+ * Apply any needed memory barrier to preserve consistency with data modified
+ * manually and __kuser_cmpxchg usage.
+ *
+ * This could be used as follows:
+ *
+ * #define __kernel_dmb() \
+ *         asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
+ *             : : : "lr","cc" )
+ */
+
+__kuser_memory_barrier:                                @ 0xffff0fa0
+
+#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
+       mcr     p15, 0, r0, c7, c10, 5  @ dmb
+#endif
+       mov     pc, lr
+
+       .align  5
+
 /*
  * Reference prototype:
  *
@@ -642,6 +683,8 @@ __kuser_helper_start:
  * The C flag is also set if *ptr was changed to allow for assembly
  * optimization in the calling code.
  *
+ * Note: this routine already includes memory barriers as needed.
+ *
  * For example, a user space atomic_add implementation could look like this:
  *
  * #define atomic_add(ptr, val) \
@@ -698,10 +741,16 @@ __kuser_cmpxchg:                          @ 0xffff0fc0
 
 #else
 
+#ifdef CONFIG_SMP
+       mcr     p15, 0, r0, c7, c10, 5  @ dmb
+#endif
        ldrex   r3, [r2]
        subs    r3, r3, r0
        strexeq r3, r1, [r2]
        rsbs    r0, r3, #0
+#ifdef CONFIG_SMP
+       mcr     p15, 0, r0, c7, c10, 5  @ dmb
+#endif
        mov     pc, lr
 
 #endif
index f7f18307523754ba6fda73990ac5033e08cf1f70..e2b42997ad33ee0f1da6ec4a75440d16ce3c3b06 100644 (file)
@@ -145,7 +145,7 @@ ENTRY(vector_swi)
 #endif
        enable_irq
 
-       str     r4, [sp, #-S_OFF]!              @ push fifth arg
+       stmdb   sp!, {r4, r5}                   @ push fifth and sixth args
 
        get_thread_info tsk
        ldr     ip, [tsk, #TI_FLAGS]            @ check for syscall tracing
@@ -204,7 +204,7 @@ ENTRY(sys_call_table)
  * Special system call wrappers
  */
 @ r0 = syscall number
-@ r5 = syscall table
+@ r8 = syscall table
                .type   sys_syscall, #function
 sys_syscall:
                eor     scno, r0, #__NR_SYSCALL_BASE
@@ -255,22 +255,6 @@ sys_sigaltstack_wrapper:
                ldr     r2, [sp, #S_OFF + S_SP]
                b       do_sigaltstack
 
-sys_futex_wrapper:
-               str     r5, [sp, #4]            @ push sixth arg
-               b       sys_futex
-
-sys_arm_fadvise64_64_wrapper:
-               str     r5, [sp, #4]            @ push r5 to stack
-               b       sys_arm_fadvise64_64
-
-sys_mbind_wrapper:
-               str     r5, [sp, #4]
-               b       sys_mbind
-
-sys_ipc_wrapper:
-               str     r5, [sp, #4]            @ push sixth arg
-               b       sys_ipc
-
 /*
  * Note: off_4k (r5) is always units of 4K.  If we can't do the requested
  * offset, we return EINVAL.
index b46a72d782d6ca5d8249dd72e4d4181208799d28..696f72787fe851126b836709af51e18e84d6092c 100644 (file)
@@ -687,7 +687,7 @@ config NVRAM
 
 config RTC
        tristate "Enhanced Real Time Clock Support"
-       depends on !PPC32 && !PARISC && !IA64 && !M68K
+       depends on !PPC32 && !PARISC && !IA64 && !M68K && (!(SPARC32 || SPARC64) || PCI)
        ---help---
          If you say Y here and create a character special file /dev/rtc with
          major number 10 and minor number 135 using mknod ("man mknod"), you
index c231e9a08f0bb2b2365b7f5f568de8c459385a59..d50482ba27fe17dab4678df7c3e8aa586130955c 100644 (file)
@@ -866,6 +866,7 @@ enum rtnetlink_groups {
 #define        RTNLGRP_IPV4_MROUTE     RTNLGRP_IPV4_MROUTE
        RTNLGRP_IPV4_ROUTE,
 #define RTNLGRP_IPV4_ROUTE     RTNLGRP_IPV4_ROUTE
+       RTNLGRP_NOP1,
        RTNLGRP_IPV6_IFADDR,
 #define RTNLGRP_IPV6_IFADDR    RTNLGRP_IPV6_IFADDR
        RTNLGRP_IPV6_MROUTE,
@@ -876,8 +877,11 @@ enum rtnetlink_groups {
 #define RTNLGRP_IPV6_IFINFO    RTNLGRP_IPV6_IFINFO
        RTNLGRP_DECnet_IFADDR,
 #define RTNLGRP_DECnet_IFADDR  RTNLGRP_DECnet_IFADDR
+       RTNLGRP_NOP2,
        RTNLGRP_DECnet_ROUTE,
 #define RTNLGRP_DECnet_ROUTE   RTNLGRP_DECnet_ROUTE
+       RTNLGRP_NOP3,
+       RTNLGRP_NOP4,
        RTNLGRP_IPV6_PREFIX,
 #define RTNLGRP_IPV6_PREFIX    RTNLGRP_IPV6_PREFIX
        __RTNLGRP_MAX
index 5beae1ccd57405e5a86ab7a6250799fd0909dc84..1cdb8791213781f7115cd554c29fb3aaee893c38 100644 (file)
@@ -890,6 +890,7 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
 extern void xfrm_policy_flush(void);
 extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
 extern int xfrm_flush_bundles(void);
+extern void xfrm_flush_all_bundles(void);
 extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family);
 extern void xfrm_init_pmtu(struct dst_entry *dst);
 
index d8e36b7751255b17e736f35060dead6b21eebb69..43a0b35dfe6f7acf7c33f64e3bf3b0569b35f04c 100644 (file)
@@ -295,7 +295,7 @@ static int check_hbh_len(struct sk_buff *skb)
        len -= 2;
 
        while (len > 0) {
-               int optlen = raw[off+1]+2;
+               int optlen = skb->nh.raw[off+1]+2;
 
                switch (skb->nh.raw[off]) {
                case IPV6_TLV_PAD0:
@@ -308,18 +308,15 @@ static int check_hbh_len(struct sk_buff *skb)
                case IPV6_TLV_JUMBO:
                        if (skb->nh.raw[off+1] != 4 || (off&3) != 2)
                                goto bad;
-
                        pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2));
-
+                       if (pkt_len <= IPV6_MAXPLEN ||
+                           skb->nh.ipv6h->payload_len)
+                               goto bad;
                        if (pkt_len > skb->len - sizeof(struct ipv6hdr))
                                goto bad;
-                       if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
-                               if (__pskb_trim(skb,
-                                   pkt_len + sizeof(struct ipv6hdr)))
-                                       goto bad;
-                               if (skb->ip_summed == CHECKSUM_HW)
-                                       skb->ip_summed = CHECKSUM_NONE;
-                       }
+                       if (pskb_trim_rcsum(skb,
+                           pkt_len+sizeof(struct ipv6hdr)))
+                               goto bad;
                        break;
                default:
                        if (optlen > len)
index 058c48e258fc560f9a08fc422f280a10bc49cdd1..d0a447e520a23c05c7d8751c77b0792fd70617db 100644 (file)
@@ -12,6 +12,7 @@ ip_nat_pptp-objs      := ip_nat_helper_pptp.o ip_nat_proto_gre.o
 
 # connection tracking
 obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
+obj-$(CONFIG_IP_NF_NAT) += ip_nat.o
 
 # conntrack netlink interface
 obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o
@@ -41,7 +42,7 @@ obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
 # the three instances of ip_tables
 obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
 obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
-obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o ip_nat.o
+obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
 obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o
 
 # matches
index b2b60f3e9cdd652a1858283e1cf051af88c9a279..42196ba3b0b912701d727b8a4ede46108292b49e 100644 (file)
@@ -182,6 +182,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
                case IPPROTO_UDP:
                case IPPROTO_TCP:
                case IPPROTO_SCTP:
+               case IPPROTO_DCCP:
                        if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
                                u16 *ports = (u16 *)xprth;
 
index 73a23b4130a57fa41f82334ccc96bf6e35709e6f..4ea8cf7c0cc443bab3fe8cfa5c860e8e6592f12c 100644 (file)
@@ -1596,9 +1596,17 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
           not good.
         */
        if (valid_lft >= 0x7FFFFFFF/HZ)
-               rt_expires = 0;
+               rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ);
        else
-               rt_expires = jiffies + valid_lft * HZ;
+               rt_expires = valid_lft * HZ;
+
+       /*
+        * We convert this (in jiffies) to clock_t later.
+        * Avoid arithmetic overflow there as well.
+        * Overflow can happen only if HZ < USER_HZ.
+        */
+       if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ)
+               rt_expires = 0x7FFFFFFF / USER_HZ;
 
        if (pinfo->onlink) {
                struct rt6_info *rt;
@@ -1610,12 +1618,12 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
                                        ip6_del_rt(rt, NULL, NULL, NULL);
                                        rt = NULL;
                                } else {
-                                       rt->rt6i_expires = rt_expires;
+                                       rt->rt6i_expires = jiffies + rt_expires;
                                }
                        }
                } else if (valid_lft) {
                        addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,
-                                             dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
+                                             dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
                }
                if (rt)
                        dst_release(&rt->u.dst);
index 060d61202412c500020205508e874e7e1a63582f..04912f9b35c36a8d80cfeb1a6e245035847b4416 100644 (file)
@@ -211,7 +211,7 @@ config IP6_NF_TARGET_REJECT
 
 config IP6_NF_TARGET_NFQUEUE
        tristate "NFQUEUE Target Support"
-       depends on IP_NF_IPTABLES
+       depends on IP6_NF_IPTABLES
        help
          This Target replaced the old obsolete QUEUE target.
 
index a7a537b5059537bb7d7fd5291323277333c22cb7..7c68bfbee36193caca29325ad160d5be62c73265 100644 (file)
@@ -829,7 +829,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh,
        }
 
        rt->u.dst.obsolete = -1;
-       rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
+       rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info);
        if (nlh && (r = NLMSG_DATA(nlh))) {
                rt->rt6i_protocol = r->rtm_protocol;
        } else {
index cf1d91e74c82a3939ecd2f796ea385fb7eefcff1..69bd957380e7025fe393c720bde30974c4691284 100644 (file)
@@ -214,6 +214,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
                case IPPROTO_UDP:
                case IPPROTO_TCP:
                case IPPROTO_SCTP:
+               case IPPROTO_DCCP:
                        if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) {
                                u16 *ports = (u16 *)exthdr;
 
index 1f7f244806b7747050fd7ce5360bca4cb2068433..9df888e932c57097cd803629d08a8e9f70e8cafa 100644 (file)
@@ -156,10 +156,6 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
                                sizeof(struct sk_buff) +
                                sizeof(struct sctp_chunk);
 
-       sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) +
-                               sizeof(struct sk_buff) +
-                               sizeof(struct sctp_chunk);
-
        atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
 }
 
@@ -4426,7 +4422,7 @@ cleanup:
  * tcp_poll().  Note that, based on these implementations, we don't
  * lock the socket in this function, even though it seems that,
  * ideally, locking or some other mechanisms can be used to ensure
- * the integrity of the counters (sndbuf and wmem_queued) used
+ * the integrity of the counters (sndbuf and wmem_alloc) used
  * in this place.  We assume that we don't need locks either until proven
  * otherwise.
  *
@@ -4833,10 +4829,6 @@ static void sctp_wfree(struct sk_buff *skb)
                                sizeof(struct sk_buff) +
                                sizeof(struct sctp_chunk);
 
-       sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) +
-                               sizeof(struct sk_buff) +
-                               sizeof(struct sctp_chunk);
-
        atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
 
        sock_wfree(skb);
@@ -4920,7 +4912,7 @@ void sctp_write_space(struct sock *sk)
 
 /* Is there any sndbuf space available on the socket?
  *
- * Note that wmem_queued is the sum of the send buffers on all of the
+ * Note that sk_wmem_alloc is the sum of the send buffers on all of the
  * associations on the same socket.  For a UDP-style socket with
  * multiple associations, it is possible for it to be "unwriteable"
  * prematurely.  I assume that this is acceptable because
@@ -4933,7 +4925,7 @@ static int sctp_writeable(struct sock *sk)
 {
        int amt = 0;
 
-       amt = sk->sk_sndbuf - sk->sk_wmem_queued;
+       amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
        if (amt < 0)
                amt = 0;
        return amt;
index 0db9e57013fdfaf738b608d688ea44b1d5e7cfe6..54a4be6a7d269de50d3db7683b6020785bf0a15f 100644 (file)
@@ -1014,13 +1014,12 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
 }
 EXPORT_SYMBOL(__xfrm_route_forward);
 
-/* Optimize later using cookies and generation ids. */
-
 static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
 {
-       if (!stale_bundle(dst))
-               return dst;
-
+       /* If it is marked obsolete, which is how we even get here,
+        * then we have purged it from the policy bundle list and we
+        * did that for a good reason.
+        */
        return NULL;
 }
 
@@ -1104,6 +1103,16 @@ int xfrm_flush_bundles(void)
        return 0;
 }
 
+static int always_true(struct dst_entry *dst)
+{
+       return 1;
+}
+
+void xfrm_flush_all_bundles(void)
+{
+       xfrm_prune_bundles(always_true);
+}
+
 void xfrm_init_pmtu(struct dst_entry *dst)
 {
        do {
index 7cf48aa6c95bdb48a9438c6c4a3159fefe403869..479effc97666e92092d7e735c6cd85b113462304 100644 (file)
@@ -431,6 +431,8 @@ void xfrm_state_insert(struct xfrm_state *x)
        spin_lock_bh(&xfrm_state_lock);
        __xfrm_state_insert(x);
        spin_unlock_bh(&xfrm_state_lock);
+
+       xfrm_flush_all_bundles();
 }
 EXPORT_SYMBOL(xfrm_state_insert);
 
@@ -478,6 +480,9 @@ out:
        spin_unlock_bh(&xfrm_state_lock);
        xfrm_state_put_afinfo(afinfo);
 
+       if (!err)
+               xfrm_flush_all_bundles();
+
        if (x1) {
                xfrm_state_delete(x1);
                xfrm_state_put(x1);