From owner-freebsd-net@FreeBSD.ORG Fri Nov 2 14:43:25 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D62A288 for ; Fri, 2 Nov 2012 14:43:25 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id E31418FC0C for ; Fri, 2 Nov 2012 14:43:24 +0000 (UTC) Received: (qmail 85841 invoked from network); 2 Nov 2012 16:19:34 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 2 Nov 2012 16:19:34 -0000 Message-ID: <5093DC04.2010902@freebsd.org> Date: Fri, 02 Nov 2012 15:43:16 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r242473 - user/andre/tcp_workqueue/sys/dev/ixgbe References: <201211021343.qA2DhHHr031786@svn.freebsd.org> In-Reply-To: <201211021343.qA2DhHHr031786@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: jfv@FreeBSD.org, freebsd-net@freebsd.org, yongari@FreeBSD.org, davidch@FreeBSD.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 14:43:25 -0000 On 02.11.2012 14:43, Andre Oppermann wrote: > Author: andre > Date: Fri Nov 2 13:43:17 2012 > New Revision: 242473 > URL: http://svn.freebsd.org/changeset/base/242473 > > Log: > Merge ixgbe_tx_ctx_setup() and ixgbe_tso_setup() together into > ixgbe_offload_setup() as they have a large overlap in packet > inspection and variables. > > Add UDP fragmentation offload functionality as well. > > Also the driver can assume that the necessary headers for the > activated offload functions are contiguously present in the > first mbuf. This assumption is not formalized yet but significantly > simplify the driver code. The upper layers of the stack adhere > to this assumption as well. We leave enough leading space in the > mbufs to prepend all registered (max_linkhdr) encapsulations. > There may be misbehaving packet transformations that have to be > fixed. Assertion functions have to be provided as well. The new formal assumptions at the stack/driver boundary will be: CSUM_IP: lower and IP header including IP options contiguous in first mbuf ip_sum is zero CSUM_TCP: lower and TCP header including TCP options contiguous in first mbuf pseudo header checksum is valid and present in th_sum CSUM_IP is implied, but should be flagged as well CSUM_UDP: lower and UDP header contiguous in first mbuf pseudo header checksum is valid and present in uh_sum CSUM_IP is implied, but should be flagged as well CSUM_SCTP: lower and SCTP header contiguous in first mbuf CSUM_IP is implied, but should be flagged as well CSUM_TSO: lower and TCP header including TCP options contiguous in first mbuf pseudo header checksum is valid and present in th_sum CSUM_IP and CSUM_TCP is implied, but should be flagged as well no TSO flag when no TCP segmentation is required (m_pkthdr.len <= mss + tcpiphdr) no IP options present As I said the standard upper layers already behave like this. The step now is to formalize and assert/enforce this. Enforcement is done by returning an error for a misbehaving packet w/o trying to fix it up. If you have any comments, please speak up. -- Andre