All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Young <dyoung-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
To: radiotap-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org
Subject: Re: rfc: "canonical" radiotap parser
Date: Mon, 10 Dec 2007 13:18:15 -0600	[thread overview]
Message-ID: <20071210191815.GE3568@che.ojctech.com> (raw)
In-Reply-To: <1197290250.6035.69.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>

On Mon, Dec 10, 2007 at 01:37:30PM +0100, Johannes Berg wrote:
> 
> > I was trying to give the compiler a hint to help it generate better
> > code on architectures, such as ARM, where unaligned loads may take
> > many instructions.
> 
> Well, yes, but who guarantees that it actually *is* aligned that way?
> Radiotap only specifies that the fields are aligned with respect to the
> start of the header, but there's nothing that guarantees alignment of
> that.

The caller of radiotap_parse_first() must supply a 64-bit aligned
ieee80211_radiotap_header in the first argument.  If the header is not
so aligned, then the parse fails right away with RADIOTAP_ERROR_ALIGNMENT.

Really, radiotap_parse_first() should require either 32-bit alignment,
or alignment as great as the maximum alignment of all of the fields that
are present, whichever is greater.

I copy radiotap headers to ensure 64-bit alignment in
main.c:cap_cb().

Dave

-- 
David Young             OJC Technologies
dyoung-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org      Urbana, IL * (217) 278-3933 ext 24

  parent reply	other threads:[~2007-12-10 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-07  4:55 rfc: "canonical" radiotap parser David Young
     [not found] ` <20071207045545.GO3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-08 10:39   ` Johannes Berg
     [not found]     ` <1197110397.4171.46.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-08 21:06       ` David Young
     [not found]         ` <20071208210645.GX3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-10 12:37           ` Johannes Berg
     [not found]             ` <1197290250.6035.69.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-10 19:18               ` David Young [this message]
     [not found]                 ` <20071210191815.GE3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-11 13:32                   ` Johannes Berg
2007-12-11 21:38   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071210191815.GE3568@che.ojctech.com \
    --to=dyoung-e+axbwqsrlaavxtiumwx3w@public.gmane.org \
    --cc=radiotap-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.