Thread (9 messages) flat view 9 messages, 2 authors, 2021-10-28
STALE1754d

[PATCH net-next 6/7] tcp: do not clear skb->csum if already zero

From: Eric Dumazet <hidden>
Date: 2021-10-27 20:19:40
Subsystem: networking [general], networking [tcp], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Linus Torvalds

From: Eric Dumazet <edumazet@google.com>

Freshly allocated skbs have their csum field cleared already.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp.c        | 1 -
 net/ipv4/tcp_output.c | 1 -
 net/ipv6/tcp_ipv6.c   | 1 -
 3 files changed, 3 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c58d448b45a098b23fdc09530c2565326e77c29f..88475b64034432d4bb3c6989a69a3041ae6e7711 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -658,7 +658,6 @@ void tcp_skb_entail(struct sock *sk, struct sk_buff *skb)
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
 
-	skb->csum    = 0;
 	tcb->seq     = tcb->end_seq = tp->write_seq;
 	tcb->tcp_flags = TCPHDR_ACK;
 	tcb->sacked  = 0;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7ecf35d0f847c0c6aa34d3cb05e3f28a623216bd..5664355b0d09abc701ba7b422340ed9699bc71f0 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2398,7 +2398,6 @@ static int tcp_mtu_probe(struct sock *sk)
 	TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size;
 	TCP_SKB_CB(nskb)->tcp_flags = TCPHDR_ACK;
 	TCP_SKB_CB(nskb)->sacked = 0;
-	nskb->csum = 0;
 
 	tcp_insert_write_queue_before(nskb, skb, sk);
 	tcp_highest_sack_replace(sk, skb, nskb);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index c678e778c1fb8f8cb7300c23cb876ef0d8e750c8..2cc9b0e53ad1c8e2d35fc9c6dbd1e90fee40b632 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -969,7 +969,6 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
 	fl6.flowlabel = label;
 
 	buff->ip_summed = CHECKSUM_PARTIAL;
-	buff->csum = 0;
 
 	__tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr);
 
-- 
2.33.0.1079.g6e70778dc9-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help