All of lore.kernel.org
 help / color / mirror / Atom feed
* [bpf PATCH 0/3] bpf sockmap fixes
@ 2018-01-26  0:26 John Fastabend
  2018-01-26  0:27 ` [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment John Fastabend
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: John Fastabend @ 2018-01-26  0:26 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.
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(-)

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [bpf PATCH 0/3] bpf sockmap fixes John Fastabend

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.