From nobody Tue Jan 31 20:03:21 2023 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 4P5wwB2L4Gz3c8Zr; Tue, 31 Jan 2023 20:03:22 +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 4P5wwB14sNz3DJ7; Tue, 31 Jan 2023 20:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195402; 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=xqQQg0ob/sBoV8Bllcl5L2lOE4rGECOJgSYJ4EJU53U=; b=NHElda4yKcV1IopWi6mb6sqMx4dmrvhkdK2Obkko7PWcJacfFhFiJUIoCOyyrQHXMqBylB 8dmL4VMSMYtizoNMohW8hGTf5ZhgZnsLZi2n1SploZVkNf9yycB8I3eY615HKa6cb0FgiQ Ms6T7PieHHpYf8j/MpDB80AfpGCWdaDIJRci/aJY4ZMMCepaqRSSzgeWetYyhX2XBIz6QZ atWXDtnA36vr7ysP+I9cCy0D1ta1NwWMuw5Qz2ntUsZnGfocU7K7EgmCvnd5fdJcCl7eKQ 4EyAlPfWp6W/e7mqFO1iHzYhoRvGMxAhsIsVSaR++fogTpj5iEI4cM+4PfZQWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195402; 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=xqQQg0ob/sBoV8Bllcl5L2lOE4rGECOJgSYJ4EJU53U=; b=xMbroj2/G1EGXBipkFAmD6d6B6ytqv3u0Ci/Iq8aWRgT5CXaNSMiWKonN5C1Kh8H0GNQZU f+AANmJ2fr/K3F1r7IX1Q1q22a3vjmOaDV1+guMdj37GYUfEEEjtjZmWZvNmcyk5qXTJF8 YpXcdEs+W0caob17zKNeMRLvnkNeS7RmNy6XtoZ6eqoSMmY8g9QXBuZ6mVozIq+4mv8tV5 gxEgkE0+mS5G01InSl9IQGnmnnNhmpTP4/8i9AE1YD5qCeHlwlCCvLT8xJvKG0Kyiz1uRu EoV/cw27pOCoWclLnfIK7eH4H9AduRilnenRdimhUPVuhecqP2I156zJK7oFJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675195402; a=rsa-sha256; cv=none; b=tj/CaEqxb8N3EqPjDRBKE90+/0rNvLd66PZH9hMCkWKlmv2ZKq1YTJ2LSbSBB66lgae3xI gcku51WmwcM+gsMzeCrhvSDHwz0hl5+lgtq1AMJX+1aQESXZHJQXQFNezXvnkvbwsd5qQ9 X9DQdAJlPR3WzWxE0a2MDgJWMk8qLJiut6ZqUyN0gjOIpdjtm83HmKqx6wqElXBPMgh8Tc oQDXoAY2ifnRgMjAXagVGN2rcTIRblu/+c3VHKpKDdhl9/ttm//HLZWiuo/m3tRlKsg5/9 /R6oMXHrtuBBTCNg18PxEUQ4HRJ+dfr4E4aIMXdbjhG9syt0C6qOpbp5Rpx32g== 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 4P5wwB08tyz121n; Tue, 31 Jan 2023 20:03:22 +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 30VK3LoS025046; Tue, 31 Jan 2023 20:03:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30VK3L1Z025045; Tue, 31 Jan 2023 20:03:21 GMT (envelope-from git) Date: Tue, 31 Jan 2023 20:03:21 GMT Message-Id: <202301312003.30VK3L1Z025045@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: d79539e6f2ee - main - IfAPI: Add if_altq_is_enabled() interface. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: d79539e6f2eea0d659b1a96e0447e2fa9e2122fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=d79539e6f2eea0d659b1a96e0447e2fa9e2122fa commit d79539e6f2eea0d659b1a96e0447e2fa9e2122fa Author: Justin Hibbits AuthorDate: 2023-01-25 20:08:12 +0000 Commit: Justin Hibbits CommitDate: 2023-01-31 20:02:17 +0000 IfAPI: Add if_altq_is_enabled() interface. Summary: The only user of the ALTQ_IS_ENABLED() in a driver checks against the ifnet queue. Abstract that all out and present the interface to check if ALTQ is enabled on the interface. Sponsored by: Juniper Networks, Inc. Reviewed By: glebius Differential Revision: https://reviews.freebsd.org/D38204 --- sys/net/if.c | 6 ++++++ sys/net/if_var.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 2ab12d1ac313..951349b97ffb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4905,6 +4905,12 @@ if_getcounter(if_t ifp, ift_counter counter) return (ifp->if_get_counter(ifp, counter)); } +bool +if_altq_is_enabled(if_t ifp) +{ + return (ALTQ_IS_ENABLED(&ifp->if_snd)); +} + struct vnet * if_getvnet(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index dbf8796865f0..4c3d4138f7ec 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -646,6 +646,8 @@ struct bpf_if *if_getbpf(if_t ifp); uint8_t if_getpcp(if_t ifp); void *if_getl2com(if_t ifp); struct ifvlantrunk *if_getvlantrunk(if_t ifp); +bool if_altq_is_enabled(if_t ifp); + void *if_getafdata(if_t ifp, int); /*