Subject: Re: Allowing large PPPoE frames
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Quentin Garnier <netbsd@quatriemek.com>
List: tech-net
Date: 08/03/2003 21:31:44
Le Sun, 3 Aug 2003 21:12:56 +0200
Manuel Bouyer a ecrit :
> On Sun, Aug 03, 2003 at 03:07:30PM +0200, Quentin Garnier wrote:
> > [...]
> > 
> > How about the attached patch?
> 
> This is not enouth. We also need to know if a pppoe interface is
> attached to the ethernet if, so that the driver can DTRT if needed, and
> the pppoe driver probably needs to know if the ethernet driver can let
> large frames to come in.
> Look at the ETHERCAP_VLAN_MTU capability for example. We probably need
> something similar here.

Well, at the time that particular check is done, VLAN capabilities aren't
checked for the interface either: if a frame *may* have a VLAN tag (i.e.,
its Ethernet type field is set to ETHERTYPE_VLAN), it gets processed. My
patch just does the same thing for PPPoE

The PPPoE client code will do the necessary sanity checks and decide if it
is a valid PPPoE frame. The patch just gives a chance for the frame to be
processed, asserting it is a valid one is the responsibility of the PPPoE
code.

I don't see how this is different from the way VLAN frames are processed,
and why large PPPoE frames should be handled differently.

At the time the check is done, the only question asked is "given that
frame is too large WRT Ethernet specification, is there a chance it might
still be of interest for us?".

About the NIC driver issue, it is very hardware-dependant. The card I have
on my NetBSD 1.5 gateway is a unbranded rt8029 PCI card, and I nothing to
do to make it accept large PPPoE frames. It may not be true for all NE2000
clones...

For the DP83815, the following one-liner is needed. I haven't tested on
any other NIC I might have.

But anyway, we don't have to check if the NIC can receive the frame at
that time, because obviously it could.

Index: sys/dev/pci/if_sip.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_sip.c,v
retrieving revision 1.78
diff -u -r1.78 if_sip.c
--- sys/dev/pci/if_sip.c	2003/03/23 00:56:15	1.78
+++ sys/dev/pci/if_sip.c	2003/08/03 19:30:07
@@ -2314,6 +2314,7 @@
 	 * Initialize the prototype RXCFG register.
 	 */
 	sc->sc_rxcfg |= (sc->sc_rx_drain_thresh << RXCFG_DRTH_SHIFT);
+	sc->sc_rxcfg |= RXCFG_AJAB;
 	bus_space_write_4(st, sh, SIP_RXCFG, sc->sc_rxcfg);
 
 #ifdef DP83820

-- 
Quentin Garnier - cube@cubidou.net
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.