Commit 0cc4d622 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[TCP]: tcp_send_skb code pruning

The function tcp_send_skb is only called from tcp_fin, and is always called
with force_queue=1.  Therefore, it no longer needs to be global and the code
to send right now can be removed.  Because it always queues, change the
name as well, and fix up the comment.
parent 9b4ea1a1
......@@ -929,7 +929,6 @@ extern void tcp_send_fin(struct sock *sk);
extern void tcp_send_active_reset(struct sock *sk, int priority);
extern int tcp_send_synack(struct sock *);
extern int tcp_transmit_skb(struct sock *, struct sk_buff *);
extern void tcp_send_skb(struct sock *, struct sk_buff *, int force_queue, unsigned mss_now);
extern void tcp_push_one(struct sock *, unsigned mss_now);
extern void tcp_send_ack(struct sock *sk);
extern void tcp_send_delayed_ack(struct sock *sk);
......
......@@ -314,13 +314,12 @@ int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
}
/* This is the main buffer sending routine. We queue the buffer
* and decide whether to queue or transmit now.
/* This routine just queue's the buffer
*
* NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames,
* otherwise socket can stall.
*/
void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigned cur_mss)
static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -329,17 +328,6 @@ void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigne
__skb_queue_tail(&sk->sk_write_queue, skb);
tcp_charge_skb(sk, skb);
if (!force_queue && tp->send_head == NULL && tcp_snd_test(tp, skb, cur_mss, tp->nonagle)) {
/* Send it out now. */
TCP_SKB_CB(skb)->when = tcp_time_stamp;
if (!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation))) {
tp->snd_nxt = TCP_SKB_CB(skb)->end_seq;
tcp_minshall_update(tp, cur_mss, skb);
if (tp->packets_out++ == 0)
tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
return;
}
}
/* Queue it, remembering where we must start sending. */
if (tp->send_head == NULL)
tp->send_head = skb;
......@@ -1120,10 +1108,10 @@ void tcp_send_fin(struct sock *sk)
TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_FIN);
TCP_SKB_CB(skb)->sacked = 0;
/* FIN eats a sequence byte, write_seq advanced by tcp_send_skb(). */
/* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */
TCP_SKB_CB(skb)->seq = tp->write_seq;
TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + 1;
tcp_send_skb(sk, skb, 1, mss_now);
tcp_queue_skb(sk, skb);
}
__tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_OFF);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment