ARM network trouble after recent mbuf changes

Michael Tuexen tuexen at freebsd.org
Mon Aug 26 22:38:42 UTC 2013


I did some tests with a small program. Having in struct pkthdr 64 bit entities
results in a 64 bit alignment when used in struct mbuf. Using __packed
for struct mbuf, removes the padding.

Best regards
Michael
On Aug 27, 2013, at 12:22 AM, Thomas Skibo <ThomasSkibo at sbcglobal.net> wrote:

> 
> 
> On 8/26/13 2:11 PM, Andre Oppermann wrote:
>> 
>> Can you try this patch see check if it makes a difference on the bitfield?
>> 
> 
> Actually, this works for me.  But, I'm worried that somewhere else something is going to trip over a struct pkthdr not being 64-bit aligned.  There are several 64-bit fields in there.
> 
> 
> --Thomas
> 
> root at ashbury:/usr/src/sys/sys # svn diff mbuf.h
> Index: mbuf.h
> ===================================================================
> --- mbuf.h	(revision 254889)
> +++ mbuf.h	(working copy)
> @@ -94,7 +94,7 @@
> 	int32_t		 mh_len;	/* amount of data in this mbuf */
> 	uint32_t	 mh_type:8,	/* type of data in this mbuf */
> 			 mh_flags:24;	/* flags; see below */
> -};
> +} __packed;
> 
> /*
>  * Packet tag structure (see below for details).
> @@ -169,7 +169,7 @@
> 			    (struct mbuf *, void *, void *);
> 	void		*ext_arg1;	/* optional argument pointer */
> 	void		*ext_arg2;	/* optional argument pointer */
> -};
> +} __packed;
> 
> /*
>  * The core of the mbuf object along with some shortcut defines for practical
> @@ -187,7 +187,7 @@
> 		} MH;
> 		char	M_databuf[MLEN];		/* !M_PKTHDR, !M_EXT */
> 	} M_dat;
> -};
> +} __packed;
> #define	m_next		m_hdr.mh_next
> #define	m_len		m_hdr.mh_len
> 
> 
> -- 
> --------
> Thomas Skibo
> ThomasSkibo at sbcglobal.net
> 
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
> 



More information about the freebsd-arm mailing list