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
This commit is contained in:
Justin Hibbits 2023-01-25 15:08:12 -05:00
parent 31cfaf191b
commit d79539e6f2
2 changed files with 8 additions and 0 deletions

View File

@ -4905,6 +4905,12 @@ if_getcounter(if_t ifp, ift_counter counter)
return (ifp->if_get_counter(ifp, 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 * struct vnet *
if_getvnet(if_t ifp) if_getvnet(if_t ifp)
{ {

View File

@ -646,6 +646,8 @@ struct bpf_if *if_getbpf(if_t ifp);
uint8_t if_getpcp(if_t ifp); uint8_t if_getpcp(if_t ifp);
void *if_getl2com(if_t ifp); void *if_getl2com(if_t ifp);
struct ifvlantrunk *if_getvlantrunk(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); void *if_getafdata(if_t ifp, int);
/* /*