Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Nov 2012 15:43:16 +0100
From:      Andre Oppermann <andre@freebsd.org>
To:        Andre Oppermann <andre@FreeBSD.org>
Cc:        jfv@FreeBSD.org, freebsd-net@freebsd.org, yongari@FreeBSD.org, davidch@FreeBSD.org, freebsd-arch@freebsd.org
Subject:   Re: svn commit: r242473 - user/andre/tcp_workqueue/sys/dev/ixgbe
Message-ID:  <5093DC04.2010902@freebsd.org>
In-Reply-To: <201211021343.qA2DhHHr031786@svn.freebsd.org>
References:  <201211021343.qA2DhHHr031786@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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