Skip to content

Commit ac3f09b

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: uninline tcp_write_queue_purge()
Since the upcoming rtx rbtree will add some extra code, it is time to not inline this fat function anymore. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 18a4c0e commit ac3f09b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

include/net/tcp.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,20 +1606,7 @@ static inline void tcp_skb_tsorted_anchor_cleanup(struct sk_buff *skb)
16061606
skb->_skb_refdst = _save; \
16071607
}
16081608

1609-
/* write queue abstraction */
1610-
static inline void tcp_write_queue_purge(struct sock *sk)
1611-
{
1612-
struct sk_buff *skb;
1613-
1614-
tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
1615-
while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
1616-
tcp_skb_tsorted_anchor_cleanup(skb);
1617-
sk_wmem_free_skb(sk, skb);
1618-
}
1619-
INIT_LIST_HEAD(&tcp_sk(sk)->tsorted_sent_queue);
1620-
sk_mem_reclaim(sk);
1621-
tcp_clear_all_retrans_hints(tcp_sk(sk));
1622-
}
1609+
void tcp_write_queue_purge(struct sock *sk);
16231610

16241611
static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk)
16251612
{

net/ipv4/tcp.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,20 @@ static inline bool tcp_need_reset(int state)
23182318
TCPF_FIN_WAIT2 | TCPF_SYN_RECV);
23192319
}
23202320

2321+
void tcp_write_queue_purge(struct sock *sk)
2322+
{
2323+
struct sk_buff *skb;
2324+
2325+
tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
2326+
while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
2327+
tcp_skb_tsorted_anchor_cleanup(skb);
2328+
sk_wmem_free_skb(sk, skb);
2329+
}
2330+
INIT_LIST_HEAD(&tcp_sk(sk)->tsorted_sent_queue);
2331+
sk_mem_reclaim(sk);
2332+
tcp_clear_all_retrans_hints(tcp_sk(sk));
2333+
}
2334+
23212335
int tcp_disconnect(struct sock *sk, int flags)
23222336
{
23232337
struct inet_sock *inet = inet_sk(sk);

0 commit comments

Comments
 (0)