From owner-freebsd-net@FreeBSD.ORG Fri Jun 12 01:53:54 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A570B106566B; Fri, 12 Jun 2009 01:53:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.228]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8588FC13; Fri, 12 Jun 2009 01:53:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id k40so625306rvb.43 for ; Thu, 11 Jun 2009 18:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=UfbFq2Q7DYKBWmRAkizOUlgorX9vGsPzgG2X8KaoVlY=; b=HTbMJQIaCBKspdDMTanRf1mZoO17eL+Z1mYyQ80KAUAg7K+FYCO520fg71sqVVPusG NvmusuoRbiakqs/scFvyrN6HKa5Hlh67RJ++TxuQ2+BDxNnReVCQ8zPGTZaGUrD4A2Ot GT5vrwOfhmjGDT99hcjVew+WuClJX/4FRVcIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Nkidu7IIf8J4kjxA8Bworssq0lShzen8S47NJbr8MIkb2VWE94qPyM9H42HBeXR/Vx jPeOSOcZgq1M3KKMi7tcxMxexfCawYWxzcgBvIMQnrcMjumnjqAZ3uq2S6R3PW8kpXe/ 3v9/0lhrdm4u0qc5OBH/mrK3Frg3b6x2OfSmY= Received: by 10.140.193.15 with SMTP id q15mr2419473rvf.257.1244770285223; Thu, 11 Jun 2009 18:31:25 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id f42sm2131591rvb.31.2009.06.11.18.31.23 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Jun 2009 18:31:24 -0700 (PDT) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Fri, 12 Jun 2009 10:34:06 +0900 From: Pyun YongHyeon Date: Fri, 12 Jun 2009 10:34:06 +0900 To: "Bjoern A. Zeeb" Message-ID: <20090612013406.GB72855@michelle.cdnetworks.co.kr> References: <20090611184555.J22887@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090611184555.J22887@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.4.2.3i Cc: FreeBSD net mailing list , Michael Tuexen , Andrew Thompson , Jack F Vogel , Andrew Gallatin , Pyun YongHyeon Subject: Re: Ethernet NIC drivers depending unconditionally on INET X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 01:53:54 -0000 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.