Skip to content

Commit 09de329

Browse files
mrpreAlexei Starovoitov
authored andcommitted
selftests/bpf: Fixes for test_maps test
BPF CI has failed 3 times in the last 24 hours. Add retry for ENOMEM. It's similar to the optimization plan: commit 2f553b0 ("selftsets/bpf: Retry map update for non-preallocated per-cpu map") Failed CI: https://github.com/kernel-patches/bpf/actions/runs/13549227497/job/37868926343 https://github.com/kernel-patches/bpf/actions/runs/13548089029/job/37865812030 https://github.com/kernel-patches/bpf/actions/runs/13553536268/job/37883329296 selftests/bpf: Fixes for test_maps test Fork 100 tasks to 'test_update_delete' Fork 100 tasks to 'test_update_delete' Fork 100 tasks to 'test_update_delete' Fork 100 tasks to 'test_update_delete' ...... test_task_storage_map_stress_lookup:PASS test_maps: OK, 0 SKIPPED Signed-off-by: Jiayuan Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent dbe7d46 commit 09de329

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/testing/selftests/bpf/test_maps.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,9 +1396,10 @@ static void test_map_stress(void)
13961396
#define MAX_DELAY_US 50000
13971397
#define MIN_DELAY_RANGE_US 5000
13981398

1399-
static bool retry_for_again_or_busy(int err)
1399+
static bool can_retry(int err)
14001400
{
1401-
return (err == EAGAIN || err == EBUSY);
1401+
return (err == EAGAIN || err == EBUSY ||
1402+
(err == ENOMEM && map_opts.map_flags == BPF_F_NO_PREALLOC));
14021403
}
14031404

14041405
int map_update_retriable(int map_fd, const void *key, const void *value, int flags, int attempts,
@@ -1451,12 +1452,12 @@ static void test_update_delete(unsigned int fn, void *data)
14511452

14521453
if (do_update) {
14531454
err = map_update_retriable(fd, &key, &value, BPF_NOEXIST, MAP_RETRIES,
1454-
retry_for_again_or_busy);
1455+
can_retry);
14551456
if (err)
14561457
printf("error %d %d\n", err, errno);
14571458
assert(err == 0);
14581459
err = map_update_retriable(fd, &key, &value, BPF_EXIST, MAP_RETRIES,
1459-
retry_for_again_or_busy);
1460+
can_retry);
14601461
if (err)
14611462
printf("error %d %d\n", err, errno);
14621463
assert(err == 0);

0 commit comments

Comments
 (0)