netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/3] bpf: tcp: Add bpf_cubic example
@ 2020-01-22  6:41 Martin KaFai Lau
  2020-01-22  6:41 ` [PATCH v2 bpf-next 1/3] bpf: Add BPF_FUNC_jiffies64 Martin KaFai Lau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Martin KaFai Lau @ 2020-01-22  6:41 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, David Miller, Eric Dumazet,
	kernel-team, netdev

This set adds bpf_cubic.c example.  It was separated from the
earlier BPF STRUCT_OPS series.  Some highlights since the
last post:

1. It is based on EricD recent fixes to the kernel tcp_cubic. [1]
2. The bpf jiffies reading helper is inlined by the verifier.
   Different from the earlier version, it only reads jiffies alone
   and does not do usecs/jiffies conversion.
3. The bpf .kconfig map is used to read CONFIG_HZ.

[1]: https://patchwork.ozlabs.org/cover/1215066/

v2:
- Move inlining to fixup_bpf_calls() in patch 1. (Daniel)
- It is inlined for 64 BITS_PER_LONG and jit_requested
  as the map_gen_lookup().  Other cases could be
  considered together with map_gen_lookup() if needed.
- Use usec resolution in bictcp_update() calculation in patch 3.
  usecs_to_jiffies() is then removed().  (Eric)

Martin KaFai Lau (3):
  bpf: Add BPF_FUNC_jiffies64
  bpf: Sync uapi bpf.h to tools/
  bpf: tcp: Add bpf_cubic example

 include/linux/bpf.h                           |   1 +
 include/uapi/linux/bpf.h                      |   9 +-
 kernel/bpf/core.c                             |   1 +
 kernel/bpf/helpers.c                          |  12 +
 kernel/bpf/verifier.c                         |  24 +
 net/core/filter.c                             |   2 +
 tools/include/uapi/linux/bpf.h                |   9 +-
 tools/testing/selftests/bpf/bpf_tcp_helpers.h |  16 +
 .../selftests/bpf/prog_tests/bpf_tcp_ca.c     |  25 +
 tools/testing/selftests/bpf/progs/bpf_cubic.c | 544 ++++++++++++++++++
 10 files changed, 641 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_cubic.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH bpf-next 0/2] bpf: Add sock ops get netns helpers
@ 2020-02-06  8:35 Lingpeng Chen
  2020-02-18  9:15 ` [PATCH v2 bpf-next 0/3] bpf: Add sock_ops_get_netns helpers Lingpeng Chen
  0 siblings, 1 reply; 7+ messages in thread
From: Lingpeng Chen @ 2020-02-06  8:35 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
	David S . Miller, netdev, Lingpeng Chen

Currently 5-tuple(sip+dip+sport+dport+proto) can't identify a
uniq connection because there may be multi net namespace.
For example, there may be a chance that netns a and netns b all
listen on 127.0.0.1:8080 and the client with same port 40782
connect to them. Without netns number, sock ops program
can't distinguish them.
Using bpf_sock_ops_get_netns helpers to get current connection
netns number to distinguish connections.

Lingpeng Chen (2):
  bpf: Add sock ops get netns helpers
  bpf: Sync uapi bpf.h to tools/

 include/uapi/linux/bpf.h       |  8 +++++++-
 net/core/filter.c              | 18 ++++++++++++++++++
 tools/include/uapi/linux/bpf.h |  8 +++++++-
 3 files changed, 32 insertions(+), 2 deletions(-)


-- 
2.17.1


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

end of thread, other threads:[~2020-02-18  9:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-22  6:41 [PATCH v2 bpf-next 0/3] bpf: tcp: Add bpf_cubic example Martin KaFai Lau
2020-01-22  6:41 ` [PATCH v2 bpf-next 1/3] bpf: Add BPF_FUNC_jiffies64 Martin KaFai Lau
2020-01-22  6:42 ` [PATCH v2 bpf-next 2/3] bpf: Sync uapi bpf.h to tools/ Martin KaFai Lau
2020-01-22  6:42 ` [PATCH v2 bpf-next 3/3] bpf: tcp: Add bpf_cubic example Martin KaFai Lau
2020-01-22 21:53   ` Andrii Nakryiko
2020-01-22 22:17     ` Martin Lau
  -- strict thread matches above, loose matches on Subject: below --
2020-02-06  8:35 [PATCH bpf-next 0/2] bpf: Add sock ops get netns helpers Lingpeng Chen
2020-02-18  9:15 ` [PATCH v2 bpf-next 0/3] bpf: Add sock_ops_get_netns helpers Lingpeng Chen
2020-02-18  9:15   ` [PATCH v2 bpf-next 2/3] bpf: Sync uapi bpf.h to tools/ Lingpeng Chen

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