netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Stanislav Fomichev <sdf@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>
Subject: Re: [PATCH bpf 0/5] bpf: allow wide (u64) aligned loads for some fields of bpf_sock_addr
Date: Mon, 15 Jul 2019 19:57:04 +0000	[thread overview]
Message-ID: <8a8995ec-f211-0e01-cd3c-972a8d237c5f@fb.com> (raw)
In-Reply-To: <20190715163956.204061-1-sdf@google.com>



On 7/15/19 9:39 AM, Stanislav Fomichev wrote:
> When fixing selftests by adding support for wide stores, Yonghong
> reported that he had seen some examples where clang generates
> single u64 loads for two adjacent u32s as well:
> http://lore.kernel.org/netdev/a66c937f-94c0-eaf8-5b37-8587d66c0c62@fb.com
> 
> Let's support aligned u64 reads for some bpf_sock_addr fields
> as well.
> 
> (This can probably wait for bpf-next, I'll defer to Younhong and the
> maintainers.)
> 
> Cc: Yonghong Song <yhs@fb.com>
> 
> Stanislav Fomichev (5):
>    bpf: rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_ok
>    bpf: allow wide aligned loads for bpf_sock_addr user_ip6 and
>      msg_src_ip6
>    selftests/bpf: rename verifier/wide_store.c to verifier/wide_access.c
>    selftests/bpf: add selftests for wide loads
>    bpf: sync bpf.h to tools/

Thanks for fixing. Maybe getting into bpf is better as this indeed
a potential issue? I do not have strong feeling either as the
issue can be easily workarounded with "volatile" tricks.

Acked-by: Yonghong Song <yhs@fb.com>

> 
>   include/linux/filter.h                        |  2 +-
>   include/uapi/linux/bpf.h                      |  4 +-
>   net/core/filter.c                             | 24 ++++--
>   tools/include/uapi/linux/bpf.h                |  4 +-
>   .../selftests/bpf/verifier/wide_access.c      | 73 +++++++++++++++++++
>   .../selftests/bpf/verifier/wide_store.c       | 36 ---------
>   6 files changed, 95 insertions(+), 48 deletions(-)
>   create mode 100644 tools/testing/selftests/bpf/verifier/wide_access.c
>   delete mode 100644 tools/testing/selftests/bpf/verifier/wide_store.c
> 

  parent reply	other threads:[~2019-07-15 19:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 16:39 [PATCH bpf 0/5] bpf: allow wide (u64) aligned loads for some fields of bpf_sock_addr Stanislav Fomichev
2019-07-15 16:39 ` [PATCH bpf 1/5] bpf: rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_ok Stanislav Fomichev
2019-07-15 16:39 ` [PATCH bpf 2/5] bpf: allow wide aligned loads for bpf_sock_addr user_ip6 and msg_src_ip6 Stanislav Fomichev
2019-07-15 16:39 ` [PATCH bpf 3/5] selftests/bpf: rename verifier/wide_store.c to verifier/wide_access.c Stanislav Fomichev
2019-07-15 16:39 ` [PATCH bpf 4/5] selftests/bpf: add selftests for wide loads Stanislav Fomichev
2019-07-15 16:39 ` [PATCH bpf 5/5] bpf: sync bpf.h to tools/ Stanislav Fomichev
2019-07-15 17:16 ` [PATCH bpf 0/5] bpf: allow wide (u64) aligned loads for some fields of bpf_sock_addr Andrii Nakryiko
2019-07-15 19:57 ` Yonghong Song [this message]
2019-07-15 22:21 ` Daniel Borkmann

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=8a8995ec-f211-0e01-cd3c-972a8d237c5f@fb.com \
    --to=yhs@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.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).