netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Qingfang DENG <dqfext@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	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 11:16:02 -0700	[thread overview]
Message-ID: <20230531111602.7ecf401b@kernel.org> (raw)
In-Reply-To: <20230531104233.50645-1-dqfext@gmail.com>

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?

  reply	other threads:[~2023-05-31 18:16 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 [this message]
2023-05-31 18:41   ` Eric Dumazet
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=20230531111602.7ecf401b@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --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).