Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122543
b: refs/heads/master
c: d5dd917
h: refs/heads/master
i:
  122541: c8babeb
  122539: 22698ac
  122535: 936ef29
  122527: b2fdc70
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Dec 6, 2008
1 parent 2b27ae5 commit 617b828
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 730c30ec646bd252a9448a66ecd51d794853513f
refs/heads/master: d5dd9175bc12015ea4d2c1a9b6b15dfa645a3db9
54 changes: 17 additions & 37 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,8 @@ static int tcp_mtu_probe(struct sock *sk)
* Returns 1, if no segments are in flight and we have queued segments, but
* cannot send anything now because of SWS or another problem.
*/
static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
int push_one, gfp_t gfp)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
Expand All @@ -1529,11 +1530,14 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)

sent_pkts = 0;

/* Do MTU probing. */
if ((result = tcp_mtu_probe(sk)) == 0) {
return 0;
} else if (result > 0) {
sent_pkts = 1;
if (!push_one) {
/* Do MTU probing. */
result = tcp_mtu_probe(sk);
if (!result) {
return 0;
} else if (result > 0) {
sent_pkts = 1;
}
}

while ((skb = tcp_send_head(sk))) {
Expand All @@ -1555,7 +1559,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
nonagle : TCP_NAGLE_PUSH))))
break;
} else {
if (tcp_tso_should_defer(sk, skb))
if (!push_one && tcp_tso_should_defer(sk, skb))
break;
}

Expand All @@ -1570,7 +1574,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)

TCP_SKB_CB(skb)->when = tcp_time_stamp;

if (unlikely(tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC)))
if (unlikely(tcp_transmit_skb(sk, skb, 1, gfp)))
break;

/* Advance the send_head. This one is sent out.
Expand All @@ -1580,6 +1584,9 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)

tcp_minshall_update(tp, mss_now, skb);
sent_pkts++;

if (push_one)
break;
}

if (likely(sent_pkts)) {
Expand Down Expand Up @@ -1608,7 +1615,7 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
if (unlikely(sk->sk_state == TCP_CLOSE))
return;

if (tcp_write_xmit(sk, cur_mss, nonagle))
if (tcp_write_xmit(sk, cur_mss, nonagle, 0, GFP_ATOMIC))
tcp_check_probe_timer(sk);
}

Expand All @@ -1617,38 +1624,11 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
*/
void tcp_push_one(struct sock *sk, unsigned int mss_now)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb = tcp_send_head(sk);
unsigned int tso_segs, cwnd_quota;

BUG_ON(!skb || skb->len < mss_now);

tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
cwnd_quota = tcp_snd_test(sk, skb, mss_now, TCP_NAGLE_PUSH);

if (likely(cwnd_quota)) {
unsigned int limit;

BUG_ON(!tso_segs);

limit = mss_now;
if (tso_segs > 1 && !tcp_urg_mode(tp))
limit = tcp_mss_split_point(sk, skb, mss_now,
cwnd_quota);

if (skb->len > limit &&
unlikely(tso_fragment(sk, skb, limit, mss_now)))
return;

/* Send it out now. */
TCP_SKB_CB(skb)->when = tcp_time_stamp;

if (likely(!tcp_transmit_skb(sk, skb, 1, sk->sk_allocation))) {
tcp_event_new_data_sent(sk, skb);
tcp_cwnd_validate(sk);
return;
}
}
tcp_write_xmit(sk, mss_now, TCP_NAGLE_PUSH, 1, sk->sk_allocation);
}

/* This function returns the amount that we can raise the
Expand Down

0 comments on commit 617b828

Please sign in to comment.