From nobody Tue Mar 07 14:46:55 2023 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 4PWJDv6GsWz3wF6k; Tue, 7 Mar 2023 14:46:55 +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 4PWJDv5cFSz44Fr; Tue, 7 Mar 2023 14:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678200415; 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=C4YqhJFBPogJN2kPQlityeXtutDU0nTBywNfC/JcBXo=; b=sCf7w5sZz6Muj7JhCB1BljrU8tNrtB/x0ZM3nqNa1MuwY/C4RBQB02QRUA2dpg8bnhV9Cx xJiLck5FVReiunfSVHLV/rsOLjn6hnsFeoHLfj5qOn+g1AhJG8uvctj90Utfm8AmhR5L0c XmIZtyPpeKwwwcTgu1bqAhD9NZPWgl+u5oj4w41PwPywEA1RJwz3nvKJKbtCGStnkNjKtw WoQ/Qj7RO+l7PUluQivdxhgXr6YReBRMeyc7eB46udLC8KqtIQcyNi8UDYPK+JZ4MWEgmm gKu338R2RxMZot1z8Pnfkd6uORhUgRtPKGRSD06l/f5kXY+gnNx+c8AtzXIIeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678200415; 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=C4YqhJFBPogJN2kPQlityeXtutDU0nTBywNfC/JcBXo=; b=D2VfZMa+zaNIKGQwq/s6Fd4vwWzLsNe/lAVToXtrNLK1himDik2CpCu4NiTFzumUFPn4jZ gbrkqlN4kQmjUkBBftS4nOu/+36sOivYR+QLNXLrd6mbyBjpUPQ8lr3d0v9DfLoReJnADe 7OENwKhwnQf6KCMtu6VcaGhKDbJVGR7PgYPSt/CUA2+Pkx352Lhn0qSg+YD3Xh35r/9e1d ubMXB42eQ4Rv6Glr6Ga/DVSBRYxM67hi/fTuH1mQW+99LkqNcbuVzA4GWO2cUiflRk5QH1 qh7biUkQ14XZuYl5ghIy1R58ALcMxEOEVdUNO3ndZJ/EJs4J8D9CZNDR0IAn8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678200415; a=rsa-sha256; cv=none; b=y2BN0Hijw+knLt6uxKwbtfU+NbJQgUJsuznY6mOUz96KZRm9p7xHZ0OHsDychkPtzejEVn qAL8GZtpu58MpQYAU9FT3pufY2rNZaHG2bNXlyLrrZPG++2rU2geF3kZjjPrq836q7SE0j 6plVyF+ai0/jFC0IiM+TVoov2oesA12xKNs2E34evpe/nckGhaSpcQpzabFY/ILSvvjpH9 /XaxWNIc2S2plz/sgPKmDh/w3KxH5sq4/XlUsx/aRtVhc/n7KoHzQdnEYQwQsdd71jpq7V 4Kn7YO6YqDmRe25/JJ5pH+RvurxnXt1IGyfv+bTpks1OpdYVYCeIvtFpMa9cYQ== 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 4PWJDv4PX8zn8F; Tue, 7 Mar 2023 14:46:55 +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 327Ektra008789; Tue, 7 Mar 2023 14:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 327EktcG008788; Tue, 7 Mar 2023 14:46:55 GMT (envelope-from git) Date: Tue, 7 Mar 2023 14:46:55 GMT Message-Id: <202303071446.327EktcG008788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 084846271a75 - main - ktls: Use IfAPI accessors to get capabilities 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: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 084846271a75d30e94070d0681ca900438c09f05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=084846271a75d30e94070d0681ca900438c09f05 commit 084846271a75d30e94070d0681ca900438c09f05 Author: Justin Hibbits AuthorDate: 2023-03-06 18:28:26 +0000 Commit: Justin Hibbits CommitDate: 2023-03-07 14:47:00 +0000 ktls: Use IfAPI accessors to get capabilities Summary: Avoid referencing the ifnet struct directly, and use the IfAPI accessors instead. Reviewed by: gallatin Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38932 --- sys/kern/uipc_ktls.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index cb2e3f272774..5b41cd3f829f 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -900,7 +900,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, * existing pacing rate. */ if (tp->t_pacing_rate != -1 && - (ifp->if_capenable & IFCAP_TXTLS_RTLMT) != 0) { + (if_getcapenable(ifp) & IFCAP_TXTLS_RTLMT) != 0) { params.hdr.type = IF_SND_TAG_TYPE_TLS_RATE_LIMIT; params.tls_rate_limit.inp = inp; params.tls_rate_limit.tls = tls; @@ -915,17 +915,17 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, params.hdr.numa_domain = inp->inp_numa_domain; INP_RUNLOCK(inp); - if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { + if ((if_getcapenable(ifp) & IFCAP_MEXTPG) == 0) { error = EOPNOTSUPP; goto out; } if (inp->inp_vflag & INP_IPV6) { - if ((ifp->if_capenable & IFCAP_TXTLS6) == 0) { + if ((if_getcapenable(ifp) & IFCAP_TXTLS6) == 0) { error = EOPNOTSUPP; goto out; } } else { - if ((ifp->if_capenable & IFCAP_TXTLS4) == 0) { + if ((if_getcapenable(ifp) & IFCAP_TXTLS4) == 0) { error = EOPNOTSUPP; goto out; } @@ -1000,12 +1000,12 @@ ktls_alloc_rcv_tag(struct inpcb *inp, struct ktls_session *tls, INP_RUNLOCK(inp); if (inp->inp_vflag & INP_IPV6) { - if ((ifp->if_capenable2 & IFCAP2_RXTLS6) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_RXTLS6) == 0) { error = EOPNOTSUPP; goto out; } } else { - if ((ifp->if_capenable2 & IFCAP2_RXTLS4) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_RXTLS4) == 0) { error = EOPNOTSUPP; goto out; } @@ -1618,10 +1618,10 @@ ktls_reset_receive_tag(void *context, int pending) INP_RUNLOCK(inp); if (inp->inp_vflag & INP_IPV6) { - if ((ifp->if_capenable2 & IFCAP2_RXTLS6) == 0) + if ((if_getcapenable2(ifp) & IFCAP2_RXTLS6) == 0) goto out; } else { - if ((ifp->if_capenable2 & IFCAP2_RXTLS4) == 0) + if ((if_getcapenable2(ifp) & IFCAP2_RXTLS4) == 0) goto out; }