On Wed, Dec 30, 2020 at 01:10:33AM +0300, Vitaliy Makkoveev wrote:
> For me these if_{get,put}(9) dances are useless. This `ph_ifidx’ is
> related to ethernet device and used to find pppoe(4) related software
> context. pppoe_send_padt() will get this `ifp’ as `eth_if’ by itself
> and correctly handle the case where this ethernet interface was gone.
Indeed, I concur after going through the code once again.
> Also `if_list’ modifications are simultaneously protected by kernel
> lock and netlock.
Right, but if_var.h only says
TAILQ_ENTRY(ifnet) if_list; /* [K] all struct ifnets are chained */
so that's what I worked with.
I'm confident now that pppoe(4)'s input can run without the kernel lock
as is.
OK?
Index: if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.621
diff -u -p -r1.621 if.c
--- if.c 15 Dec 2020 03:43:34 -0000 1.621
+++ if.c 28 Dec 2020 18:13:02 -0000
@@ -907,9 +907,7 @@ if_netisr(void *unused)
#endif
#if NPPPOE > 0
if (n & (1 << NETISR_PPPOE)) {
- KERNEL_LOCK();
pppoeintr();
- KERNEL_UNLOCK();
}
#endif
t |= n;