All of lore.kernel.org
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mm: define NET_IP_ALIGN to 0
Date: Wed, 28 Nov 2018 12:58:54 +0100	[thread overview]
Message-ID: <CAKv+Gu8nVmzT-XWr-EASOdrmqN3VmacapqLqPhK0q-cNAKkhZA@mail.gmail.com> (raw)
In-Reply-To: <20181128150225.8D30.4A936039@socionext.com>

Hello Kunihiko,

On Wed, 28 Nov 2018 at 07:02, Kunihiko Hayashi
<hayashi.kunihiko@socionext.com> wrote:
>
> Hi Ard,
>
> I found that arm64 board that had AVE controller couldn't receive
> any packets after this change.
>
> AVE controller (hardware) forces to ignore lower 2bits of buffer start address,
> that is, the address is always aligned with 4bytes.
> And more, the controller puts received datas with "2byte headroom" [1].
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/socionext/sni_ave.c#n591
>
> In case that NET_IP_ALIGN is 2, the driver proceeds skb->data by 2byte
> with calling netdev_alloc_skb_ip_align(), and then, skb->data is equivalent
> to start address of data reception.
>
>     +0x00 00  buffer start address
>     +0x01 00
>     +0x02 XX  skb->data == start address of data reception
>     +0x03 XX
>     ...
>
> However, in case that NET_IP_ALIGN is zero, skb->data is the same address
> as buffer start address, so skb->data differs from start address of data
> reception. Finally the driver can't receive any packets collectly.
>
>     +0x00 00  skb->data == buffer start address
>     +0x01 00
>     +0x02 XX  start address of data reception
>     +0x03 XX
>     ...
>
> Although I might be able to replace NET_IP_ALIGN with an own macro
> without calling netdev_alloc_skb_ip_align(), it seems clumsy.
> Is that any ideas?
>

If your hardware assumes NET_IP_ALIGN == 2, then yes, I suggest you
introduce your own macros here instead.

  reply	other threads:[~2018-11-28 11:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 17:10 [PATCH] arm64: mm: define NET_IP_ALIGN to 0 Ard Biesheuvel
2018-11-07 18:10 ` Mark Rutland
2018-11-07 23:18   ` Ard Biesheuvel
2018-11-08 10:06     ` Mark Rutland
2018-11-08 10:34       ` Ard Biesheuvel
2018-11-07 21:14 ` Will Deacon
2018-11-08 12:22 ` Ilias Apalodimas
2018-11-08 17:51 ` Catalin Marinas
2018-11-28  6:02 ` Kunihiko Hayashi
2018-11-28 11:58   ` Ard Biesheuvel [this message]
2018-11-29  1:50     ` Kunihiko Hayashi
2018-11-28 12:04   ` Will Deacon
2018-11-29  1:51     ` Kunihiko Hayashi

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=CAKv+Gu8nVmzT-XWr-EASOdrmqN3VmacapqLqPhK0q-cNAKkhZA@mail.gmail.com \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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.