netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: netdev@vger.kernel.org
Cc: xiyou.wangcong@gmail.com, eric.dumazet@gmail.com,
	songliubraving@fb.com, davem@davemloft.net,
	David Ahern <dsahern@gmail.com>
Subject: [PATCH net-next] tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint
Date: Wed, 18 Oct 2017 08:17:29 -0700	[thread overview]
Message-ID: <1508339849-19527-1-git-send-email-dsahern@gmail.com> (raw)

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).

Signed-off-by: David Ahern <dsahern@gmail.com>
---
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(-)

diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index f51c130f1e0f..c3220d914475 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -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;
-- 
2.1.4

             reply	other threads:[~2017-10-18 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 15:17 David Ahern [this message]
2017-10-18 15:28 ` [PATCH net-next] tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint Eric Dumazet
2017-10-18 16:27   ` Song Liu
2017-10-20 12:05 ` David Miller

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=1508339849-19527-1-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=xiyou.wangcong@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).