Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2008 20:07:24 +0000 (13:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2008 20:07:24 +0000 (13:07 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  sch_htb: fix "too many events" situation
  connector: convert to single-threaded workqueue
  [ATM]: When proc_create() fails, do some error handling work and return -ENOMEM.
  [SUNGEM]: Fix NAPI assertion failure.
  BNX2X: prevent ethtool from setting port type
  [9P] net/9p/trans_fd.c: remove unused variable
  [IPV6] net/ipv6/ndisc.c: remove unused variable
  [IPV4] fib_trie: fix warning from rcu_assign_poinger
  [TCP]: Let skbs grow over a page on fast peers
  [DLCI]: Fix tiny race between module unload and sock_ioctl.
  [SCTP]: Fix build warnings with IPV6 disabled.
  [IPV4]: Fix null dereference in ip_defrag

13 files changed:
drivers/connector/cn_queue.c
drivers/net/bnx2x.c
drivers/net/sungem.c
include/net/sctp/sctp.h
net/9p/trans_fd.c
net/atm/clip.c
net/atm/lec.c
net/ipv4/fib_trie.c
net/ipv4/ip_fragment.c
net/ipv4/tcp.c
net/ipv6/ndisc.c
net/sched/sch_htb.c
net/socket.c

index 5732ca3259f982be418950077e5735e07eadbde7..b6fe7e7a2c2fd71e6818a850fd6b8adbfd613bf5 100644 (file)
@@ -146,7 +146,7 @@ struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *nls)
 
        dev->nls = nls;
 
-       dev->cn_queue = create_workqueue(dev->name);
+       dev->cn_queue = create_singlethread_workqueue(dev->name);
        if (!dev->cn_queue) {
                kfree(dev);
                return NULL;
index 8af142ccf373feb060b82fae91e7a5fe9adae10b..de32b3fba322b475765d895a5bb8846b60ca8309 100644 (file)
@@ -63,8 +63,8 @@
 #include "bnx2x.h"
 #include "bnx2x_init.h"
 
-#define DRV_MODULE_VERSION      "1.40.22"
-#define DRV_MODULE_RELDATE      "2007/11/27"
+#define DRV_MODULE_VERSION      "1.42.3"
+#define DRV_MODULE_RELDATE      "2008/3/9"
 #define BNX2X_BC_VER           0x040200
 
 /* Time in jiffies before concluding the transmitter is hung. */
@@ -8008,38 +8008,6 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
           cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver,
           cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt);
 
-       switch (cmd->port) {
-       case PORT_TP:
-               if (!(bp->supported & SUPPORTED_TP)) {
-                       DP(NETIF_MSG_LINK, "TP not supported\n");
-                       return -EINVAL;
-               }
-
-               if (bp->phy_flags & PHY_XGXS_FLAG) {
-                       bnx2x_link_reset(bp);
-                       bnx2x_link_settings_supported(bp, SWITCH_CFG_1G);
-                       bnx2x_phy_deassert(bp);
-               }
-               break;
-
-       case PORT_FIBRE:
-               if (!(bp->supported & SUPPORTED_FIBRE)) {
-                       DP(NETIF_MSG_LINK, "FIBRE not supported\n");
-                       return -EINVAL;
-               }
-
-               if (!(bp->phy_flags & PHY_XGXS_FLAG)) {
-                       bnx2x_link_reset(bp);
-                       bnx2x_link_settings_supported(bp, SWITCH_CFG_10G);
-                       bnx2x_phy_deassert(bp);
-               }
-               break;
-
-       default:
-               DP(NETIF_MSG_LINK, "Unknown port type\n");
-               return -EINVAL;
-       }
-
        if (cmd->autoneg == AUTONEG_ENABLE) {
                if (!(bp->supported & SUPPORTED_Autoneg)) {
                        DP(NETIF_MSG_LINK, "Aotoneg not supported\n");
index 97212799c513a8f64b5ab6ecef5f366d886a3aa8..4291458955ef7ac9ae1cf5201b3e72a998d61bde 100644 (file)
@@ -912,7 +912,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
                 * rx ring - must call napi_disable(), which
                 * schedule_timeout()'s if polling is already disabled.
                 */
-               work_done += gem_rx(gp, budget);
+               work_done += gem_rx(gp, budget - work_done);
 
                if (work_done >= budget)
                        return work_done;
index 57ed3e323d9706dd430f4ab745138ef26da8b29d..ea806732b084d08e12507c7dd0f7eb22f92e239a 100644 (file)
@@ -389,7 +389,7 @@ void sctp_v6_del_protocol(void);
 
 #else /* #ifdef defined(CONFIG_IPV6) */
 
-static inline void sctp_v6_pf_init(void) { return 0; }
+static inline void sctp_v6_pf_init(void) { return; }
 static inline void sctp_v6_pf_exit(void) { return; }
 static inline int sctp_v6_protosw_init(void) { return 0; }
 static inline void sctp_v6_protosw_exit(void) { return; }
index 1aa9d51753981c483b7778e28c0f9a026714c7c2..4e8d4e724b96c3c48c82030086df5f0a7c6cb37a 100644 (file)
@@ -861,7 +861,6 @@ static void p9_mux_free_request(struct p9_conn *m, struct p9_req *req)
 
 static void p9_mux_flush_cb(struct p9_req *freq, void *a)
 {
-       p9_conn_req_callback cb;
        int tag;
        struct p9_conn *m;
        struct p9_req *req, *rreq, *rptr;
@@ -872,7 +871,6 @@ static void p9_mux_flush_cb(struct p9_req *freq, void *a)
                freq->tcall->params.tflush.oldtag);
 
        spin_lock(&m->lock);
-       cb = NULL;
        tag = freq->tcall->params.tflush.oldtag;
        req = NULL;
        list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
index d30167c0b48eb980ed337237ddc50b797d8c5a1c..2ab1e36098fd2b1f2fa059c2eebf6e150b10f8e8 100644 (file)
@@ -947,6 +947,8 @@ static const struct file_operations arp_seq_fops = {
 };
 #endif
 
+static void atm_clip_exit_noproc(void);
+
 static int __init atm_clip_init(void)
 {
        neigh_table_init_no_netlink(&clip_tbl);
@@ -963,18 +965,22 @@ static int __init atm_clip_init(void)
                struct proc_dir_entry *p;
 
                p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
+               if (!p) {
+                       printk(KERN_ERR "Unable to initialize "
+                              "/proc/net/atm/arp\n");
+                       atm_clip_exit_noproc();
+                       return -ENOMEM;
+               }
        }
 #endif
 
        return 0;
 }
 
-static void __exit atm_clip_exit(void)
+static void atm_clip_exit_noproc(void)
 {
        struct net_device *dev, *next;
 
-       remove_proc_entry("arp", atm_proc_root);
-
        unregister_inetaddr_notifier(&clip_inet_notifier);
        unregister_netdevice_notifier(&clip_dev_notifier);
 
@@ -1005,6 +1011,13 @@ static void __exit atm_clip_exit(void)
        clip_tbl_hook = NULL;
 }
 
+static void __exit atm_clip_exit(void)
+{
+       remove_proc_entry("arp", atm_proc_root);
+
+       atm_clip_exit_noproc();
+}
+
 module_init(atm_clip_init);
 module_exit(atm_clip_exit);
 MODULE_AUTHOR("Werner Almesberger");
index 0e450d12f0358651d9fd5bb0ecada2461c7960f8..a2efa7ff41f128a665172bc593eeed557163ac63 100644 (file)
@@ -1250,6 +1250,10 @@ static int __init lane_module_init(void)
        struct proc_dir_entry *p;
 
        p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
+       if (!p) {
+               printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n");
+               return -ENOMEM;
+       }
 #endif
 
        register_atm_ioctl(&lane_ioctl_ops);
index 1ff446d0fa8bca4121b1436b778b830202cd9b09..f6cdc012eec559a28a176cd00569fee0bf171a08 100644 (file)
@@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
        return rcu_dereference(ret);
 }
 
+/* Same as rcu_assign_pointer
+ * but that macro() assumes that value is a pointer.
+ */
 static inline void node_set_parent(struct node *node, struct tnode *ptr)
 {
-       rcu_assign_pointer(node->parent,
-                          (unsigned long)ptr | NODE_TYPE(node));
+       smp_wmb();
+       node->parent = (unsigned long)ptr | NODE_TYPE(node);
 }
 
 static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
index a2e92f9709db8459bd573e82c6842b6d9ea1d715..3b2e5adca8384dd1ec83224329c89d9709475dc4 100644 (file)
@@ -568,7 +568,7 @@ int ip_defrag(struct sk_buff *skb, u32 user)
 
        IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
 
-       net = skb->dev->nd_net;
+       net = skb->dev ? skb->dev->nd_net : skb->dst->dev->nd_net;
        /* Start by cleaning up the memory. */
        if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh)
                ip_evictor(net);
