Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 10:27:23 +0100 (CET)
From:      "Pedro J. Lobo" <pjlobo@euitt.upm.es>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        <freebsd-net@FreeBSD.ORG>
Subject:   Re: Updated fxp VLAN patch for 4.2-RELEASE
Message-ID:  <Pine.BSF.4.31.0101231008230.310-100000@deneb.euitt.upm.es>
In-Reply-To: <200101051611.LAA70969@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 5 Jan 2001, Garrett Wollman wrote:

> > - It doesn't modify if_vlan.c anymore. Instead, it uses ifi_hdrlen to tell
> > if_vlan.c that it supports long frames.
>
> This looks good -- but I'm a bit confused by this segment of code:
>
> + #if NVLAN > 0
> +       ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
> + #else
> +       if (sc->not_82557) {
> +               ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
> +       }
> + #endif
>
> Can you explain the logic here?  (This seems to interfere with the
> loadability of this module.)

First of all, I'm sorry for the late answer. I've been travelling for a
couple of days.

As for your question: the 82557 doesn't support long frames directly, and
they are handled as bad frames. If you want to see them, you must tell the
controller to pass all frames (including errors) to the driver, as when
the card is in promiscuous mode. Then, the driver must check that the
received frames are correct (i.e., doesn't have CRC errors, etc.) before
processing them.

With the 558 and 559 controllers, there is a bit of support, as you can
tell them to accept long frames as valid, and I enable this always (as
does OpenBSD, which is where I got the code from).

The point is that I'm hesitant to enable the 557 hack always, so I enable
it only if the vlan pseudo-device is included in the kernel config file.
You have no way of knowing this when compiling a loadable module, of
course, because there is no kernel config file, so vlans are not supported
by the lkm when using 557-based NICs. In 558- and 559-based NICs, the lkm
does support vlans.

To put it shortly: if you want to use vlans with a 557-based NIC, you must
include the driver in the kernel, as the lkm won't support long frames.
This is hardly a problem, because you have to build a custom kernel to
enable vlans, anyway. With 558- and 559-based NICs there is no
restriction, and the lkm has exactly the same functionality as the
in-kernel driver.

Cheers,

	Pedro.

-- 
--------------------------------------------------------------------
Pedro José Lobo Perea        Tel: +34 913367819 / Fax: +34 913319229
Centro de Cálculo            e-mail: pjlobo@euitt.upm.es
E.U.I.T. Telecomunicación    Universidad Politécnica de Madrid
Ctra. de Valencia, Km. 7     E-28031 Madrid - España / Spain



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.31.0101231008230.310-100000>