From owner-svn-src-all@freebsd.org Wed Jan 4 02:19:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E21CFC9D027; Wed, 4 Jan 2017 02:19:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2E811E8B; Wed, 4 Jan 2017 02:19:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v042JDbI026547; Wed, 4 Jan 2017 02:19:13 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v042JDEk026544; Wed, 4 Jan 2017 02:19:13 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201701040219.v042JDEk026544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 4 Jan 2017 02:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311225 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 02:19:15 -0000 Author: gnn Date: Wed Jan 4 02:19:13 2017 New Revision: 311225 URL: https://svnweb.freebsd.org/changeset/base/311225 Log: Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and dangerous. Those wanting data from an mbuf should use DTrace itself to get the data. PR: 203409 Reviewed by: hiren MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D9035 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Jan 4 02:15:03 2017 (r311224) +++ head/sys/netinet/tcp_input.c Wed Jan 4 02:19:13 2017 (r311225) @@ -1408,7 +1408,7 @@ tfo_socket_result: tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); tcp_dooptions(&to, optp, optlen, TO_SYN); #ifdef TCP_RFC7413 if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL)) @@ -1456,7 +1456,7 @@ tfo_socket_result: } #endif - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); /* * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later @@ -1468,7 +1468,7 @@ tfo_socket_result: return (IPPROTO_DONE); dropwithreset: - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); if (ti_locked == TI_RLOCKED) { INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1492,7 +1492,7 @@ dropwithreset: dropunlock: if (m != NULL) - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); if (ti_locked == TI_RLOCKED) { INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1826,8 +1826,7 @@ tcp_do_segment(struct mbuf *m, struct tc (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, - mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (tp->snd_una == tp->snd_max) tcp_timer_activate(tp, TT_REXMT, 0); else if (!tcp_timer_active(tp, TT_PERSIST)) @@ -1873,7 +1872,7 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Automatic sizing of receive socket buffer. Often the send @@ -2035,7 +2034,7 @@ tcp_do_segment(struct mbuf *m, struct tc } if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) { TCP_PROBE5(connect__refused, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); tp = tcp_drop(tp, ECONNREFUSED); } if (thflags & TH_RST) @@ -2088,7 +2087,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(connect__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -2468,7 +2467,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); #ifdef TCP_RFC7413 if (tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); @@ -3202,7 +3201,7 @@ dodata: /* XXX */ tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Return any desired output. @@ -3250,7 +3249,7 @@ dropafterack: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (ti_locked == TI_RLOCKED) INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; @@ -3291,7 +3290,7 @@ drop: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Jan 4 02:15:03 2017 (r311224) +++ head/sys/netinet/tcp_output.c Wed Jan 4 02:19:13 2017 (r311225) @@ -1339,7 +1339,7 @@ send: ipov->ih_len = save; } #endif /* TCPDEBUG */ - TCP_PROBE3(debug__output, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__output, tp, th, m); /* * Fill in IP length and desired time to live and Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 4 02:15:03 2017 (r311224) +++ head/sys/netinet/tcp_subr.c Wed Jan 4 02:19:13 2017 (r311225) @@ -1156,12 +1156,11 @@ tcp_respond(struct tcpcb *tp, void *ipge if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0); #endif - TCP_PROBE3(debug__output, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__output, tp, th, m); if (flags & TH_RST) - TCP_PROBE5(accept__refused, NULL, NULL, mtod(m, const char *), - tp, nth); + TCP_PROBE5(accept__refused, NULL, NULL, m, tp, nth); - TCP_PROBE5(send, NULL, tp, mtod(m, const char *), tp, nth); + TCP_PROBE5(send, NULL, tp, m, tp, nth); #ifdef INET6 if (isipv6) (void) ip6_output(m, NULL, NULL, 0, NULL, NULL, inp);