From owner-freebsd-arm@FreeBSD.ORG Tue Aug 27 13:42:03 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75C0F35E; Tue, 27 Aug 2013 13:42:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x22e.google.com (mail-qe0-x22e.google.com [IPv6:2607:f8b0:400d:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24A932864; Tue, 27 Aug 2013 13:42:03 +0000 (UTC) Received: by mail-qe0-f46.google.com with SMTP id f6so2583243qej.33 for ; Tue, 27 Aug 2013 06:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/+4a0OFjliKStnSESC/XK34n5oI3yVG5CagQFYYYgWQ=; b=TbL7Q4vvxSLgyI1mzOUvjhpdB+9ocO3ZyHts9oGG8u+Il5ZNdU12jMFKzmmvcoiTod 3Z6ixhaZtV/2HAV8UTVsLy9c7uSSgxk/Ov9ufLBIEvlXoXD0oaEIFEx5SwtNkGpbB741 4qo/GWmwmEvfpoVPjxW4zN9DdWlbmKXN4zZVtTdJllDWrFdfNw778wWAf2JFcoNyro1T NzZnSO05u1+ZBVeKUuzpgsSUUvQjtFGUCGJFVCVbxFYlFGKbznEkbaIB2xO5YLTpV2Nw xC7mmphFxnD99n2E80IDLfqND2xaBSnev5dHNGe3ZEv+wdH/kJXiE2t3rf/9Xv9NVgy7 wUzg== MIME-Version: 1.0 X-Received: by 10.49.62.3 with SMTP id u3mr23328995qer.6.1377610922269; Tue, 27 Aug 2013 06:42:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.128.70 with HTTP; Tue, 27 Aug 2013 06:42:02 -0700 (PDT) In-Reply-To: <40769440-B167-4817-9855-1CAB09081AF8@bsdimp.com> References: <1377550636.1111.156.camel@revolution.hippie.lan> <521BC472.7040804@freebsd.org> <521BD531.4090104@sbcglobal.net> <521C4CD9.4050308@freebsd.org> <40769440-B167-4817-9855-1CAB09081AF8@bsdimp.com> Date: Tue, 27 Aug 2013 06:42:02 -0700 X-Google-Sender-Auth: rW7h-mQgg__S0bm7l79VMPHxJmY Message-ID: Subject: Re: ARM network trouble after recent mbuf changes From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-arm , Andre Oppermann X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2013 13:42:03 -0000 +1 -adrian On 27 August 2013 06:24, Warner Losh wrote: > > On Aug 27, 2013, at 12:53 AM, Andre Oppermann wrote: > > > On 27.08.2013 00:22, Thomas Skibo 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. > > > > The problem is the disconnect between the definition of MLEN and MHLEN > and > > the effective size/padding of struct mbuf. That's the true bug. > > > > On LP64 all is fine. On i386 it turns out to be fine too because doesn't > > care. > > > > MLEN and MHLEN are incorrectly derived. In fact they should be derived > from > > stuct mbuf where this padding would be taking into account. However the > way > > it is structured right now it that would create a circular dependency. > > > > Please try the patch below to confirm. If it fixes your problem for now > > I'm going to commit as an immediate fix while searching for a better long > > term stable solution. > > > > -- > > Andre > > > > Index: sys/mbuf.h > > =================================================================== > > --- sys/mbuf.h (revision 254953) > > +++ sys/mbuf.h (working copy) > > @@ -94,6 +94,9 @@ > > 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 */ > > +#if defined(__ILP32__) > > + uint32_t mh_pad; /* pad to 64 bit alignment */ > > +#endif > > }; > > > > /* > > There should be a CTASSERT() here to make sure there's no mismatch... > > Warner > _______________________________________________ > 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" >