netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: tcp: add correct check for tcp_retransmit_skb()
@ 2018-11-30 18:28 Sharath Chandra Vurukala
  2018-11-30 18:40 ` Eric Dumazet
  2018-11-30 18:41 ` Yuchung Cheng
  0 siblings, 2 replies; 7+ messages in thread
From: Sharath Chandra Vurukala @ 2018-11-30 18:28 UTC (permalink / raw)
  To: netdev; +Cc: chinagar, kapandey, subashab

when the tcp_retranmission_timer expires and tcp_retranmsit_skb is
called if the retranmsission fails due to local congestion,
backoff should not incremented.

tcp_retransmit_skb() returns non-zero negative value in some cases of
failure but the caller tcp_retransmission_timer() has a check for
failure which checks if the return value is greater than zero.
The check is corrected to check for non-zero value.

Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
---
 net/ipv4/tcp_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 091c5392..c19f371 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -511,7 +511,7 @@ void tcp_retransmit_timer(struct sock *sk)
 
 	tcp_enter_loss(sk);
 
-	if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1) > 0) {
+	if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1) != 0) {
 		/* Retransmission failed because of local congestion,
 		 * do not backoff.
 		 */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] net: tcp: add correct check for tcp_retransmit_skb()
@ 2018-11-26  9:35 Sharath Chandra Vurukala
  2018-11-26 10:16 ` Joey Pabalinas
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sharath Chandra Vurukala @ 2018-11-26  9:35 UTC (permalink / raw)
  To: netdev; +Cc: kapandey, chinagar

when the tcp_retranmission_timer expires and tcp_retranmsit_skb is
called if the retranmsission fails due to local congestion,
backoff should not incremented.

tcp_retransmit_skb() returns non-zero negative value in some cases of
failure but the caller tcp_retransmission_timer() has a check for
failure which checks if the return value is greater than zero.
The check is corrected to check for non-zero value.

Change-Id: I494fed73b2e385216402c91e9558d5c2884add5b
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
---
 net/ipv4/tcp_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 4be66e4..a70b4a9 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -536,7 +536,7 @@ void tcp_retransmit_timer(struct sock *sk)
 
 	tcp_enter_loss(sk);
 
-	if (tcp_retransmit_skb(sk, tcp_write_queue_head(sk), 1) > 0) {
+	if (tcp_retransmit_skb(sk, tcp_write_queue_head(sk), 1) != 0) {
 		/* Retransmission failed because of local congestion,
 		 * do not backoff.
 		 */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-12-01  5:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-30 18:28 [PATCH] net: tcp: add correct check for tcp_retransmit_skb() Sharath Chandra Vurukala
2018-11-30 18:40 ` Eric Dumazet
2018-11-30 18:41 ` Yuchung Cheng
  -- strict thread matches above, loose matches on Subject: below --
2018-11-26  9:35 Sharath Chandra Vurukala
2018-11-26 10:16 ` Joey Pabalinas
2018-11-28  0:15 ` David Miller
2018-11-28  0:29 ` Yuchung Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).