aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-09-19 14:05:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-19 14:05:50 -0400
commit7d7dee96e1a7369eae67e5fe5c987785a1c11e40 (patch)
tree7c87df02117c7c3ac2ab4b7bd594a2183ec22ff6 /include
parentf1c9c9797a7c519a70b8e4607f41d97ec59fc8f0 (diff)
parent4e8cec269dd9e823804141f25ce37c23e72d3c12 (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: (21 commits) dca: disable dca on IOAT ver.3.0 multiple-IOH platforms netpoll: Disable IRQ around RCU dereference in netpoll_rx sctp: Do not reset the packet during sctp_packet_config(). net/llc: storing negative error codes in unsigned short MAINTAINERS: move atlx discussions to netdev drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory drivers/net/eql.c: prevent reading uninitialized stack memory drivers/net/usb/hso.c: prevent reading uninitialized memory xfrm: dont assume rcu_read_lock in xfrm_output_one() r8169: Handle rxfifo errors on 8168 chips 3c59x: Remove atomic context inside vortex_{set|get}_wol tcp: Prevent overzealous packetization by SWS logic. net: RPS needs to depend upon USE_GENERIC_SMP_HELPERS phylib: fix PAL state machine restart on resume net: use rcu_barrier() in rollback_registered_many bonding: correctly process non-linear skbs ipv4: enable getsockopt() for IP_NODEFRAG ipv4: force_igmp_version ignored when a IGMPv3 query received ppp: potential NULL dereference in ppp_mp_explode() net/llc: make opt unsigned in llc_ui_setsockopt() ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/netpoll.h8
-rw-r--r--include/net/tcp.h18
2 files changed, 20 insertions, 6 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 791d5109f34..50d8009be86 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -63,20 +63,20 @@ static inline bool netpoll_rx(struct sk_buff *skb)
63 unsigned long flags; 63 unsigned long flags;
64 bool ret = false; 64 bool ret = false;
65 65
66 rcu_read_lock_bh(); 66 local_irq_save(flags);
67 npinfo = rcu_dereference_bh(skb->dev->npinfo); 67 npinfo = rcu_dereference_bh(skb->dev->npinfo);
68 68
69 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) 69 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
70 goto out; 70 goto out;
71 71
72 spin_lock_irqsave(&npinfo->rx_lock, flags); 72 spin_lock(&npinfo->rx_lock);
73 /* check rx_flags again with the lock held */ 73 /* check rx_flags again with the lock held */
74 if (npinfo->rx_flags && __netpoll_rx(skb)) 74 if (npinfo->rx_flags && __netpoll_rx(skb))
75 ret = true; 75 ret = true;
76 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 76 spin_unlock(&npinfo->rx_lock);
77 77
78out: 78out:
79 rcu_read_unlock_bh(); 79 local_irq_restore(flags);
80 return ret; 80 return ret;
81} 81}
82 82
diff --git a/include/net/tcp.h b/include/net/tcp.h
index eaa9582779d..3e4b33e3660 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -475,8 +475,22 @@ extern unsigned int tcp_current_mss(struct sock *sk);
475/* Bound MSS / TSO packet size with the half of the window */ 475/* Bound MSS / TSO packet size with the half of the window */
476static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) 476static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
477{ 477{
478 if (tp->max_window && pktsize > (tp->max_window >> 1)) 478 int cutoff;
479 return max(tp->max_window >> 1, 68U - tp->tcp_header_len); 479
480 /* When peer uses tiny windows, there is no use in packetizing
481 * to sub-MSS pieces for the sake of SWS or making sure there
482 * are enough packets in the pipe for fast recovery.
483 *
484 * On the other hand, for extremely large MSS devices, handling
485 * smaller than MSS windows in this way does make sense.
486 */
487 if (tp->max_window >= 512)
488 cutoff = (tp->max_window >> 1);
489 else
490 cutoff = tp->max_window;
491
492 if (cutoff && pktsize > cutoff)
493 return max_t(int, cutoff, 68U - tp->tcp_header_len);
480 else 494 else
481 return pktsize; 495 return pktsize;
482} 496}