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

* 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

+43 -59
+1 -1
drivers/connector/cn_queue.c
··· 146 147 dev->nls = nls; 148 149 - dev->cn_queue = create_workqueue(dev->name); 150 if (!dev->cn_queue) { 151 kfree(dev); 152 return NULL;
··· 146 147 dev->nls = nls; 148 149 + dev->cn_queue = create_singlethread_workqueue(dev->name); 150 if (!dev->cn_queue) { 151 kfree(dev); 152 return NULL;
+2 -34
drivers/net/bnx2x.c
··· 63 #include "bnx2x.h" 64 #include "bnx2x_init.h" 65 66 - #define DRV_MODULE_VERSION "1.40.22" 67 - #define DRV_MODULE_RELDATE "2007/11/27" 68 #define BNX2X_BC_VER 0x040200 69 70 /* Time in jiffies before concluding the transmitter is hung. */ ··· 8007 cmd->cmd, cmd->supported, cmd->advertising, cmd->speed, 8008 cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver, 8009 cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); 8010 - 8011 - switch (cmd->port) { 8012 - case PORT_TP: 8013 - if (!(bp->supported & SUPPORTED_TP)) { 8014 - DP(NETIF_MSG_LINK, "TP not supported\n"); 8015 - return -EINVAL; 8016 - } 8017 - 8018 - if (bp->phy_flags & PHY_XGXS_FLAG) { 8019 - bnx2x_link_reset(bp); 8020 - bnx2x_link_settings_supported(bp, SWITCH_CFG_1G); 8021 - bnx2x_phy_deassert(bp); 8022 - } 8023 - break; 8024 - 8025 - case PORT_FIBRE: 8026 - if (!(bp->supported & SUPPORTED_FIBRE)) { 8027 - DP(NETIF_MSG_LINK, "FIBRE not supported\n"); 8028 - return -EINVAL; 8029 - } 8030 - 8031 - if (!(bp->phy_flags & PHY_XGXS_FLAG)) { 8032 - bnx2x_link_reset(bp); 8033 - bnx2x_link_settings_supported(bp, SWITCH_CFG_10G); 8034 - bnx2x_phy_deassert(bp); 8035 - } 8036 - break; 8037 - 8038 - default: 8039 - DP(NETIF_MSG_LINK, "Unknown port type\n"); 8040 - return -EINVAL; 8041 - } 8042 8043 if (cmd->autoneg == AUTONEG_ENABLE) { 8044 if (!(bp->supported & SUPPORTED_Autoneg)) {
··· 63 #include "bnx2x.h" 64 #include "bnx2x_init.h" 65 66 + #define DRV_MODULE_VERSION "1.42.3" 67 + #define DRV_MODULE_RELDATE "2008/3/9" 68 #define BNX2X_BC_VER 0x040200 69 70 /* Time in jiffies before concluding the transmitter is hung. */ ··· 8007 cmd->cmd, cmd->supported, cmd->advertising, cmd->speed, 8008 cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver, 8009 cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); 8010 8011 if (cmd->autoneg == AUTONEG_ENABLE) { 8012 if (!(bp->supported & SUPPORTED_Autoneg)) {
+1 -1
drivers/net/sungem.c
··· 912 * rx ring - must call napi_disable(), which 913 * schedule_timeout()'s if polling is already disabled. 914 */ 915 - work_done += gem_rx(gp, budget); 916 917 if (work_done >= budget) 918 return work_done;
··· 912 * rx ring - must call napi_disable(), which 913 * schedule_timeout()'s if polling is already disabled. 914 */ 915 + work_done += gem_rx(gp, budget - work_done); 916 917 if (work_done >= budget) 918 return work_done;
+1 -1
include/net/sctp/sctp.h
··· 389 390 #else /* #ifdef defined(CONFIG_IPV6) */ 391 392 - static inline void sctp_v6_pf_init(void) { return 0; } 393 static inline void sctp_v6_pf_exit(void) { return; } 394 static inline int sctp_v6_protosw_init(void) { return 0; } 395 static inline void sctp_v6_protosw_exit(void) { return; }
··· 389 390 #else /* #ifdef defined(CONFIG_IPV6) */ 391 392 + static inline void sctp_v6_pf_init(void) { return; } 393 static inline void sctp_v6_pf_exit(void) { return; } 394 static inline int sctp_v6_protosw_init(void) { return 0; } 395 static inline void sctp_v6_protosw_exit(void) { return; }
-2
net/9p/trans_fd.c
··· 861 862 static void p9_mux_flush_cb(struct p9_req *freq, void *a) 863 { 864 - p9_conn_req_callback cb; 865 int tag; 866 struct p9_conn *m; 867 struct p9_req *req, *rreq, *rptr; ··· 871 freq->tcall->params.tflush.oldtag); 872 873 spin_lock(&m->lock); 874 - cb = NULL; 875 tag = freq->tcall->params.tflush.oldtag; 876 req = NULL; 877 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
··· 861 862 static void p9_mux_flush_cb(struct p9_req *freq, void *a) 863 { 864 int tag; 865 struct p9_conn *m; 866 struct p9_req *req, *rreq, *rptr; ··· 872 freq->tcall->params.tflush.oldtag); 873 874 spin_lock(&m->lock); 875 tag = freq->tcall->params.tflush.oldtag; 876 req = NULL; 877 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
+16 -3
net/atm/clip.c
··· 947 }; 948 #endif 949 950 static int __init atm_clip_init(void) 951 { 952 neigh_table_init_no_netlink(&clip_tbl); ··· 965 struct proc_dir_entry *p; 966 967 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); 968 } 969 #endif 970 971 return 0; 972 } 973 974 - static void __exit atm_clip_exit(void) 975 { 976 struct net_device *dev, *next; 977 - 978 - remove_proc_entry("arp", atm_proc_root); 979 980 unregister_inetaddr_notifier(&clip_inet_notifier); 981 unregister_netdevice_notifier(&clip_dev_notifier); ··· 1009 neigh_table_clear(&clip_tbl); 1010 1011 clip_tbl_hook = NULL; 1012 } 1013 1014 module_init(atm_clip_init);
··· 947 }; 948 #endif 949 950 + static void atm_clip_exit_noproc(void); 951 + 952 static int __init atm_clip_init(void) 953 { 954 neigh_table_init_no_netlink(&clip_tbl); ··· 963 struct proc_dir_entry *p; 964 965 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); 966 + if (!p) { 967 + printk(KERN_ERR "Unable to initialize " 968 + "/proc/net/atm/arp\n"); 969 + atm_clip_exit_noproc(); 970 + return -ENOMEM; 971 + } 972 } 973 #endif 974 975 return 0; 976 } 977 978 + static void atm_clip_exit_noproc(void) 979 { 980 struct net_device *dev, *next; 981 982 unregister_inetaddr_notifier(&clip_inet_notifier); 983 unregister_netdevice_notifier(&clip_dev_notifier); ··· 1003 neigh_table_clear(&clip_tbl); 1004 1005 clip_tbl_hook = NULL; 1006 + } 1007 + 1008 + static void __exit atm_clip_exit(void) 1009 + { 1010 + remove_proc_entry("arp", atm_proc_root); 1011 + 1012 + atm_clip_exit_noproc(); 1013 } 1014 1015 module_init(atm_clip_init);
+4
net/atm/lec.c
··· 1250 struct proc_dir_entry *p; 1251 1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops); 1253 #endif 1254 1255 register_atm_ioctl(&lane_ioctl_ops);
··· 1250 struct proc_dir_entry *p; 1251 1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops); 1253 + if (!p) { 1254 + printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n"); 1255 + return -ENOMEM; 1256 + } 1257 #endif 1258 1259 register_atm_ioctl(&lane_ioctl_ops);
+5 -2
net/ipv4/fib_trie.c
··· 177 return rcu_dereference(ret); 178 } 179 180 static inline void node_set_parent(struct node *node, struct tnode *ptr) 181 { 182 - rcu_assign_pointer(node->parent, 183 - (unsigned long)ptr | NODE_TYPE(node)); 184 } 185 186 static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
··· 177 return rcu_dereference(ret); 178 } 179 180 + /* Same as rcu_assign_pointer 181 + * but that macro() assumes that value is a pointer. 182 + */ 183 static inline void node_set_parent(struct node *node, struct tnode *ptr) 184 { 185 + smp_wmb(); 186 + node->parent = (unsigned long)ptr | NODE_TYPE(node); 187 } 188 189 static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
+1 -1
net/ipv4/ip_fragment.c
··· 568 569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS); 570 571 - net = skb->dev->nd_net; 572 /* Start by cleaning up the memory. */ 573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) 574 ip_evictor(net);
··· 568 569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS); 570 571 + net = skb->dev ? skb->dev->nd_net : skb->dst->dev->nd_net; 572 /* Start by cleaning up the memory. */ 573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) 574 ip_evictor(net);
+2 -2
net/ipv4/tcp.c
··· 735 if (!(psize -= copy)) 736 goto out; 737 738 - if (skb->len < mss_now || (flags & MSG_OOB)) 739 continue; 740 741 if (forced_push(tp)) { ··· 981 if ((seglen -= copy) == 0 && iovlen == 0) 982 goto out; 983 984 - if (skb->len < mss_now || (flags & MSG_OOB)) 985 continue; 986 987 if (forced_push(tp)) {
··· 735 if (!(psize -= copy)) 736 goto out; 737 738 + if (skb->len < size_goal || (flags & MSG_OOB)) 739 continue; 740 741 if (forced_push(tp)) { ··· 981 if ((seglen -= copy) == 0 && iovlen == 0) 982 goto out; 983 984 + if (skb->len < size_goal || (flags & MSG_OOB)) 985 continue; 986 987 if (forced_push(tp)) {
-2
net/ipv6/ndisc.c
··· 1420 u8 *opt; 1421 int rd_len; 1422 int err; 1423 - int hlen; 1424 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; 1425 1426 dev = skb->dev; ··· 1490 return; 1491 } 1492 1493 - hlen = 0; 1494 1495 skb_reserve(buff, LL_RESERVED_SPACE(dev)); 1496 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr,
··· 1420 u8 *opt; 1421 int rd_len; 1422 int err; 1423 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; 1424 1425 dev = skb->dev; ··· 1491 return; 1492 } 1493 1494 1495 skb_reserve(buff, LL_RESERVED_SPACE(dev)); 1496 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr,
+7 -6
net/sched/sch_htb.c
··· 711 */ 712 static psched_time_t htb_do_events(struct htb_sched *q, int level) 713 { 714 - int i; 715 - 716 - for (i = 0; i < 500; i++) { 717 struct htb_class *cl; 718 long diff; 719 struct rb_node *p = rb_first(&q->wait_pq[level]); ··· 733 if (cl->cmode != HTB_CAN_SEND) 734 htb_add_to_wait_tree(q, cl, diff); 735 } 736 - if (net_ratelimit()) 737 - printk(KERN_WARNING "htb: too many events !\n"); 738 - return q->now + PSCHED_TICKS_PER_SEC / 10; 739 } 740 741 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
··· 711 */ 712 static psched_time_t htb_do_events(struct htb_sched *q, int level) 713 { 714 + /* don't run for longer than 2 jiffies; 2 is used instead of 715 + 1 to simplify things when jiffy is going to be incremented 716 + too soon */ 717 + unsigned long stop_at = jiffies + 2; 718 + while (time_before(jiffies, stop_at)) { 719 struct htb_class *cl; 720 long diff; 721 struct rb_node *p = rb_first(&q->wait_pq[level]); ··· 731 if (cl->cmode != HTB_CAN_SEND) 732 htb_add_to_wait_tree(q, cl, diff); 733 } 734 + /* too much load - let's continue on next jiffie */ 735 + return q->now + PSCHED_TICKS_PER_SEC / HZ; 736 } 737 738 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
+3 -4
net/socket.c
··· 909 if (!dlci_ioctl_hook) 910 request_module("dlci"); 911 912 - if (dlci_ioctl_hook) { 913 - mutex_lock(&dlci_ioctl_mutex); 914 err = dlci_ioctl_hook(cmd, argp); 915 - mutex_unlock(&dlci_ioctl_mutex); 916 - } 917 break; 918 default: 919 err = sock->ops->ioctl(sock, cmd, arg);
··· 909 if (!dlci_ioctl_hook) 910 request_module("dlci"); 911 912 + mutex_lock(&dlci_ioctl_mutex); 913 + if (dlci_ioctl_hook) 914 err = dlci_ioctl_hook(cmd, argp); 915 + mutex_unlock(&dlci_ioctl_mutex); 916 break; 917 default: 918 err = sock->ops->ioctl(sock, cmd, arg);