public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [bpf-next PATCH v2 0/3] bpf: sockmap fixes
@ 2018-01-26 18:14 John Fastabend
  2018-01-26 18:14 ` [bpf-next PATCH v2 1/3] net: add a UID to use for ULP socket assignment John Fastabend
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Fastabend @ 2018-01-26 18:14 UTC (permalink / raw)
  To: ast, daniel, davejwatson; +Cc: netdev, bhole_prashant_q7

A set of fixes for sockmap to resolve map/prog not being cleaned
up when maps are not cleaned up from the program side.

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.
Dave Watson ran TLS test suite on v1 version of the patches without
the put_module error path change.

v2 changes rebased onto bpf-next with the following small updates

Patch 1/3 Dave Watson pointed out that we should do a module put
in case future users use this with another ULP other than sockmap.
And module_put is a nop when owner = NULL (sockmap case) so no
harm here and code is more robust.

Patch 2/3 Be explicit and set user_visible to false just to avoid
any reader confusion.

---

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 |  165 ++++++++++++++++++++++++++++----------------------
 net/ipv4/tcp_ulp.c   |   57 ++++++++++++++++-
 net/tls/tls_main.c   |    2 +
 4 files changed, 155 insertions(+), 77 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-26 21:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-26 18:14 [bpf-next PATCH v2 0/3] bpf: sockmap fixes John Fastabend
2018-01-26 18:14 ` [bpf-next PATCH v2 1/3] net: add a UID to use for ULP socket assignment John Fastabend
2018-01-26 18:14 ` [bpf-next PATCH v2 2/3] bpf: sockmap, add sock close() hook to remove socks John Fastabend
2018-01-26 21:02   ` John Fastabend
2018-01-26 18:14 ` [bpf-next PATCH v2 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs John Fastabend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox