aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-24 16:07:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-24 16:07:24 -0400
commitca1a6ba57c5fca755b4ac7a13395bca2e2e371b1 (patch)
tree1dd8f5090238d644668818c54f9f91b1c5665991
parentd3073779f8362d64b804882f5f41c208c4a5e11e (diff)
parent8f3ea33a5078a09eba12bfe57424507809367756 (diff)
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
-rw-r--r--drivers/connector/cn_queue.c2
-rw-r--r--drivers/net/bnx2x.c36
-rw-r--r--drivers/net/sungem.c2
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--net/9p/trans_fd.c2
-rw-r--r--net/atm/clip.c19
-rw-r--r--net/atm/lec.c4
-rw-r--r--net/ipv4/fib_trie.c7
-rw-r--r--net/ipv4/ip_fragment.c2
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/sched/sch_htb.c13
-rw-r--r--net/socket.c7
13 files changed, 43 insertions, 59 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 5732ca3259f9..b6fe7e7a2c2f 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -146,7 +146,7 @@ struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *nls)
146 146
147 dev->nls = nls; 147 dev->nls = nls;
148 148
149 dev->cn_queue = create_workqueue(dev->name); 149 dev->cn_queue = create_singlethread_workqueue(dev->name);
150 if (!dev->cn_queue) { 150 if (!dev->cn_queue) {
151 kfree(dev); 151 kfree(dev);
152 return NULL; 152 return NULL;
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c
index 8af142ccf373..de32b3fba322 100644
--- a/drivers/net/bnx2x.c
+++ b/drivers/net/bnx2x.c
@@ -63,8 +63,8 @@
63#include "bnx2x.h" 63#include "bnx2x.h"
64#include "bnx2x_init.h" 64#include "bnx2x_init.h"
65 65
66#define DRV_MODULE_VERSION "1.40.22" 66#define DRV_MODULE_VERSION "1.42.3"
67#define DRV_MODULE_RELDATE "2007/11/27" 67#define DRV_MODULE_RELDATE "2008/3/9"
68#define BNX2X_BC_VER 0x040200 68#define BNX2X_BC_VER 0x040200
69 69
70/* Time in jiffies before concluding the transmitter is hung. */ 70/* 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)
8008 cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver, 8008 cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver,
8009 cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); 8009 cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt);
8010 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) { 8011 if (cmd->autoneg == AUTONEG_ENABLE) {
8044 if (!(bp->supported & SUPPORTED_Autoneg)) { 8012 if (!(bp->supported & SUPPORTED_Autoneg)) {
8045 DP(NETIF_MSG_LINK, "Aotoneg not supported\n"); 8013 DP(NETIF_MSG_LINK, "Aotoneg not supported\n");
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 97212799c513..4291458955ef 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -912,7 +912,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
912 * rx ring - must call napi_disable(), which 912 * rx ring - must call napi_disable(), which
913 * schedule_timeout()'s if polling is already disabled. 913 * schedule_timeout()'s if polling is already disabled.
914 */ 914 */
915 work_done += gem_rx(gp, budget); 915 work_done += gem_rx(gp, budget - work_done);
916 916
917 if (work_done >= budget) 917 if (work_done >= budget)
918 return work_done; 918 return work_done;
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 57ed3e323d97..ea806732b084 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -389,7 +389,7 @@ void sctp_v6_del_protocol(void);
389 389
390#else /* #ifdef defined(CONFIG_IPV6) */ 390#else /* #ifdef defined(CONFIG_IPV6) */
391 391
392static inline void sctp_v6_pf_init(void) { return 0; } 392static inline void sctp_v6_pf_init(void) { return; }
393static inline void sctp_v6_pf_exit(void) { return; } 393static inline void sctp_v6_pf_exit(void) { return; }
394static inline int sctp_v6_protosw_init(void) { return 0; } 394static inline int sctp_v6_protosw_init(void) { return 0; }
395static inline void sctp_v6_protosw_exit(void) { return; } 395static inline void sctp_v6_protosw_exit(void) { return; }
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 1aa9d5175398..4e8d4e724b96 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -861,7 +861,6 @@ static void p9_mux_free_request(struct p9_conn *m, struct p9_req *req)
861 861
862static void p9_mux_flush_cb(struct p9_req *freq, void *a) 862static void p9_mux_flush_cb(struct p9_req *freq, void *a)
863{ 863{
864 p9_conn_req_callback cb;
865 int tag; 864 int tag;
866 struct p9_conn *m; 865 struct p9_conn *m;
867 struct p9_req *req, *rreq, *rptr; 866 struct p9_req *req, *rreq, *rptr;
@@ -872,7 +871,6 @@ static void p9_mux_flush_cb(struct p9_req *freq, void *a)
872 freq->tcall->params.tflush.oldtag); 871 freq->tcall->params.tflush.oldtag);
873 872
874 spin_lock(&m->lock); 873 spin_lock(&m->lock);
875 cb = NULL;
876 tag = freq->tcall->params.tflush.oldtag; 874 tag = freq->tcall->params.tflush.oldtag;
877 req = NULL; 875 req = NULL;
878 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { 876 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
diff --git a/net/atm/clip.c b/net/atm/clip.c
index d30167c0b48e..2ab1e36098fd 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -947,6 +947,8 @@ static const struct file_operations arp_seq_fops = {
947}; 947};
948#endif 948#endif
949 949
950static void atm_clip_exit_noproc(void);
951
950static int __init atm_clip_init(void) 952static int __init atm_clip_init(void)
951{ 953{
952 neigh_table_init_no_netlink(&clip_tbl); 954 neigh_table_init_no_netlink(&clip_tbl);
@@ -963,18 +965,22 @@ static int __init atm_clip_init(void)
963 struct proc_dir_entry *p; 965 struct proc_dir_entry *p;
964 966
965 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); 967 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
968 if (!p) {
969 printk(KERN_ERR "Unable to initialize "
970 "/proc/net/atm/arp\n");
971 atm_clip_exit_noproc();
972 return -ENOMEM;
973 }
966 } 974 }
967#endif 975#endif
968 976
969 return 0; 977 return 0;
970} 978}
971 979
972static void __exit atm_clip_exit(void) 980static void atm_clip_exit_noproc(void)
973{ 981{
974 struct net_device *dev, *next; 982 struct net_device *dev, *next;
975 983
976 remove_proc_entry("arp", atm_proc_root);
977
978 unregister_inetaddr_notifier(&clip_inet_notifier); 984 unregister_inetaddr_notifier(&clip_inet_notifier);
979 unregister_netdevice_notifier(&clip_dev_notifier); 985 unregister_netdevice_notifier(&clip_dev_notifier);
980 986
@@ -1005,6 +1011,13 @@ static void __exit atm_clip_exit(void)
1005 clip_tbl_hook = NULL; 1011 clip_tbl_hook = NULL;
1006} 1012}
1007 1013
1014static void __exit atm_clip_exit(void)
1015{
1016 remove_proc_entry("arp", atm_proc_root);
1017
1018 atm_clip_exit_noproc();
1019}
1020
1008module_init(atm_clip_init); 1021module_init(atm_clip_init);
1009module_exit(atm_clip_exit); 1022module_exit(atm_clip_exit);
1010MODULE_AUTHOR("Werner Almesberger"); 1023MODULE_AUTHOR("Werner Almesberger");
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 0e450d12f035..a2efa7ff41f1 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1250,6 +1250,10 @@ static int __init lane_module_init(void)
1250 struct proc_dir_entry *p; 1250 struct proc_dir_entry *p;
1251 1251
1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops); 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 }
1253#endif 1257#endif
1254 1258
1255 register_atm_ioctl(&lane_ioctl_ops); 1259 register_atm_ioctl(&lane_ioctl_ops);
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1ff446d0fa8b..f6cdc012eec5 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
177 return rcu_dereference(ret); 177 return rcu_dereference(ret);
178} 178}
179 179
180/* Same as rcu_assign_pointer
181 * but that macro() assumes that value is a pointer.
182 */
180static inline void node_set_parent(struct node *node, struct tnode *ptr) 183static inline void node_set_parent(struct node *node, struct tnode *ptr)
181{ 184{
182 rcu_assign_pointer(node->parent, 185 smp_wmb();
183 (unsigned long)ptr | NODE_TYPE(node)); 186 node->parent = (unsigned long)ptr | NODE_TYPE(node);
184} 187}
185 188
186static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i) 189static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index a2e92f9709db..3b2e5adca838 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -568,7 +568,7 @@ int ip_defrag(struct sk_buff *skb, u32 user)
568 568
569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS); 569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
570 570
571 net = skb->dev->nd_net; 571 net = skb->dev ? skb->dev->nd_net : skb->dst->dev->nd_net;
572 /* Start by cleaning up the memory. */ 572 /* Start by cleaning up the memory. */
573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) 573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh)
574 ip_evictor(net); 574 ip_evictor(net);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 071e83a894ad..39b629ac2404 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -735,7 +735,7 @@ new_segment:
735 if (!(psize -= copy)) 735 if (!(psize -= copy))
736 goto out; 736 goto out;
737 737
738 if (skb->len < mss_now || (flags & MSG_OOB)) 738 if (skb->len < size_goal || (flags & MSG_OOB))
739 continue; 739 continue;
740 740
741 if (forced_push(tp)) { 741 if (forced_push(tp)) {
@@ -981,7 +981,7 @@ new_segment:
981 if ((seglen -= copy) == 0 && iovlen == 0) 981 if ((seglen -= copy) == 0 && iovlen == 0)
982 goto out; 982 goto out;
983 983
984 if (skb->len < mss_now || (flags & MSG_OOB)) 984 if (skb->len < size_goal || (flags & MSG_OOB))
985 continue; 985 continue;
986 986
987 if (forced_push(tp)) { 987 if (forced_push(tp)) {
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 0d33a7d32125..51557c27a0cd 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1420,7 +1420,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1420 u8 *opt; 1420 u8 *opt;
1421 int rd_len; 1421 int rd_len;
1422 int err; 1422 int err;
1423 int hlen;
1424 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; 1423 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL;
1425 1424
1426 dev = skb->dev; 1425 dev = skb->dev;
@@ -1491,7 +1490,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1491 return; 1490 return;
1492 } 1491 }
1493 1492
1494 hlen = 0;
1495 1493
1496 skb_reserve(buff, LL_RESERVED_SPACE(dev)); 1494 skb_reserve(buff, LL_RESERVED_SPACE(dev));
1497 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr, 1495 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr,
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 795c761ad99f..66148cc4759e 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -711,9 +711,11 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
711 */ 711 */
712static psched_time_t htb_do_events(struct htb_sched *q, int level) 712static psched_time_t htb_do_events(struct htb_sched *q, int level)
713{ 713{
714 int i; 714 /* don't run for longer than 2 jiffies; 2 is used instead of
715 715 1 to simplify things when jiffy is going to be incremented
716 for (i = 0; i < 500; i++) { 716 too soon */
717 unsigned long stop_at = jiffies + 2;
718 while (time_before(jiffies, stop_at)) {
717 struct htb_class *cl; 719 struct htb_class *cl;
718 long diff; 720 long diff;
719 struct rb_node *p = rb_first(&q->wait_pq[level]); 721 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)
731 if (cl->cmode != HTB_CAN_SEND) 733 if (cl->cmode != HTB_CAN_SEND)
732 htb_add_to_wait_tree(q, cl, diff); 734 htb_add_to_wait_tree(q, cl, diff);
733 } 735 }
734 if (net_ratelimit()) 736 /* too much load - let's continue on next jiffie */
735 printk(KERN_WARNING "htb: too many events !\n"); 737 return q->now + PSCHED_TICKS_PER_SEC / HZ;
736 return q->now + PSCHED_TICKS_PER_SEC / 10;
737} 738}
738 739
739/* Returns class->node+prio from id-tree where classe's id is >= id. NULL 740/* Returns class->node+prio from id-tree where classe's id is >= id. NULL
diff --git a/net/socket.c b/net/socket.c
index b6d35cd72a50..9d3fbfbc8535 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -909,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
909 if (!dlci_ioctl_hook) 909 if (!dlci_ioctl_hook)
910 request_module("dlci"); 910 request_module("dlci");
911 911
912 if (dlci_ioctl_hook) { 912 mutex_lock(&dlci_ioctl_mutex);
913 mutex_lock(&dlci_ioctl_mutex); 913 if (dlci_ioctl_hook)
914 err = dlci_ioctl_hook(cmd, argp); 914 err = dlci_ioctl_hook(cmd, argp);
915 mutex_unlock(&dlci_ioctl_mutex); 915 mutex_unlock(&dlci_ioctl_mutex);
916 }
917 break; 916 break;
918 default: 917 default:
919 err = sock->ops->ioctl(sock, cmd, arg); 918 err = sock->ops->ioctl(sock, cmd, arg);