diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-05 12:26:13 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-05 12:26:13 -0500 |
| commit | 2a1292b36ba106b9b7f030d3fa130f5f634fd8f0 (patch) | |
| tree | 12547c03b949e9cfa64c9760be9a73f18bb7a81a | |
| parent | 2cfae2739bda8fc5d934977c0ab19f6df1dd6d6c (diff) | |
| parent | 621544eb8c3beaa859c75850f816dd9b056a00a3 (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:
[LRO]: fix lro_gen_skb() alignment
[TCP]: NAGLE_PUSH seems to be a wrong way around
[TCP]: Move prior_in_flight collect to more robust place
[TCP] FRTO: Use of existing funcs make code more obvious & robust
[IRDA]: Move ircomm_tty_line_info() under #ifdef CONFIG_PROC_FS
[ROSE]: Trivial compilation CONFIG_INET=n case
[IPVS]: Fix sched registration race when checking for name collision.
[IPVS]: Don't leak sysctl tables if the scheduler registration fails.
| -rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 1 | ||||
| -rw-r--r-- | include/linux/inet_lro.h | 3 | ||||
| -rw-r--r-- | net/ipv4/inet_lro.c | 3 | ||||
| -rw-r--r-- | net/ipv4/ipvs/ip_vs_lblc.c | 7 | ||||
| -rw-r--r-- | net/ipv4/ipvs/ip_vs_lblcr.c | 7 | ||||
| -rw-r--r-- | net/ipv4/ipvs/ip_vs_sched.c | 27 | ||||
| -rw-r--r-- | net/ipv4/tcp_input.c | 17 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 3 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 2 | ||||
| -rw-r--r-- | net/rose/rose_dev.c | 2 |
10 files changed, 41 insertions, 31 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 0f306ddb56..8def865725 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
| @@ -1979,6 +1979,7 @@ static int myri10ge_open(struct net_device *dev) | |||
| 1979 | lro_mgr->lro_arr = mgp->rx_done.lro_desc; | 1979 | lro_mgr->lro_arr = mgp->rx_done.lro_desc; |
| 1980 | lro_mgr->get_frag_header = myri10ge_get_frag_header; | 1980 | lro_mgr->get_frag_header = myri10ge_get_frag_header; |
| 1981 | lro_mgr->max_aggr = myri10ge_lro_max_pkts; | 1981 | lro_mgr->max_aggr = myri10ge_lro_max_pkts; |
| 1982 | lro_mgr->frag_align_pad = 2; | ||
| 1982 | if (lro_mgr->max_aggr > MAX_SKB_FRAGS) | 1983 | if (lro_mgr->max_aggr > MAX_SKB_FRAGS) |
| 1983 | lro_mgr->max_aggr = MAX_SKB_FRAGS; | 1984 | lro_mgr->max_aggr = MAX_SKB_FRAGS; |
| 1984 | 1985 | ||
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h index 1246d46abb..80335b7d77 100644 --- a/include/linux/inet_lro.h +++ b/include/linux/inet_lro.h | |||
| @@ -91,6 +91,9 @@ struct net_lro_mgr { | |||
| 91 | int max_desc; /* Max number of LRO descriptors */ | 91 | int max_desc; /* Max number of LRO descriptors */ |
| 92 | int max_aggr; /* Max number of LRO packets to be aggregated */ | 92 | int max_aggr; /* Max number of LRO packets to be aggregated */ |
| 93 | 93 | ||
| 94 | int frag_align_pad; /* Padding required to properly align layer 3 | ||
| 95 | * headers in generated skb when using frags */ | ||
| 96 | |||
| 94 | struct net_lro_desc *lro_arr; /* Array of LRO descriptors */ | 97 | struct net_lro_desc *lro_arr; /* Array of LRO descriptors */ |
| 95 | 98 | ||
| 96 | /* | 99 | /* |
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index ac3b1d3dba..9a96c27739 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c | |||
| @@ -401,10 +401,11 @@ static struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr, | |||
| 401 | int data_len = len; | 401 | int data_len = len; |
| 402 | int hdr_len = min(len, hlen); | 402 | int hdr_len = min(len, hlen); |
| 403 | 403 | ||
| 404 | skb = netdev_alloc_skb(lro_mgr->dev, hlen); | 404 | skb = netdev_alloc_skb(lro_mgr->dev, hlen + lro_mgr->frag_align_pad); |
| 405 | if (!skb) | 405 | if (!skb) |
| 406 | return NULL; | 406 | return NULL; |
| 407 | 407 | ||
| 408 | skb_reserve(skb, lro_mgr->frag_align_pad); | ||
| 408 | skb->len = len; | 409 | skb->len = len; |
| 409 | skb->data_len = len - hdr_len; | 410 | skb->data_len = len - hdr_len; |
| 410 | skb->truesize += true_size; | 411 | skb->truesize += true_size; |
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c index b843a11d7c..ad89644ef5 100644 --- a/net/ipv4/ipvs/ip_vs_lblc.c +++ b/net/ipv4/ipvs/ip_vs_lblc.c | |||
| @@ -580,9 +580,14 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler = | |||
| 580 | 580 | ||
| 581 | static int __init ip_vs_lblc_init(void) | 581 | static int __init ip_vs_lblc_init(void) |
| 582 | { | 582 | { |
| 583 | int ret; | ||
| 584 | |||
| 583 | INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list); | 585 | INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list); |
| 584 | sysctl_header = register_sysctl_table(lblc_root_table); | 586 | sysctl_header = register_sysctl_table(lblc_root_table); |
| 585 | return register_ip_vs_scheduler(&ip_vs_lblc_scheduler); | 587 | ret = register_ip_vs_scheduler(&ip_vs_lblc_scheduler); |
| 588 | if (ret) | ||
| 589 | unregister_sysctl_table(sysctl_header); | ||
| 590 | return ret; | ||
| 586 | } | 591 | } |
| 587 | 592 | ||
| 588 | 593 | ||
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c index e5b323a6b2..2a5ed85a33 100644 --- a/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/net/ipv4/ipvs/ip_vs_lblcr.c | |||
| @@ -769,9 +769,14 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler = | |||
| 769 | 769 | ||
| 770 | static int __init ip_vs_lblcr_init(void) | 770 | static int __init ip_vs_lblcr_init(void) |
| 771 | { | 771 | { |
| 772 | int ret; | ||
| 773 | |||
| 772 | INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); | 774 | INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); |
| 773 | sysctl_header = register_sysctl_table(lblcr_root_table); | 775 | sysctl_header = register_sysctl_table(lblcr_root_table); |
| 774 | return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); | 776 | ret = register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); |
| 777 | if (ret) | ||
| 778 | unregister_sysctl_table(sysctl_header); | ||
| 779 | return ret; | ||
| 775 | } | 780 | } |
| 776 | 781 | ||
| 777 | 782 | ||
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c index 1602304abb..4322358619 100644 --- a/net/ipv4/ipvs/ip_vs_sched.c +++ b/net/ipv4/ipvs/ip_vs_sched.c | |||
| @@ -183,19 +183,6 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
| 183 | /* increase the module use count */ | 183 | /* increase the module use count */ |
| 184 | ip_vs_use_count_inc(); | 184 | ip_vs_use_count_inc(); |
| 185 | 185 | ||
| 186 | /* | ||
| 187 | * Make sure that the scheduler with this name doesn't exist | ||
| 188 | * in the scheduler list. | ||
| 189 | */ | ||
| 190 | sched = ip_vs_sched_getbyname(scheduler->name); | ||
| 191 | if (sched) { | ||
| 192 | ip_vs_scheduler_put(sched); | ||
| 193 | ip_vs_use_count_dec(); | ||
| 194 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " | ||
| 195 | "already existed in the system\n", scheduler->name); | ||
| 196 | return -EINVAL; | ||
| 197 | } | ||
| 198 | |||
| 199 | write_lock_bh(&__ip_vs_sched_lock); | 186 | write_lock_bh(&__ip_vs_sched_lock); |
| 200 | 187 | ||
| 201 | if (scheduler->n_list.next != &scheduler->n_list) { | 188 | if (scheduler->n_list.next != &scheduler->n_list) { |
| @@ -207,6 +194,20 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
| 207 | } | 194 | } |
| 208 | 195 | ||
| 209 | /* | 196 | /* |
| 197 | * Make sure that the scheduler with this name doesn't exist | ||
| 198 | * in the scheduler list. | ||
| 199 | */ | ||
| 200 | list_for_each_entry(sched, &ip_vs_schedulers, n_list) { | ||
| 201 | if (strcmp(scheduler->name, sched->name) == 0) { | ||
| 202 | write_unlock_bh(&__ip_vs_sched_lock); | ||
| 203 | ip_vs_use_count_dec(); | ||
| 204 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " | ||
| 205 | "already existed in the system\n", | ||
| 206 | scheduler->name); | ||
| 207 | return -EINVAL; | ||
| 208 | } | ||
| 209 | } | ||
| 210 | /* | ||
| 210 | * Add it into the d-linked scheduler list | 211 | * Add it into the d-linked scheduler list |
| 211 | */ | 212 | */ |
| 212 | list_add(&scheduler->n_list, &ip_vs_schedulers); | 213 | list_add(&scheduler->n_list, &ip_vs_schedulers); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 0f0c1c9829..b9e429d2d1 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -3003,17 +3003,13 @@ static int tcp_process_frto(struct sock *sk, int flag) | |||
| 3003 | } | 3003 | } |
| 3004 | 3004 | ||
| 3005 | if (tp->frto_counter == 1) { | 3005 | if (tp->frto_counter == 1) { |
| 3006 | /* Sending of the next skb must be allowed or no F-RTO */ | 3006 | /* tcp_may_send_now needs to see updated state */ |
| 3007 | if (!tcp_send_head(sk) || | ||
| 3008 | after(TCP_SKB_CB(tcp_send_head(sk))->end_seq, | ||
| 3009 | tp->snd_una + tp->snd_wnd)) { | ||
| 3010 | tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), | ||
| 3011 | flag); | ||
| 3012 | return 1; | ||
| 3013 | } | ||
| 3014 | |||
| 3015 | tp->snd_cwnd = tcp_packets_in_flight(tp) + 2; | 3007 | tp->snd_cwnd = tcp_packets_in_flight(tp) + 2; |
| 3016 | tp->frto_counter = 2; | 3008 | tp->frto_counter = 2; |
| 3009 | |||
| 3010 | if (!tcp_may_send_now(sk)) | ||
| 3011 | tcp_enter_frto_loss(sk, 2, flag); | ||
| 3012 | |||
| 3017 | return 1; | 3013 | return 1; |
| 3018 | } else { | 3014 | } else { |
| 3019 | switch (sysctl_tcp_frto_response) { | 3015 | switch (sysctl_tcp_frto_response) { |
| @@ -3069,6 +3065,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 3069 | } | 3065 | } |
| 3070 | 3066 | ||
| 3071 | prior_fackets = tp->fackets_out; | 3067 | prior_fackets = tp->fackets_out; |
| 3068 | prior_in_flight = tcp_packets_in_flight(tp); | ||
| 3072 | 3069 | ||
| 3073 | if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) { | 3070 | if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) { |
| 3074 | /* Window is constant, pure forward advance. | 3071 | /* Window is constant, pure forward advance. |
| @@ -3108,8 +3105,6 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 3108 | if (!prior_packets) | 3105 | if (!prior_packets) |
| 3109 | goto no_queue; | 3106 | goto no_queue; |
| 3110 | 3107 | ||
| 3111 | prior_in_flight = tcp_packets_in_flight(tp); | ||
| 3112 | |||
| 3113 | /* See if we can take anything off of the retransmit queue. */ | 3108 | /* See if we can take anything off of the retransmit queue. */ |
| 3114 | flag |= tcp_clean_rtx_queue(sk, &seq_rtt, prior_fackets); | 3109 | flag |= tcp_clean_rtx_queue(sk, &seq_rtt, prior_fackets); |
| 3115 | 3110 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e5130a7fe1..f4c1eef89a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -1162,8 +1162,7 @@ int tcp_may_send_now(struct sock *sk) | |||
| 1162 | return (skb && | 1162 | return (skb && |
| 1163 | tcp_snd_test(sk, skb, tcp_current_mss(sk, 1), | 1163 | tcp_snd_test(sk, skb, tcp_current_mss(sk, 1), |
| 1164 | (tcp_skb_is_last(sk, skb) ? | 1164 | (tcp_skb_is_last(sk, skb) ? |
| 1165 | TCP_NAGLE_PUSH : | 1165 | tp->nonagle : TCP_NAGLE_PUSH))); |
| 1166 | tp->nonagle))); | ||
| 1167 | } | 1166 | } |
| 1168 | 1167 | ||
| 1169 | /* Trim TSO SKB to LEN bytes, put the remaining data into a new packet | 1168 | /* Trim TSO SKB to LEN bytes, put the remaining data into a new packet |
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 1120b150e2..be627e1f04 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
| @@ -1245,6 +1245,7 @@ static void ircomm_tty_flow_indication(void *instance, void *sap, | |||
| 1245 | self->flow = cmd; | 1245 | self->flow = cmd; |
| 1246 | } | 1246 | } |
| 1247 | 1247 | ||
| 1248 | #ifdef CONFIG_PROC_FS | ||
| 1248 | static int ircomm_tty_line_info(struct ircomm_tty_cb *self, char *buf) | 1249 | static int ircomm_tty_line_info(struct ircomm_tty_cb *self, char *buf) |
| 1249 | { | 1250 | { |
| 1250 | int ret=0; | 1251 | int ret=0; |
| @@ -1354,7 +1355,6 @@ static int ircomm_tty_line_info(struct ircomm_tty_cb *self, char *buf) | |||
| 1354 | * | 1355 | * |
| 1355 | * | 1356 | * |
| 1356 | */ | 1357 | */ |
| 1357 | #ifdef CONFIG_PROC_FS | ||
| 1358 | static int ircomm_tty_read_proc(char *buf, char **start, off_t offset, int len, | 1358 | static int ircomm_tty_read_proc(char *buf, char **start, off_t offset, int len, |
| 1359 | int *eof, void *unused) | 1359 | int *eof, void *unused) |
| 1360 | { | 1360 | { |
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 1b6741f1d7..12cfcf0955 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
| @@ -55,13 +55,13 @@ static int rose_header(struct sk_buff *skb, struct net_device *dev, | |||
| 55 | 55 | ||
| 56 | static int rose_rebuild_header(struct sk_buff *skb) | 56 | static int rose_rebuild_header(struct sk_buff *skb) |
| 57 | { | 57 | { |
| 58 | #ifdef CONFIG_INET | ||
| 58 | struct net_device *dev = skb->dev; | 59 | struct net_device *dev = skb->dev; |
| 59 | struct net_device_stats *stats = netdev_priv(dev); | 60 | struct net_device_stats *stats = netdev_priv(dev); |
| 60 | unsigned char *bp = (unsigned char *)skb->data; | 61 | unsigned char *bp = (unsigned char *)skb->data; |
| 61 | struct sk_buff *skbn; | 62 | struct sk_buff *skbn; |
| 62 | unsigned int len; | 63 | unsigned int len; |
| 63 | 64 | ||
| 64 | #ifdef CONFIG_INET | ||
| 65 | if (arp_find(bp + 7, skb)) { | 65 | if (arp_find(bp + 7, skb)) { |
| 66 | return 1; | 66 | return 1; |
| 67 | } | 67 | } |
