netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: peppe.cavallaro@st.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: fix unaligned memory accesses in ASIX
Date: Thu, 26 Mar 2009 02:00:18 -0700 (PDT)	[thread overview]
Message-ID: <20090326.020018.26561577.davem@davemloft.net> (raw)
In-Reply-To: <49CB3F6D.2010508@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Thu, 26 Mar 2009 09:40:13 +0100

> Unfortunately, unaligned memory accesses seems to depend on the Asix HW
> that packs several incoming frames.
> So when these frames are 'unpacked' within the fix-up function, and
> pushed to the upper layer, they can have a wrong alignment, indeed.
> When no frame is packed all works fine and the IP never works with
> unaligned addresses.
> I think, the skb_reserve could actually help us, if this last scenario
> generated misaligned accesses.
> Please let me know if I'm missing something.

The unpacker is taking a set of packet(s) in a USB buffer
and copying them into SKB's right?  That code should be where
the offset is checked in the child driver, and adjustments
made as-needed.

This code seems to call the downstream driver callback after
the damage is done.  I think it needs to ask the driver to
look for and indicate the offset before the building of the
SKB is performed.

  reply	other threads:[~2009-03-26  9:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26  6:52 [PATCH] net: fix unaligned memory accesses in ASIX Giuseppe CAVALLARO
2009-03-26  8:08 ` David Miller
2009-03-26  8:40   ` Giuseppe CAVALLARO
2009-03-26  9:00     ` David Miller [this message]
2009-03-26 10:01       ` Giuseppe CAVALLARO
2009-04-15 10:14         ` David Miller

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=20090326.020018.26561577.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).