Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Nov 2012 12:57:58 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r243225 - user/andre/tcp_workqueue/sys/sys
Message-ID:  <201211181257.qAICvwTD028397@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Sun Nov 18 12:57:58 2012
New Revision: 243225
URL: http://svnweb.freebsd.org/changeset/base/243225

Log:
  Extend the checksum offload fields in the mbuf packet header
  with layer 2-4 header length indicators for the current packet.
  It is only valid on the down/outbound path with the corresponding
  csum flags specified.
  
  The header length indicators are 8-bit wide and can specify a
  length of at most 256 bytes per header which is deemed sufficient.
  
  The header length indicators are unionized with the csum_data
  field.
  
  This simplifies setup of the offload DMA desriptors in the
  drivers considerably as they don't have to parse the packet
  anymore.
  
  Adjustments to Ethernet/IP/IPv6/UDP/TCP/SCTP to correctly set
  and update the header length indicators to follow.

Modified:
  user/andre/tcp_workqueue/sys/sys/mbuf.h

Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h
==============================================================================
--- user/andre/tcp_workqueue/sys/sys/mbuf.h	Sun Nov 18 12:57:32 2012	(r243224)
+++ user/andre/tcp_workqueue/sys/sys/mbuf.h	Sun Nov 18 12:57:58 2012	(r243225)
@@ -120,9 +120,17 @@ struct pkthdr {
 	uint32_t	 flowid;	/* packet's 4-tuple system
 					 * flow identifier
 					 */
-	/* variables for hardware checksum */
-	int		 csum_flags;	/* flags regarding checksum */
-	int		 csum_data;	/* data field used by csum routines */
+	/* Variables for various hardware offload features.		*/
+	int		 csum_flags;	/* flags regarding checksum	*/
+	union {
+		int	 cd_data;	/* data field for csum routines	*/
+		struct {
+			uint8_t	l2hlen;	/* layer 2 header length	*/
+			uint8_t	l3hlen;	/* layer 3 header length	*/
+			uint8_t	l4hlen;	/* layer 4 header length	*/
+			uint8_t	unused; /* unused			*/
+		} PHCD_hdr;
+	} PH_cd;
 	u_int16_t	 tso_segsz;	/* TSO segment size */
 	union {
 		u_int16_t vt_vtag;	/* Ethernet 802.1p+q vlan tag */
@@ -130,6 +138,10 @@ struct pkthdr {
 	} PH_vt;
 	SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
 };
+#define	csum_data	PH_cd.cd_data
+#define	csum_l2hlen	PH_cd.PHCD_hdr.l2hlen
+#define	csum_l3hlen	PH_cd.PHCD_hdr.l3hlen
+#define	csum_l4hlen	PH_cd.PHCD_hdr.l4hlen
 #define ether_vtag	PH_vt.vt_vtag
 
 /*



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