BPF List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: netdev@vger.kernel.org, jakub@cloudflare.com
Cc: john.fastabend@gmail.com, bpf@vger.kernel.org
Subject: [PATCH bpf-next 0/4] transition sockmap testing to test_progs
Date: Tue, 23 Jan 2024 14:36:08 -0800	[thread overview]
Message-ID: <20240123223612.1015788-1-john.fastabend@gmail.com> (raw)

Its much easier to write and read tests than it was when sockmap was
originally created. At that time we created a test_sockmap prog that
did sockmap tests. But, its showing its age now. For example it reads
user vars out of maps, is hard to run targetted tests, has a different
format from the familiar test_progs and so on.

I recently thought there was an issue with pop helpers so I created
some tests to try and track it down. It turns out it was a bug in the
BPF program we had not the kernel. But, I think it makes sense to
start deprecating test_sockmap and converting these to the nicer
test_progs.

So this is a first round of test_prog tests for sockmap cork and
pop helpers. I'll add push and pull tests shortly. I think its fine,
maybe preferred to review smaller patchsets, to send these
incrementally as I get them created.

Thanks!

John Fastabend (4):
  bpf: Add modern test for sk_msg prog pop msg header
  bpf: sockmap, add a sendmsg test so we can check that path
  bpf: sockmap, add a cork to force buffering of the scatterlist
  bpf: sockmap test cork and pop combined

 .../bpf/prog_tests/sockmap_helpers.h          |  18 +
 .../bpf/prog_tests/sockmap_msg_helpers.c      | 351 ++++++++++++++++++
 .../bpf/progs/test_sockmap_msg_helpers.c      |  67 ++++
 3 files changed, 436 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c

-- 
2.33.0


             reply	other threads:[~2024-01-23 22:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 22:36 John Fastabend [this message]
2024-01-23 22:36 ` [PATCH bpf-next 1/4] bpf: sockmap, add test for sk_msg prog pop msg helper John Fastabend
2024-01-23 22:36 ` [PATCH bpf-next 2/4] bpf: sockmap, add a sendmsg test so we can check that path John Fastabend
2024-01-23 22:36 ` [PATCH bpf-next 3/4] bpf: sockmap, add a cork to force buffering of the scatterlist John Fastabend
2024-01-23 22:36 ` [PATCH bpf-next 4/4] bpf: sockmap test cork and pop combined John Fastabend
2024-01-24  2:35 ` [PATCH bpf-next 0/4] transition sockmap testing to test_progs John Fastabend
2024-01-24 17:45   ` Andrii Nakryiko
2024-01-24 17:52     ` John Fastabend

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=20240123223612.1015788-1-john.fastabend@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=jakub@cloudflare.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