Index | Thread | Search

From:
Sebastien Marie <semarie@kapouay.eu.org>
Subject:
Re: pppoe transmit optimisation
To:
David Gwynne <david@gwynne.id.au>, tech@openbsd.org
Date:
Wed, 14 May 2025 08:56:57 +0200

Download raw body.

Thread
David Gwynne <david@gwynne.id.au> writes:

> this let's packets being sent out pppoe interfaces bypass queues and go
> straight onto the underlying interface.
>
> it's complementary to src/sys/net/if_pppoe.c r1.85 "let pppoe data
> packets go through if_vinput instead of the pppoeinq", but where that
> skipped a queue on the rx side, this diff does it on the tx side.
>
> i don't use pppoe anymore, so i need someone to test this diff before i
> can commiti it.

it doesn't apply cleanly in my tree (/* $OpenBSD: if_pppoe.c,v 1.86 2025/03/02 21:28:32 bluhm Exp $ */)

patching file if_pppoe.c
Hunk #1 FAILED at 42.
Hunk #2 succeeded at 160 (offset 4 lines).
Hunk #3 succeeded at 249 with fuzz 2 (offset 17 lines).
Hunk #4 succeeded at 266 with fuzz 2 (offset 18 lines).
Hunk #5 succeeded at 1544 (offset 152 lines).
Hunk #6 FAILED at 1452.
2 out of 6 hunks FAILED


> 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	12 May 2025 04:04:16 -0000
> @@ -42,6 +42,7 @@
>  #include <sys/socket.h>
>  #include <sys/syslog.h>
>  #include <sys/ioctl.h>
> +#include <sys/percpu.h>
>  #include <net/if.h>
>  #include <net/if_var.h>
>  #include <net/if_types.h>

sys/percpu.h is already here (added in 1.85, with sys/smr.h).

> @@ -1407,21 +1453,6 @@ pppoe_start(struct ifnet *ifp)
>  	}
>  
>  	while ((m = sppp_dequeue(ifp)) != NULL) {
> -		len = m->m_pkthdr.len;
> -		M_PREPEND(m, PPPOE_HEADERLEN, M_DONTWAIT);
> -		if (m == NULL) {
> -			ifp->if_oerrors++;
> -			continue;
> -		}
> -		p = mtod(m, u_int8_t *);
> -		PPPOE_ADD_HEADER(p, 0, sc->sc_session, len);
> -
> -#if NBPFILTER > 0
> -		if(sc->sc_sppp.pp_if.if_bpf)
> -			bpf_mtap(sc->sc_sppp.pp_if.if_bpf, m,
> -			    BPF_DIRECTION_OUT);
> -#endif

the '#if NBPFILTER > 0' block isn't updated (changed in 1.85)

> -
> -		pppoe_output(sc, m);
> +		pppoe_transmit(sc, m);
>  	}
>  }
>

also, no braces for the while() statement: there is only
pppoe_transmit(sc, m) now.

Thanks.
-- 
Sebastien Marie