Skip to contentSkip to conversation

tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint

PATCH Applied David Ahern 4 participants 4 messages Oct 18, 2017 – Oct 20, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint

386fd5da401d ("tcp: Check daddr_cache before use in tracepoint") was the second version of the tracepoint fixup patch. This patch is the delta between v2 and v3. Specifically, remove the use of inet6_sk and check sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted by Cong).

---
Eric/Congi/Song: I did not keep your Acked/Reviewed/Tested-by since it is a different patch. End result is the exact same as v3 patch sent yesterday.

 include/trace/events/tcp.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/trace/events/tcp.h +5 -3
index f51c130f1e0f..c3220d914475 100644
@@ -43,13 +43,15 @@ TRACE_EVENT(tcp_retransmit_skb,
 		p32 = (__be32 *) __entry->daddr;
 		*p32 =  inet->inet_daddr;
 
-		/* IPv6 socket ? */
-		if (inet6_sk(sk)) {
+#if IS_ENABLED(CONFIG_IPV6)
+		if (sk->sk_family == AF_INET6) {
 			pin6 = (struct in6_addr *)__entry->saddr_v6;
 			*pin6 = sk->sk_v6_rcv_saddr;
 			pin6 = (struct in6_addr *)__entry->daddr_v6;
 			*pin6 = sk->sk_v6_daddr;
-		} else {
+		} else
+#endif
+		{
 			pin6 = (struct in6_addr *)__entry->saddr_v6;
 			ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
 			pin6 = (struct in6_addr *)__entry->daddr_v6;
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · David Ahern

386fd5da401d ("tcp: Check daddr_cache before use in tracepoint") was the second version of the tracepoint fixup patch. This patch is the delta between v2 and v3. Specifically, remove the use of inet6_sk and check sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted by Cong).

---

Thanks !

Tested-by
#2 lore raw
Quoted 11 lines · Eric Dumazet
Quoted 7 lines · David Ahern

386fd5da401d ("tcp: Check daddr_cache before use in tracepoint") was the second version of the tracepoint fixup patch. This patch is the delta between v2 and v3. Specifically, remove the use of inet6_sk and check sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted by Cong).

Quoted 7 lines
Quoted 2 lines

---

Thanks !

maintainer Applied
#3 lore raw
In reply to David Ahern

From: David Ahern <[email protected]>
Date: Wed, 18 Oct 2017 08:17:29 -0700

Quoted 8 lines

386fd5da401d ("tcp: Check daddr_cache before use in tracepoint") was the second version of the tracepoint fixup patch. This patch is the delta between v2 and v3. Specifically, remove the use of inet6_sk and check sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted by Cong).

Applied, sorry for the mixup :)