diff options
author | bz <bz@FreeBSD.org> | 2012-05-28 09:30:13 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2012-05-28 09:30:13 +0000 |
commit | ac429c704460cebd04cbe8314edf44e51038bc3b (patch) | |
tree | 5f5a5c87a324064ee224e0476ab7846e52c50a3d /sys/sys/mbuf.h | |
parent | 290c33a04ac104b7628b6c70854bccc588532f90 (diff) | |
download | FreeBSD-src-ac429c704460cebd04cbe8314edf44e51038bc3b.zip FreeBSD-src-ac429c704460cebd04cbe8314edf44e51038bc3b.tar.gz |
It turns out that too many drivers are not only parsing the L2/3/4
headers for TSO but also for generic checksum offloading. Ideally we
would only have one common function shared amongst all drivers, and
perhaps when updating them for IPv6 we should introduce that.
Eventually we should provide the meta information along with mbufs to
avoid (re-)parsing entirely.
To not break IPv6 (checksums and offload) and to be able to MFC the
changes without risking to hurt 3rd party drivers, duplicate the v4
framework, as other OSes have done as well.
Introduce interface capability flags for TX/RX checksum offload with
IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6
flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6
fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and
add an alias for CSUM_DATA_VALID_IPV6.
This pretty much brings IPv6 handling in line with IPv4.
TSO is still handled in a different way and not via if_hwassist.
Update ifconfig to allow (un)setting of the new capability flags.
Update loopback to announce the new capabilities and if_hwassist flags.
Individual driver updates will have to follow, as will SCTP.
Reported by: gallatin, dim, ..
Reviewed by: gallatin (glanced at?)
MFC after: 3 days
X-MFC with: r235961,235959,235958
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r-- | sys/sys/mbuf.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 2a6c8aa..679f86e 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -283,15 +283,24 @@ struct mbuf { #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ +/* CSUM_SCTP_IPV6 0x0080 will csum IPv6/SCTP */ #define CSUM_IP_CHECKED 0x0100 /* did csum IP */ #define CSUM_IP_VALID 0x0200 /* ... the csum is valid */ #define CSUM_DATA_VALID 0x0400 /* csum_data field is valid */ #define CSUM_PSEUDO_HDR 0x0800 /* csum_data has pseudo hdr */ #define CSUM_SCTP_VALID 0x1000 /* SCTP checksum is valid */ +#define CSUM_UDP_IPV6 0x2000 /* will csum IPv6/UDP */ +#define CSUM_TCP_IPV6 0x4000 /* will csum IPv6/TCP */ +/* CSUM_TSO_IPV6 0x8000 will do IPv6/TSO */ + +/* CSUM_FRAGMENT_IPV6 0x10000 will do IPv6 fragementation */ + +#define CSUM_DELAY_DATA_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) +#define CSUM_DATA_VALID_IPV6 CSUM_DATA_VALID #define CSUM_DELAY_DATA (CSUM_TCP | CSUM_UDP) -#define CSUM_DELAY_IP (CSUM_IP) /* XXX add ipv6 here too? */ +#define CSUM_DELAY_IP (CSUM_IP) /* Only v4, no v6 IP hdr csum */ /* * mbuf types. |