Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jun 2009 10:34:06 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        "Bjoern A. Zeeb" <bz@freebsd.org>
Cc:        FreeBSD net mailing list <freebsd-net@freebsd.org>, Michael Tuexen <tuexen@freebsd.org>, Andrew Thompson <thompsa@freebsd.org>, Jack F Vogel <jfv@freebsd.org>, Andrew Gallatin <gallatin@freebsd.org>, Pyun YongHyeon <yongari@freebsd.org>
Subject:   Re: Ethernet NIC drivers depending unconditionally on INET
Message-ID:  <20090612013406.GB72855@michelle.cdnetworks.co.kr>
In-Reply-To: <20090611184555.J22887@maildrop.int.zabbadoz.net>
References:  <20090611184555.J22887@maildrop.int.zabbadoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 11, 2009 at 08:33:28PM +0000, Bjoern A. Zeeb wrote:
> Hi,
> 
> as announced in my other mail to current@ and net@  I added the
> mandatory "INET" dependency to 12 Ethernet NIC drivers.  Additionally
> I am adding if_bridge here as well.
> 
> Those drivers should be fixed and once done the (mandatory) inet
> dependency should be removed again from sys/conf/files for that
> driver.
> 
> If you have questions, need help, compile testing, ... feel free to
> mail me.  I won't be able to test things as I do not own all of the
> different cases but I can review patches, ..
> 
> 
> Generally speaking upfront: if one of the drivers mentioned here or
> not, supportes offload capabilities for rx or tx of v4 or v6, for tcp,
> udp, sctp, .. they need to be properly hidden under the apropriate
> #ifdefs.
> 
> Everything that needs v4 belongs under #ifdef INET.
> Everything that needs v6 belongs under #ifdef INET6.
> Upper layer protocols like TCP, UDP, SCTP should be at least
> 	#if defined (INET) || defined(INET6).
> In case of SCTP probebly #ifdef (SCTP) as well.
> 
> You will need to include opt_inet.h, opt_inet6.h, opt_sctp.h
> in those cases and at least the buildkernel (not building the module
> alone) part should properly check them.  For single module builds
> we are kind of lost here and I think we usually enabled things by
> default as they are in GENERIC.
> 
> Another general note that scared me while looking at CSUM_TSO and
> IFCAP_TSO4|IFCAP_TSO6.  Almost none of the drivers actually checks
> that it is an IPv4 packet before grabiing the IP header, TCP header,
> ...  How do we actually know that it is an IPv4 packet in all those

Yeah, there are no checksum offloading support for IPv6 under
FreeBSD so there are no cases the frames are IPv6 when
CSUM_IP/CSUM_TCP/CSUM_UDP/CSUM_TSO was set.

> drivers?  Should we do a IP Version fiel check?  I think em(4) is one

I believe this should be done in upper stack. Upper stack already
know IP version as well as other useful fields(e.g. IP header
length, TCP header length, etc). You wouldn't want to parse mbuf
chains which takes a lot of CPU cycles.

> of those that does.  I hope this will improve with tuexen's work on
> the CSUM flags.
> 
> In case you are maintaining another driver but cannot find it on the
> list - be sure we'll find you during the 9.x lifecycle in case you do
> not properly handle things;-)
> 

[ list of drivers part removed ]

I guess you missed hme(4) and gem(4) in the list and most old
hardwares that supports checksum offloading have no capability to
handle IPv6 checksum offloading. If we do not define appropriate
capabilities(IFCAP_RXCSUM_IPV4, IFCAP_TXCSUM_IPV6,
IFCAP_RXCSUM_TCPV4, IFCAP_TXCSUM_TCPV6 etc) first it would be
hard to change code, I guess.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090612013406.GB72855>