On Wed, Nov 27, 2024 at 09:14:19AM -0500, Brodey Dover wrote:
> Thanks. The MTU is auto negotiated to 1492. max-mss is 1440 in pf.
>
> I don't think OpenBSD has netisr or an equivalent since I don't see
> anything in the sysctl list, but it was implemented in FreeBSD and has
> allowed a number of people to fully saturate the mutli-gig symmetrical
> connections offered by newer ISPs using PPPoE. I should add *ON
> mutli-core/slower speed CPUs".
the diff below might improve pppoe rx performance.
> On Wed, 27 Nov 2024 at 03:03, Christer Solskogen <
> christer.solskogen@gmail.com> wrote:
>
> > On Tue, Nov 26, 2024 at 10:59???PM Brodey Dover <doverosx@gmail.com> wrote:
> > >
> > > So my modem is too buggy to do any DMZ work, thank you ISP.
> > >
> > > But the modem does pull 2375/2375. That???s down/up, which is why I was
> > thinking there was a serious bottleneck on the OBSD side.
> > >
> >
> > It's at least 20 years since I used PPPoE, but I seem to remember that
> > I had to lower the MTU to get the full speed. 1492 if I remember
> > correctly.
> >
> > --
> > chs
Index: if_ethersubr.c
===================================================================
RCS file: /cvs/src/sys/net/if_ethersubr.c,v
diff -u -p -r1.293 if_ethersubr.c
--- if_ethersubr.c 14 Feb 2024 22:41:48 -0000 1.293
+++ if_ethersubr.c 30 Nov 2024 06:29:47 -0000
@@ -561,7 +561,8 @@ ether_input(struct ifnet *ifp, struct mb
if (mq_enqueue(&pppoediscinq, m) == 0)
schednetisr(NETISR_PPPOE);
} else {
- if (mq_enqueue(&pppoeinq, m) == 0)
+ m = pppoe_vinput(ifp, m);
+ if (m != NULL && mq_enqueue(&pppoeinq, m) == 0)
schednetisr(NETISR_PPPOE);
}
return;
Index: if_pppoe.c
===================================================================
RCS file: /cvs/src/sys/net/if_pppoe.c,v
diff -u -p -r1.84 if_pppoe.c
--- if_pppoe.c 26 Jun 2024 01:40:49 -0000 1.84
+++ if_pppoe.c 30 Nov 2024 06:29:47 -0000
@@ -42,6 +42,8 @@
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/ioctl.h>
+#include <sys/smr.h>
+#include <sys/percpu.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_types.h>
@@ -124,7 +126,9 @@ struct pppoe_softc {
struct sppp sc_sppp; /* contains a struct ifnet as first element */
LIST_ENTRY(pppoe_softc) sc_list;/* [K] */
unsigned int sc_eth_ifidx; /* [K] */
+ caddr_t sc_bpf;
+ SMR_LIST_ENTRY(pppoe_softc) sc_session_entry; /* [K] */
int sc_state; /* [K] discovery phase or session connected */
struct ether_addr sc_dest; /* [K] hardware address of concentrator */
u_int16_t sc_session; /* [K] PPPoE session id */
@@ -175,6 +179,7 @@ static struct pppoe_softc *pppoe_find_so
static struct mbuf *pppoe_get_mbuf(size_t len);
LIST_HEAD(pppoe_softc_head, pppoe_softc) pppoe_softc_list;
+SMR_LIST_HEAD(pppoe_softc_sessions, pppoe_softc) pppoe_sessions; /* [K] */
/* interface cloning */
int pppoe_clone_create(struct if_clone *, int);
@@ -209,9 +214,19 @@ void
pppoeattach(int count)
{
LIST_INIT(&pppoe_softc_list);
+ SMR_LIST_INIT(&pppoe_sessions);
if_clone_attach(&pppoe_cloner);
}
+static void
+pppoe_set_state(struct pppoe_softc *sc, int state)
+{
+ KERNEL_ASSERT_LOCKED();
+ if (sc->sc_state == PPPOE_STATE_SESSION)
+ SMR_LIST_REMOVE_LOCKED(sc, sc_session_entry);
+ sc->sc_state = state;
+}
+
/* Create a new interface. */
int
pppoe_clone_create(struct if_clone *ifc, int unit)
@@ -230,6 +245,8 @@ pppoe_clone_create(struct if_clone *ifc,
sc->sc_sppp.pp_if.if_hdrlen = sizeof(struct ether_header) + PPPOE_HEADERLEN;
sc->sc_sppp.pp_flags |= PP_KEEPALIVE; /* use LCP keepalive */
sc->sc_sppp.pp_framebytes = PPPOE_HEADERLEN; /* framing added to ppp packets */
+ sc->sc_sppp.pp_if.if_input = p2p_input;
+ sc->sc_sppp.pp_if.if_bpf_mtap = p2p_bpf_mtap;
sc->sc_sppp.pp_if.if_ioctl = pppoe_ioctl;
sc->sc_sppp.pp_if.if_start = pppoe_start;
sc->sc_sppp.pp_if.if_rtrequest = p2p_rtrequest;
@@ -243,11 +260,14 @@ pppoe_clone_create(struct if_clone *ifc,
/* init timer for interface watchdog */
timeout_set_proc(&sc->sc_timeout, pppoe_timeout, sc);
+ if_counters_alloc(&sc->sc_sppp.pp_if);
if_attach(&sc->sc_sppp.pp_if);
if_alloc_sadl(&sc->sc_sppp.pp_if);
sppp_attach(&sc->sc_sppp.pp_if);
#if NBPFILTER > 0
- bpfattach(&sc->sc_sppp.pp_if.if_bpf, &sc->sc_sppp.pp_if, DLT_PPP_ETHER, 0);
+ bpfattach(&sc->sc_bpf, &sc->sc_sppp.pp_if, DLT_PPP_ETHER, 0);
+ bpfattach(&sc->sc_sppp.pp_if.if_bpf, &sc->sc_sppp.pp_if,
+ DLT_LOOP, sizeof(uint32_t));
No comments:
Post a Comment