mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
tcp: add drop reason support to tcp_prune_ofo_queue()
Add one reason for packets dropped from OFO queue because of memory pressure. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4b506af9c5
commit
e7c89ae407
@ -392,6 +392,7 @@ enum skb_drop_reason {
|
||||
SKB_DROP_REASON_TCP_OLD_ACK, /* TCP ACK is old, but in window */
|
||||
SKB_DROP_REASON_TCP_TOO_OLD_ACK, /* TCP ACK is too old */
|
||||
SKB_DROP_REASON_TCP_ACK_UNSENT_DATA, /* TCP ACK for data we haven't sent yet */
|
||||
SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE, /* pruned from TCP OFO queue */
|
||||
SKB_DROP_REASON_IP_OUTNOROUTES, /* route lookup failed */
|
||||
SKB_DROP_REASON_BPF_CGROUP_EGRESS, /* dropped by
|
||||
* BPF_PROG_TYPE_CGROUP_SKB
|
||||
|
@ -48,6 +48,8 @@
|
||||
EM(SKB_DROP_REASON_TCP_TOO_OLD_ACK, TCP_TOO_OLD_ACK) \
|
||||
EM(SKB_DROP_REASON_TCP_ACK_UNSENT_DATA, \
|
||||
TCP_ACK_UNSENT_DATA) \
|
||||
EM(SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE, \
|
||||
TCP_OFO_QUEUE_PRUNE) \
|
||||
EM(SKB_DROP_REASON_IP_OUTNOROUTES, IP_OUTNOROUTES) \
|
||||
EM(SKB_DROP_REASON_BPF_CGROUP_EGRESS, \
|
||||
BPF_CGROUP_EGRESS) \
|
||||
|
@ -5334,7 +5334,8 @@ static bool tcp_prune_ofo_queue(struct sock *sk)
|
||||
prev = rb_prev(node);
|
||||
rb_erase(node, &tp->out_of_order_queue);
|
||||
goal -= rb_to_skb(node)->truesize;
|
||||
tcp_drop(sk, rb_to_skb(node));
|
||||
tcp_drop_reason(sk, rb_to_skb(node),
|
||||
SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE);
|
||||
if (!prev || goal <= 0) {
|
||||
sk_mem_reclaim(sk);
|
||||
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
|
||||
|
Loading…
Reference in New Issue
Block a user