From: John Fastabend <john.fastabend@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, davejwatson@fb.com
Cc: netdev@vger.kernel.org, bhole_prashant_q7@lab.ntt.co.jp
Subject: Re: [bpf PATCH 0/3] bpf sockmap fixes
Date: Thu, 25 Jan 2018 17:06:15 -0800 [thread overview]
Message-ID: <63dc45a7-b80b-f51c-b2b5-791265f282fc@gmail.com> (raw)
In-Reply-To: <20180126002001.23004.45946.stgit@john-Precision-Tower-5810>
On 01/25/2018 04:26 PM, John Fastabend wrote:
> A set of fixes for sockmap to resolve map/prog not being cleaned
> up when maps are not cleaned up from the program side.
>
Well that first sentence is a bit confusing now that I read it again.
Here is a better version,
"
A set of fixes for sockmap to resolve programs referencing sockmaps
and closing without deleting all entries in the map and/or not detaching
BPF programs attached to the map. Both leaving entries in the map and
not detaching programs may result in the map failing to be removed by
BPF infrastructure due to reference counts never reaching zero.
"
> For this we pull in the ULP infrastructure to hook into the close()
> hook of the sock layer. This seemed natural because we have additional
> sockmap features (to add support for TX hooks) that will also use the
> ULP infrastructure. This allows us to cleanup entries in the map when
> socks are closed() and avoid trying to get the sk_state_change() hook
> to fire in all cases.
>
> The second issue resolved here occurs when users don't detach
> programs. The gist is a refcnt issue resolved by implementing the
> release callback. See patch for details.
>
> For testing I ran both sample/sockmap and selftests bpf/test_maps.c.
> I did not however retest TLS with the small change to ULP layer.
> Mostly because I don't have a TLS setup. I plan/hope to get around
> to writing either a sample or preferably a selftest for this case
> as well (assuming I didn't miss one).
>
> @Dave Watson can you take a quick look to verify the changes are
> good on TLS ULP side.
>
> ---
>
> John Fastabend (3):
> net: add a UID to use for ULP socket assignment
> bpf: sockmap, add sock close() hook to remove socks
> bpf: sockmap, fix leaking maps with attached but not detached progs
>
>
> include/net/tcp.h | 8 ++
> kernel/bpf/sockmap.c | 164 ++++++++++++++++++++++++++++----------------------
> net/ipv4/tcp_ulp.c | 53 +++++++++++++++-
> net/tls/tls_main.c | 2 +
> 4 files changed, 150 insertions(+), 77 deletions(-)
>
> --
> Signature
>
prev parent reply other threads:[~2018-01-26 1:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 0:26 [bpf PATCH 0/3] bpf sockmap fixes John Fastabend
2018-01-26 0:27 ` [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment John Fastabend
2018-01-26 15:52 ` Dave Watson
2018-01-26 16:21 ` John Fastabend
2018-01-26 0:27 ` [bpf PATCH 2/3] bpf: sockmap, add sock close() hook to remove socks John Fastabend
2018-01-26 0:27 ` [bpf PATCH 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs John Fastabend
2018-01-26 1:06 ` John Fastabend [this message]
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=63dc45a7-b80b-f51c-b2b5-791265f282fc@gmail.com \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=bhole_prashant_q7@lab.ntt.co.jp \
--cc=daniel@iogearbox.net \
--cc=davejwatson@fb.com \
--cc=netdev@vger.kernel.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).