diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2011-07-03 11:51:29 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2011-07-04 14:36:47 -0400 |
commit | 8695e80193fed35f27c06f462bd5b76132fd5697 (patch) | |
tree | 07098d9f6996c188fb9e05e93a76627e06666796 /net/dccp/output.c | |
parent | c0c2015056d7bd69f3554208271407e7e2ee69e5 (diff) |
dccp: combine the functionality of enqeueing and cloning
Realising the following call pattern,
* first dccp_entail() is called to enqueue a new skb and
* then skb_clone() is called to transmit a clone of that skb,
this patch integrates both into the same function.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index fab108e51e5a..dede3edb8849 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -27,11 +27,13 @@ static inline void dccp_event_ack_sent(struct sock *sk) | |||
27 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); | 27 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); |
28 | } | 28 | } |
29 | 29 | ||
30 | static void dccp_skb_entail(struct sock *sk, struct sk_buff *skb) | 30 | /* enqueue @skb on sk_send_head for retransmission, return clone to send now */ |
31 | static struct sk_buff *dccp_skb_entail(struct sock *sk, struct sk_buff *skb) | ||
31 | { | 32 | { |
32 | skb_set_owner_w(skb, sk); | 33 | skb_set_owner_w(skb, sk); |
33 | WARN_ON(sk->sk_send_head); | 34 | WARN_ON(sk->sk_send_head); |
34 | sk->sk_send_head = skb; | 35 | sk->sk_send_head = skb; |
36 | return skb_clone(sk->sk_send_head, gfp_any()); | ||
35 | } | 37 | } |
36 | 38 | ||
37 | /* | 39 | /* |
@@ -552,8 +554,7 @@ int dccp_connect(struct sock *sk) | |||
552 | 554 | ||
553 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_REQUEST; | 555 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_REQUEST; |
554 | 556 | ||
555 | dccp_skb_entail(sk, skb); | 557 | dccp_transmit_skb(sk, dccp_skb_entail(sk, skb)); |
556 | dccp_transmit_skb(sk, skb_clone(skb, GFP_KERNEL)); | ||
557 | DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); | 558 | DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); |
558 | 559 | ||
559 | /* Timer for repeating the REQUEST until an answer. */ | 560 | /* Timer for repeating the REQUEST until an answer. */ |
@@ -678,8 +679,7 @@ void dccp_send_close(struct sock *sk, const int active) | |||
678 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_CLOSE; | 679 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_CLOSE; |
679 | 680 | ||
680 | if (active) { | 681 | if (active) { |
681 | dccp_skb_entail(sk, skb); | 682 | skb = dccp_skb_entail(sk, skb); |
682 | dccp_transmit_skb(sk, skb_clone(skb, prio)); | ||
683 | /* | 683 | /* |
684 | * Retransmission timer for active-close: RFC 4340, 8.3 requires | 684 | * Retransmission timer for active-close: RFC 4340, 8.3 requires |
685 | * to retransmit the Close/CloseReq until the CLOSING/CLOSEREQ | 685 | * to retransmit the Close/CloseReq until the CLOSING/CLOSEREQ |
@@ -692,6 +692,6 @@ void dccp_send_close(struct sock *sk, const int active) | |||
692 | */ | 692 | */ |
693 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, | 693 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, |
694 | DCCP_TIMEOUT_INIT, DCCP_RTO_MAX); | 694 | DCCP_TIMEOUT_INIT, DCCP_RTO_MAX); |
695 | } else | 695 | } |
696 | dccp_transmit_skb(sk, skb); | 696 | dccp_transmit_skb(sk, skb); |
697 | } | 697 | } |