bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, Cong Wang <cong.wang@bytedance.com>,
	Yucong Sun <sunyucong@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	Lorenz Bauer <lmb@cloudflare.com>
Subject: Re: [Patch bpf v2 3/4] net: implement ->sock_is_readable for UDP and AF_UNIX
Date: Fri, 1 Oct 2021 17:00:39 -0700	[thread overview]
Message-ID: <CAM_iQpUj7h0L7xE=CY0zHTJ=VzJ-Cmy6foJQvvpTv1aixLwY6Q@mail.gmail.com> (raw)
In-Reply-To: <61562fa0b3f74_6c4e4208c1@john-XPS-13-9370.notmuch>

On Thu, Sep 30, 2021 at 2:44 PM John Fastabend <john.fastabend@gmail.com> wrote:
> > +bool sk_msg_is_readable(struct sock *sk)
> > +{
> > +     struct sk_psock *psock;
> > +     bool empty = true;
> > +
> > +     psock = sk_psock_get_checked(sk);
>
> We shouldn't need the checked version here right? We only get here because
> we hooked the sk with the callbacks from *_bpf_rebuild_rpotos. Then we
> can just use sk_psock() and save a few extra insns/branch.

Good catch! Indeed only sockmap overwrites that hook.

I will send V3 shortly after all tests are done.

Thanks

  reply	other threads:[~2021-10-02  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  0:22 [Patch bpf v2 0/4] sock_map: fix ->poll() and update selftests Cong Wang
2021-09-28  0:22 ` [Patch bpf v2 1/4] skmsg: introduce sk_psock_get_checked() Cong Wang
2021-09-28  0:22 ` [Patch bpf v2 2/4] net: rename ->stream_memory_read to ->sock_is_readable Cong Wang
2021-09-28  0:22 ` [Patch bpf v2 3/4] net: implement ->sock_is_readable for UDP and AF_UNIX Cong Wang
2021-09-30 21:44   ` John Fastabend
2021-10-02  0:00     ` Cong Wang [this message]
2021-09-28  0:22 ` [Patch bpf v2 4/4] selftests/bpf: use recv_timeout() instead of retries Cong Wang

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='CAM_iQpUj7h0L7xE=CY0zHTJ=VzJ-Cmy6foJQvvpTv1aixLwY6Q@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=cong.wang@bytedance.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=lmb@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sunyucong@gmail.com \
    --subject='Re: [Patch bpf v2 3/4] net: implement ->sock_is_readable for UDP and AF_UNIX' \
    /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

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).