netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Qingfang DENG <dqfext@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	 Paolo Abeni <pabeni@redhat.com>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	 Ville Nuorvala <vnuorval@tcs.hut.fi>,
	Masahide NAKAMURA <nakam@linux-ipv6.org>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Qingfang DENG <qingfang.deng@siflower.com.cn>
Subject: Re: [PATCH net] neighbour: fix unaligned access to pneigh_entry
Date: Wed, 31 May 2023 20:41:32 +0200	[thread overview]
Message-ID: <CANn89iKRX2QTgS44Ky6Jua-+UNrFY3E7RCT_7OfG=GnFvAzdFQ@mail.gmail.com> (raw)
In-Reply-To: <20230531111602.7ecf401b@kernel.org>

On Wed, May 31, 2023 at 8:16 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 31 May 2023 18:42:33 +0800 Qingfang DENG wrote:
> > +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
> >       u8                      key[];
> > +#else
> > +     u8                      key[] __aligned(4);
> > +#endif
>
> I'd appreciate a second opinion, but to me it's very unlikely we'd save
> any memory even with efficient aligned access here. No reasonably key
> will fit into 3 bytes, right? So we can as well avoid the ifdef and
> make the key[] always aligned. Or preferably, if it doesn't cause
> compilation issues, make the type of the key u32?

Same feeling, we could avoid the CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS ifdef.

  reply	other threads:[~2023-05-31 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 10:42 [PATCH net] neighbour: fix unaligned access to pneigh_entry Qingfang DENG
2023-05-31 18:16 ` Jakub Kicinski
2023-05-31 18:41   ` Eric Dumazet [this message]
2023-06-01  1:54     ` [PATCH net v2] " Qingfang DENG
2023-06-02  4:50       ` patchwork-bot+netdevbpf

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='CANn89iKRX2QTgS44Ky6Jua-+UNrFY3E7RCT_7OfG=GnFvAzdFQ@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nakam@linux-ipv6.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qingfang.deng@siflower.com.cn \
    --cc=vnuorval@tcs.hut.fi \
    --cc=yoshfuji@linux-ipv6.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 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).