From nobody Fri Jul 12 11:25:00 2024 X-Original-To: dev-commits-src-all@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 4WL8QP00cLz5QBgc; Fri, 12 Jul 2024 11:25:01 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WL8QN5bssz4hwh; Fri, 12 Jul 2024 11:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783500; 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=hblPQ/81LQvp7SgAoFhmptJ3EuqM3YACsdaBvLOOAbM=; b=PMbJ2g3JBNM5KThHIwpDStt81MrskGnELbsrJvBvQQa2c9n5A+T1HNJn8eaVOqruBHKGqo VbtzQfFTor9xOFA3PAIUaur5HfpxMntBJtevQ4Go7BQyGEQkYjg/3PtmPkNW7fQ7cB2EhW QYE/Tnxfof0bKQ0FYfFeEhZ4ePUN0Q3zqfeXaxUwmOS/BAfO6iqrplL+KNhxsorWXgna0u 8I2Pz8m7jtAZVXg8JmEkLuyealaQ4DbZxfXzlkBGVlquvGoltVtqirQq3O4/aqC98/SNwM VSm4wl+dEkv4qOJB8/GUdKPym7n0t9n0iYiYOGloqB5GrL8cizKsV+nb4H6Udw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720783500; a=rsa-sha256; cv=none; b=Faz7+SuecdUJlLc9/py7YJP3V0TzgHYXRm6k+z/PNzmlHIUVuB9bWm7szn8fD8VFRh9cJK /iDhENrD7qA8w1EAa7Z0CZZvJh83JtRLUZrJ0966QdX4f6/tQV3th6ta23hAZjhHGWHRhp 2xolGDIV09TSeo0asAdfaGmDXiPTUGyel2Fz9vBNkWHmTN1CzmORojdmOfBF2zFe5K4b/F a7sVM77IcwC7VmXUCVlU0DvzvQZuZhKUd6XC3MQ/6rd8Mr54K93LS/aKtZpab3XcReotbA Y46Cs/6/b7WCeJjZS7nEjhrItTiY0HK9WSHUHnX7BuadMw6mmlxUiu7cj3y8Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783500; 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=hblPQ/81LQvp7SgAoFhmptJ3EuqM3YACsdaBvLOOAbM=; b=yKw6aH2GtdzQFt2MJ+ny70L+VV1k1X2+4iQtAt3biUKwNEqVwj662+anme+6Aw1o2jCY0f Pf/gar+4/6kWHU5Eo4H6nDy1DSNWrxbvh4hEFIMC9lz2K+kheQ7A8zrE5iiEtvdza2qsvl N+T8A0iZW6hyDzJzoiLmsdjqANheMnsfexiFHRLcpwTeh7+aPP8j9CqhaD3achArtW5Wt4 bAAu1Lv3Y1ldUBa/BShMMACpTyWMonbzuqy8moV4DdKDuw1lR2nHrx/hl3mz2eT1ekfWOn 6O4XVpB/TVGx9KKk/UAPRqY/4XIKio/FnyqUnWcqZP+5sgBjhO4WVmQHSWh88Q== 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 4WL8QN4vJ0zgwp; Fri, 12 Jul 2024 11:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46CBP0Jr092773; Fri, 12 Jul 2024 11:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CBP0Tw092770; Fri, 12 Jul 2024 11:25:00 GMT (envelope-from git) Date: Fri, 12 Jul 2024 11:25:00 GMT Message-Id: <202407121125.46CBP0Tw092770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1b1cd327d905 - main - setkey(8): print out SA sw/hw offload counters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b1cd327d905fab5920e7af2582d15d48ad26999 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1b1cd327d905fab5920e7af2582d15d48ad26999 commit 1b1cd327d905fab5920e7af2582d15d48ad26999 Author: Konstantin Belousov AuthorDate: 2023-06-03 22:56:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-12 03:29:31 +0000 setkey(8): print out SA sw/hw offload counters Sponsored by: NVIDIA networking --- lib/libipsec/pfkey.c | 2 ++ lib/libipsec/pfkey_dump.c | 23 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/libipsec/pfkey.c b/lib/libipsec/pfkey.c index 31464d063241..2308dd3281a7 100644 --- a/lib/libipsec/pfkey.c +++ b/lib/libipsec/pfkey.c @@ -1713,6 +1713,8 @@ pfkey_align(struct sadb_msg *msg, caddr_t *mhp) case SADB_X_EXT_SA_REPLAY: case SADB_X_EXT_NEW_ADDRESS_SRC: case SADB_X_EXT_NEW_ADDRESS_DST: + case SADB_X_EXT_LFT_CUR_SW_OFFL: + case SADB_X_EXT_LFT_CUR_HW_OFFL: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; default: diff --git a/lib/libipsec/pfkey_dump.c b/lib/libipsec/pfkey_dump.c index cd5961822751..2e69277fe6c2 100644 --- a/lib/libipsec/pfkey_dump.c +++ b/lib/libipsec/pfkey_dump.c @@ -201,7 +201,7 @@ pfkey_sadump(struct sadb_msg *m) caddr_t mhp[SADB_EXT_MAX + 1]; struct sadb_sa *m_sa; struct sadb_x_sa2 *m_sa2; - struct sadb_lifetime *m_lftc, *m_lfth, *m_lfts; + struct sadb_lifetime *m_lftc, *m_lfth, *m_lfts, *m_lft_sw, *m_lft_hw; struct sadb_address *m_saddr, *m_daddr, *m_paddr; struct sadb_key *m_auth, *m_enc; struct sadb_ident *m_sid, *m_did; @@ -240,7 +240,8 @@ pfkey_sadump(struct sadb_msg *m) natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT]; natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI]; natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR]; - + m_lft_sw = (struct sadb_lifetime *)mhp[SADB_X_EXT_LFT_CUR_SW_OFFL]; + m_lft_hw = (struct sadb_lifetime *)mhp[SADB_X_EXT_LFT_CUR_HW_OFFL]; /* source address */ if (m_saddr == NULL) { @@ -381,7 +382,23 @@ pfkey_sadump(struct sadb_msg *m) /* XXX DEBUG */ printf("refcnt=%u\n", m->sadb_msg_reserved); - return; + if (m_lft_sw != NULL) { + printf("\tsw offl use: %s", + str_time(m_lft_sw->sadb_lifetime_usetime)); + printf("\tsw offl allocated: %lu", + (unsigned long)m_lft_sw->sadb_lifetime_allocations); + str_lifetime_byte(m_lft_sw, "sw offl"); + printf("\n"); + } + + if (m_lft_hw != NULL) { + printf("\thw offl use: %s", + str_time(m_lft_hw->sadb_lifetime_usetime)); + printf("\thw offl allocated: %lu", + (unsigned long)m_lft_hw->sadb_lifetime_allocations); + str_lifetime_byte(m_lft_hw, "hw offl"); + printf("\n"); + } } void