index 071e83a894ad9c02081f24b9ba243c77f7ea8d7c..39b629ac240411d6092622dc543abfe4f0779dc5 100644 (file)
@@ -735,7 +735,7 @@ new_segment:
                if (!(psize -= copy))
                        goto out;
 
-               if (skb->len < mss_now || (flags & MSG_OOB))
+               if (skb->len < size_goal || (flags & MSG_OOB))
                        continue;
 
                if (forced_push(tp)) {
@@ -981,7 +981,7 @@ new_segment:
                        if ((seglen -= copy) == 0 && iovlen == 0)
                                goto out;
 
-                       if (skb->len < mss_now || (flags & MSG_OOB))
+                       if (skb->len < size_goal || (flags & MSG_OOB))
                                continue;
 
                        if (forced_push(tp)) {
index 0d33a7d32125b80f102d28e851202c16d2f14fed..51557c27a0cdfc8e5d65337bf12ae0a4cf041da7 100644 (file)
@@ -1420,7 +1420,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
        u8 *opt;
        int rd_len;
        int err;
-       int hlen;
        u8 ha_buf[MAX_ADDR_LEN], *ha = NULL;
 
        dev = skb->dev;
@@ -1491,7 +1490,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
                return;
        }
 
-       hlen = 0;
 
        skb_reserve(buff, LL_RESERVED_SPACE(dev));
        ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr,
index 795c761ad99fb4cc07d61f79a327061f895c69c8..66148cc4759ee862a848a1d802d04e13dd89b290 100644 (file)
@@ -711,9 +711,11 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
  */
 static psched_time_t htb_do_events(struct htb_sched *q, int level)
 {
-       int i;
-
-       for (i = 0; i < 500; i++) {
+       /* don't run for longer than 2 jiffies; 2 is used instead of
+          1 to simplify things when jiffy is going to be incremented
+          too soon */
+       unsigned long stop_at = jiffies + 2;
+       while (time_before(jiffies, stop_at)) {
                struct htb_class *cl;
                long diff;
                struct rb_node *p = rb_first(&q->wait_pq[level]);
@@ -731,9 +733,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level)
                if (cl->cmode != HTB_CAN_SEND)
                        htb_add_to_wait_tree(q, cl, diff);
        }
-       if (net_ratelimit())
-               printk(KERN_WARNING "htb: too many events !\n");
-       return q->now + PSCHED_TICKS_PER_SEC / 10;
+       /* too much load - let's continue on next jiffie */
+       return q->now + PSCHED_TICKS_PER_SEC / HZ;
 }
 
 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
index b6d35cd72a50988e2075683ff757902ec7af6ccc..9d3fbfbc8535c8b3f2e0639990098730ba4ecbc7 100644 (file)
@@ -909,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
                        if (!dlci_ioctl_hook)
                                request_module("dlci");
 
-                       if (dlci_ioctl_hook) {
-                               mutex_lock(&dlci_ioctl_mutex);
+                       mutex_lock(&dlci_ioctl_mutex);
+                       if (dlci_ioctl_hook)
                                err = dlci_ioctl_hook(cmd, argp);
-                               mutex_unlock(&dlci_ioctl_mutex);
-                       }
+                       mutex_unlock(&dlci_ioctl_mutex);
                        break;
                default:
                        err = sock->ops->ioctl(sock, cmd, arg);