From nobody Tue Jun 28 11:59:34 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0545086354A; Tue, 28 Jun 2022 11:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LXNS730CYz3Qlv; Tue, 28 Jun 2022 11:59:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUqPvZ4u31cXq5LzJ6NGD3Ac8GAyB6pTTQwMVz6mFV0=; b=OFHUBB9egw5mkYXH2ooP2sg9f1Hn5bylMnhqQNJyLxm6xzu5ekTJ5f8XcXolbi+oKuNVAP XCxfkcU5iNw35w81v5YaEXTxYUNTa5huRGM9ONpgrATYEJ3IDE+jw6yWLA/HFp97hfl4QA HFRs+EcG5g1xbhX61zjDtVChDVbBsDqoUMA7Xa0S1t60+z8Row5lW5xy+S4Ih6tK7ZCUa9 SeorPzNE2CsyxTICR0+DRHTmG33yKTBScBCeK0Z2Df75KIF+vXU/Hz+BEwhmaYSsWk1GBe ouq9qBBqLLjiqcSzdGk/6a7KxvS8DfiTKKO1B0DVr4715AnXeOtNSyX9cZo2Rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF18A1C53D; Tue, 28 Jun 2022 11:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25SBxYg3055632; Tue, 28 Jun 2022 11:59:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25SBxYre055631; Tue, 28 Jun 2022 11:59:34 GMT (envelope-from git) Date: Tue, 28 Jun 2022 11:59:34 GMT Message-Id: <202206281159.25SBxYre055631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b33308db391d - main - if_ovpn: static probe points List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b33308db391d74271bc3c44c31c6e4ff8f1594d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUqPvZ4u31cXq5LzJ6NGD3Ac8GAyB6pTTQwMVz6mFV0=; b=PG/WFPwHszeM1bvB7MP8jGkZNgg55E98LQau4QMBk8vsbQBmphukN6iEb15FWcyHSFGmFx QUWdFgg0PjJxYPjXu2EsC0Qx8IrVE2xv1jrLFrdroV3vb9fxy/7YsenT8uZZe3x4SXxdsZ 8hQMAW17KvLlSjEVkPkS9R06J8lKbrP+NGzCBF2WAOGYwyJeaisnNpj9gUFosbuWdJWbpl 3u2/YV47XiMaoSmQAuwN273Ra/OpX7cq05Bl8HjuAnkOsc3GE7cCffxASX8WXsRotYb8oN esAYmmgICDOMXwJEIM9p0t4UAHF4S8yLswPOaO97Wao97sPiWGWtPwxP26iNZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656417575; a=rsa-sha256; cv=none; b=QD5KcP8ps88QETqbGHMdxh7LaShitFleJkaPpsdhBwVhJmb6D0VtMbQLA8C4icbqPQtE/N rHfL6MLi0j2CuqlLSn4YCog3Bs2A7dmxYa/TfnrT4ryHywBlJ+iJxNt04ew4dAYMUGdZfX jUq9y0iAWemENPslb8duu8Pe1zqxrga485e/2APIpvk9LZAsxRvkoBNmemVP1Gjpf10p/6 SyJAKlbxeg3AdS0UHXQqP1VgR2xk+TNt5NUYOgqoge6wizx5nAEAARqWAA4Is5axVk7ej/ 6Jd2Ik+HSCEyqm7dTGESd7izH6gNYp7hFfLiZVIPTX1el8lkqyeewtd1WLp1qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b33308db391d74271bc3c44c31c6e4ff8f1594d0 commit b33308db391d74271bc3c44c31c6e4ff8f1594d0 Author: Kristof Provost AuthorDate: 2022-05-12 19:48:23 +0000 Commit: Kristof Provost CommitDate: 2022-06-28 11:50:54 +0000 if_ovpn: static probe points Sprinkle a few SDTs around if_ovpn to ease debugging. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 57e85a414592..33ccea02e099 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -216,6 +217,11 @@ VNET_DEFINE_STATIC(struct if_clone *, ovpn_cloner); #define TO_IN(x) ((struct sockaddr_in *)(x)) #define TO_IN6(x) ((struct sockaddr_in6 *)(x)) +SDT_PROVIDER_DEFINE(if_ovpn); +SDT_PROBE_DEFINE1(if_ovpn, tx, transmit, start, "struct mbuf *"); +SDT_PROBE_DEFINE2(if_ovpn, tx, route, ip4, "struct in_addr *", "struct ovpn_kpeer *"); +SDT_PROBE_DEFINE2(if_ovpn, tx, route, ip6, "struct in6_addr *", "struct ovpn_kpeer *"); + static const char ovpnname[] = "ovpn"; static const char ovpngroupname[] = "openvpn"; @@ -1636,12 +1642,16 @@ ovpn_route_peer(struct ovpn_softc *sc, struct mbuf **m0, } peer = ovpn_find_peer_by_ip(sc, *ip_dst); + SDT_PROBE2(if_ovpn, tx, route, ip4, ip_dst, peer); if (peer == NULL) { nh = fib4_lookup(M_GETFIB(*m0), *ip_dst, 0, NHR_NONE, 0); - if (nh && (nh->nh_flags & NHF_GATEWAY)) + if (nh && (nh->nh_flags & NHF_GATEWAY)) { peer = ovpn_find_peer_by_ip(sc, nh->gw4_sa.sin_addr); + SDT_PROBE2(if_ovpn, tx, route, ip4, + &nh->gw4_sa.sin_addr, peer); + } } break; } @@ -1666,12 +1676,16 @@ ovpn_route_peer(struct ovpn_softc *sc, struct mbuf **m0, } peer = ovpn_find_peer_by_ip6(sc, ip6_dst); + SDT_PROBE2(if_ovpn, tx, route, ip6, ip6_dst, peer); if (peer == NULL) { nh = fib6_lookup(M_GETFIB(*m0), ip6_dst, 0, NHR_NONE, 0); - if (nh && (nh->nh_flags & NHF_GATEWAY)) + if (nh && (nh->nh_flags & NHF_GATEWAY)) { peer = ovpn_find_peer_by_ip6(sc, &nh->gw6_sa.sin6_addr); + SDT_PROBE2(if_ovpn, tx, route, ip6, + &nh->gw6_sa.sin6_addr, peer); + } } break; } @@ -1958,6 +1972,8 @@ ovpn_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, OVPN_RLOCK(sc); + SDT_PROBE1(if_ovpn, tx, transmit, start, m); + if (__predict_false(ifp->if_link_state != LINK_STATE_UP)) { OVPN_COUNTER_ADD(sc, lost_data_pkts_out, 1); OVPN_RUNLOCK(sc);