Netdev List
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Takshak Chahande <ctakshak@fb.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, kernel-team@fb.com,
	ndixit@fb.com, kafai@fb.com, andriin@fb.com
Subject: Re: [PATCH v2 bpf-next 2/2] selftests/bpf: handle batch operations for map-in-map bpf-maps
Date: Sat, 23 Apr 2022 00:43:15 +0200	[thread overview]
Message-ID: <015a8abe-9f6e-d3e8-e1c6-e618f8535109@iogearbox.net> (raw)
In-Reply-To: <20220422005044.4099919-2-ctakshak@fb.com>

On 4/22/22 2:50 AM, Takshak Chahande wrote:
[...]
> +static void fetch_and_validate(int outer_map_fd,
> +			       __u32 *inner_map_fds,
> +			       struct bpf_map_batch_opts *opts,
> +			       __u32 batch_size, bool delete_entries)
> +{
> +	__u32 *fetched_keys, *fetched_values, fetched_entries = 0;
> +	__u32 next_batch_key = 0, step_size = 5;
> +	int err, retries = 0, max_retries = 3;
> +	__u32 value_size = sizeof(__u32);
> +
> +	fetched_keys = calloc(batch_size, value_size);
> +	fetched_values = calloc(batch_size, value_size);
> +
> +	while (fetched_entries < batch_size) {
> +		err = delete_entries
> +		      ? bpf_map_lookup_and_delete_batch(outer_map_fd,
> +				      fetched_entries ? &next_batch_key : NULL,
> +				      &next_batch_key,
> +				      fetched_keys + fetched_entries,
> +				      fetched_values + fetched_entries,
> +				      &step_size, opts)
> +		      : bpf_map_lookup_batch(outer_map_fd,
> +				      fetched_entries ? &next_batch_key : NULL,
> +				      &next_batch_key,
> +				      fetched_keys + fetched_entries,
> +				      fetched_values + fetched_entries,
> +				      &step_size, opts);
> +		CHECK((err < 0 && (errno != ENOENT && errno != ENOSPC)),
> +		      "lookup with steps failed",
> +		      "error: %s\n", strerror(errno));
> +
> +		fetched_entries += step_size;
> +		/* retry for max_retries if ENOSPC */
> +		if (errno == ENOSPC)
> +			++retries;
> +
> +		if (retries >= max_retries)
> +			break;
> +	}
> +
> +	CHECK((fetched_entries != batch_size && err != ENOSPC),
> +	      "Unable to fetch expected entries !",
> +	      "fetched_entries(%d) and batch_size(%d) error: (%d):%s\n",
> +	      fetched_entries, batch_size, errno, strerror(errno));
> +
Looks like BPF CI in test_maps trips right here:

   [...]
   test_lpm_trie_map_batch_ops:PASS
   batch_op is successful for batch_size(5)
   batch_op is successful for batch_size(10)
   test_map_in_map_batch_ops_array:PASS with inner ARRAY map
   batch_op is successful for batch_size(5)
   batch_op is successful for batch_size(10)
   test_map_in_map_batch_ops_array:PASS with inner HASH map
   fetch_and_validate(158):FAIL:Unable to fetch expected entries ! fetched_entries(8) and batch_size(5) error: (2):No such file or directory
test_verifier - Testing test_verifier
collect_status - Collect status
shutdown - Shutdown
Test Results:
              bpftool: PASS
           test_progs: PASS
  test_progs-no_alu32: PASS
            test_maps: FAIL (returned 255)
        test_verifier: PASS
             shutdown: CLEAN
Error: Process completed with exit code 1.

      reply	other threads:[~2022-04-22 23:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  0:50 [PATCH v2 bpf-next 1/2] bpf: Extend batch operations for map-in-map bpf-maps Takshak Chahande
2022-04-22  0:50 ` [PATCH v2 bpf-next 2/2] selftests/bpf: handle " Takshak Chahande
2022-04-22 22:43   ` Daniel Borkmann [this message]

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=015a8abe-9f6e-d3e8-e1c6-e618f8535109@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=ctakshak@fb.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=ndixit@fb.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