From: Jianguo Wu <wujianguo106@163.com>
To: dsahern@kernel.org, Jakub Kicinski <kuba@kernel.org>,
menglong8.dong@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
edumazet@google.com
Subject: [PATCH net-next] tcp: make tcp_rcv_state_process() drop monitor friendly
Date: Wed, 23 Mar 2022 21:04:57 +0800 [thread overview]
Message-ID: <3eb95fd0-2046-c000-9c0b-c7c7e05ce04a@163.com> (raw)
From: Jianguo Wu <wujianguo@chinatelecom.cn>
In tcp_rcv_state_process(), should not call tcp_drop() for same case,
like after process ACK packet in TCP_LAST_ACK state, it should call
consume_skb() instead of tcp_drop() to be drop monitor friendly,
otherwise every last ack will be report as dropped packet by drop monitor.
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
---
net/ipv4/tcp_input.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2088f93..feb6f83 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6574,7 +6574,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
inet_csk_reset_keepalive_timer(sk, tmo);
} else {
tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
- goto discard;
+ consume_skb(skb);
+ return 0;
}
break;
}
@@ -6582,7 +6583,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
case TCP_CLOSING:
if (tp->snd_una == tp->write_seq) {
tcp_time_wait(sk, TCP_TIME_WAIT, 0);
- goto discard;
+ consume_skb(skb);
+ return 0;
}
break;
@@ -6590,7 +6592,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
if (tp->snd_una == tp->write_seq) {
tcp_update_metrics(sk);
tcp_done(sk);
- goto discard;
+ consume_skb(skb);
+ return 0;
}
break;
}
--
1.8.3.1
next reply other threads:[~2022-03-23 13:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 13:04 Jianguo Wu [this message]
2022-03-23 13:40 ` Eric Dumazet
2022-03-24 2:33 ` Jianguo Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3eb95fd0-2046-c000-9c0b-c7c7e05ce04a@163.com \
--to=wujianguo106@163.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menglong8.dong@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®