Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2013 00:38:35 +0200
From:      Michael Tuexen <tuexen@freebsd.org>
To:        Thomas Skibo <ThomasSkibo@sbcglobal.net>
Cc:        freebsd-arm <freebsd-arm@FreeBSD.org>, Andre Oppermann <andre@freebsd.org>
Subject:   Re: ARM network trouble after recent mbuf changes
Message-ID:  <FF0E227A-0E15-4AFB-9BA0-E0E903D953F9@freebsd.org>
In-Reply-To: <521BD531.4090104@sbcglobal.net>
References:  <1377550636.1111.156.camel@revolution.hippie.lan> <521BC472.7040804@freebsd.org> <521BD531.4090104@sbcglobal.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@sbcglobal.net> =
wrote:

>=20
>=20
> On 8/26/13 2:11 PM, Andre Oppermann wrote:
>>=20
>> Can you try this patch see check if it makes a difference on the =
bitfield?
>>=20
>=20
> 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.
>=20
>=20
> --Thomas
>=20
> root@ashbury:/usr/src/sys/sys # svn diff mbuf.h
> Index: mbuf.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- 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;
>=20
> /*
>  * 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;
>=20
> /*
>  * 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
>=20
>=20
> --=20
> --------
> Thomas Skibo
> ThomasSkibo@sbcglobal.net
>=20
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FF0E227A-0E15-4AFB-9BA0-E0E903D953F9>