summaryrefslogtreecommitdiff
path: root/sys/net/if_pppoe.c
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2021-01-04 21:21:42 +0000
committerkn <kn@cvs.openbsd.org>2021-01-04 21:21:42 +0000
commit6832771ed932bac0793efedab45b311744e490f5 (patch)
tree6f947ff4a5bca24df7c49a0d66cf4a303cfba79e /sys/net/if_pppoe.c
parent338781c95edbc06af9e20fc7d9ef0af913c2c70b (diff)
Process pppoe(4) packets directly, do not queue through netis
Less scheduling, lock contention and queues. Previously, if_netisr() handled the net lock around those calls, now if_input_process() does it before calling ether_input(), so no need to add or remove NET_*LOCK() anywhere. OK mvs claudio
Diffstat (limited to 'sys/net/if_pppoe.c')
-rw-r--r--sys/net/if_pppoe.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c
index 2b8a4545eb1..b6ece4239b2 100644
--- a/sys/net/if_pppoe.c
+++ b/sys/net/if_pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppoe.c,v 1.75 2020/12/30 13:18:07 mvs Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.76 2021/01/04 21:21:41 kn Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
@@ -143,14 +143,8 @@ struct pppoe_softc {
struct timeval sc_session_time; /* [N] time the session was established */
};
-/* incoming traffic will be queued here */
-struct niqueue pppoediscinq = NIQUEUE_INITIALIZER(IFQ_MAXLEN, NETISR_PPPOE);
-struct niqueue pppoeinq = NIQUEUE_INITIALIZER(IFQ_MAXLEN, NETISR_PPPOE);
-
/* input routines */
-static void pppoe_disc_input(struct mbuf *);
static void pppoe_dispatch_disc_pkt(struct mbuf *);
-static void pppoe_data_input(struct mbuf *);
/* management routines */
void pppoeattach(int);
@@ -341,21 +335,6 @@ pppoe_find_softc_by_hunique(u_int8_t *token, size_t len, u_int ifidx)
return (sc);
}
-/* Interface interrupt handler routine. */
-void
-pppoeintr(void)
-{
- struct mbuf *m;
-
- NET_ASSERT_LOCKED();
-
- while ((m = niq_dequeue(&pppoediscinq)) != NULL)
- pppoe_disc_input(m);
-
- while ((m = niq_dequeue(&pppoeinq)) != NULL)
- pppoe_data_input(m);
-}
-
/* Analyze and handle a single received packet while not in session state. */
static void
pppoe_dispatch_disc_pkt(struct mbuf *m)
@@ -649,7 +628,7 @@ done:
}
/* Input function for discovery packets. */
-static void
+void
pppoe_disc_input(struct mbuf *m)
{
/* avoid error messages if there is not a single pppoe instance */
@@ -661,7 +640,7 @@ pppoe_disc_input(struct mbuf *m)
}
/* Input function for data packets */
-static void
+void
pppoe_data_input(struct mbuf *m)
{
struct pppoe_softc *sc;