public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Stanislav Fomichev <sdf@google.com>
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org,
	bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 3/4] selftests/bpf: Correctly handle optlen > 4096
Date: Fri, 5 May 2023 14:49:03 -0700	[thread overview]
Message-ID: <552cd8ad-e04d-5c96-2b90-36f765bb3298@linux.dev> (raw)
In-Reply-To: <20230504184349.3632259-4-sdf@google.com>

On 5/4/23 11:43 AM, Stanislav Fomichev wrote:
> @@ -298,9 +253,8 @@ static int run_setsockopt_test(struct bpf_object *obj, int cg_parent,
>   void test_sockopt_multi(void)
>   {
>   	int cg_parent = -1, cg_child = -1;
> -	struct bpf_object *obj = NULL;
> +	struct sockopt_multi *obj = NULL;
>   	int sock_fd = -1;
> -	int err = -1;
>   
>   	cg_parent = test__join_cgroup("/parent");
>   	if (!ASSERT_GE(cg_parent, 0, "join_cgroup /parent"))
> @@ -310,13 +264,11 @@ void test_sockopt_multi(void)
>   	if (!ASSERT_GE(cg_child, 0, "join_cgroup /parent/child"))
>   		goto out;
>   
> -	obj = bpf_object__open_file("sockopt_multi.bpf.o", NULL);
> -	if (!ASSERT_OK_PTR(obj, "obj_load"))
> -		goto out;
> +	obj = sockopt_multi__open_and_load();
> +	if (!ASSERT_OK_PTR(obj, "skel-load"))
> +		return;

goto out;

>   
> -	err = bpf_object__load(obj);
> -	if (!ASSERT_OK(err, "obj_load"))
> -		goto out;
> +	obj->bss->page_size = sysconf(_SC_PAGESIZE);
>   
>   	sock_fd = socket(AF_INET, SOCK_STREAM, 0);
>   	if (!ASSERT_GE(sock_fd, 0, "socket"))
> @@ -327,7 +279,7 @@ void test_sockopt_multi(void)
>   
>   out:
>   	close(sock_fd);
> -	bpf_object__close(obj);
> +	sockopt_multi__destroy(obj);
>   	close(cg_child);
>   	close(cg_parent);
>   }


  reply	other threads:[~2023-05-05 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 18:43 [PATCH bpf-next v4 0/4] bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen Stanislav Fomichev
2023-05-04 18:43 ` [PATCH bpf-next v4 1/4] " Stanislav Fomichev
2023-05-04 18:43 ` [PATCH bpf-next v4 2/4] selftests/bpf: Update EFAULT {g,s}etsockopt selftests Stanislav Fomichev
2023-05-05 21:47   ` Martin KaFai Lau
2023-05-04 18:43 ` [PATCH bpf-next v4 3/4] selftests/bpf: Correctly handle optlen > 4096 Stanislav Fomichev
2023-05-05 21:49   ` Martin KaFai Lau [this message]
2023-05-04 18:43 ` [PATCH bpf-next v4 4/4] bpf: Document EFAULT changes for sockopt Stanislav Fomichev
2023-05-05 22:00 ` [PATCH bpf-next v4 0/4] bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen Martin KaFai Lau
2023-05-05 22:04   ` Stanislav Fomichev

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=552cd8ad-e04d-5c96-2b90-36f765bb3298@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.com \
    /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