NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/58168: IFF_OACTIVE semantics and replacement plan is unclear
The following reply was made to PR kern/58168; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/58168: IFF_OACTIVE semantics and replacement plan is unclear
Date: Thu, 18 Apr 2024 12:05:22 -0000 (UTC)
mrg%eterna23.net@localhost (matthew green) writes:
> that check, if needed, should also be moved into the device
> if_start() if not already there.
That check in net/if.c exists only to optimize away the call of the
start routine. The common boilerplate for such a (legacy) start routine
is:
static void
xxx_start(struct ifnet *ifp) {
if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING)
return;
...
}
to skip the start when the interface is either unavailable or busy.
But when you require to take extra locks for checking an mp-safe
driver flag, the additional overhead of the call itself becomes
neglible.
Home |
Main Index |
Thread Index |
Old Index