Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/115985 _apply patch failure_ Submitter: Mattias Rönnblom Date: Tuesday, September 06 2022 16:13:52 Applied on: CommitID:4aee6110bb10b0225fa9562f2e48af233a9058a1 Apply patch set 115985-115986 failed: Checking patch lib/eal/common/rte_service.c... error: while searching for: * on currently. */ uint32_t num_mapped_cores; /* 32-bit builds won't naturally align a uint64_t, so force alignment, * allowing regular reads to be atomic. */ uint64_t calls __rte_aligned(8); uint64_t cycles_spent __rte_aligned(8); } __rte_cache_aligned; /* Mask used to ensure uint64_t 8 byte vars are naturally aligned. */ #define RTE_SERVICE_STAT_ALIGN_MASK (8 - 1) /* the internal values of a service core */ struct core_state { /* map of services IDs are run on this core */ error: patch failed: lib/eal/common/rte_service.c:50 Hunk #2 succeeded at 64 (offset 2 lines). Hunk #3 succeeded at 132 (offset 2 lines). Hunk #4 succeeded at 152 (offset 2 lines). Hunk #5 succeeded at 214 (offset 2 lines). Hunk #6 succeeded at 251 (offset 2 lines). error: while searching for: { void *userdata = s->spec.callback_userdata; /* Ensure the atomically stored variables are naturally aligned, * as required for regular loads to be atomic. */ RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, calls) & RTE_SERVICE_STAT_ALIGN_MASK) != 0); RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, cycles_spent) & RTE_SERVICE_STAT_ALIGN_MASK) != 0); if (service_stats_enabled(s)) { uint64_t start = rte_rdtsc(); s->spec.callback(userdata); uint64_t end = rte_rdtsc(); uint64_t cycles = end - start; cs->calls_per_service[service_idx]++; if (service_mt_safe(s)) { __atomic_fetch_add(&s->cycles_spent, cycles, __ATOMIC_RELAXED); __atomic_fetch_add(&s->calls, 1, __ATOMIC_RELAXED); } else { uint64_t cycles_new = s->cycles_spent + cycles; uint64_t calls_new = s->calls++; __atomic_store_n(&s->cycles_spent, cycles_new, __ATOMIC_RELAXED); __atomic_store_n(&s->calls, calls_new, __ATOMIC_RELAXED); } } else s->spec.callback(userdata); } error: patch failed: lib/eal/common/rte_service.c:366 Hunk #8 succeeded at 417 (offset -9 lines). Hunk #9 succeeded at 464 (offset -9 lines). Hunk #10 succeeded at 590 (offset -9 lines). Hunk #11 succeeded at 795 (offset -9 lines). Hunk #12 succeeded at 885 (offset -9 lines). Hunk #13 succeeded at 895 (offset -9 lines). Hunk #14 succeeded at 928 (offset -9 lines). Hunk #15 succeeded at 957 (offset -9 lines). Hunk #16 succeeded at 975 (offset -9 lines). Applying patch lib/eal/common/rte_service.c with 2 rejects... Rejected hunk #1. Hunk #2 applied cleanly. Hunk #3 applied cleanly. Hunk #4 applied cleanly. Hunk #5 applied cleanly. Hunk #6 applied cleanly. Rejected hunk #7. Hunk #8 applied cleanly. Hunk #9 applied cleanly. Hunk #10 applied cleanly. Hunk #11 applied cleanly. Hunk #12 applied cleanly. Hunk #13 applied cleanly. Hunk #14 applied cleanly. Hunk #15 applied cleanly. Hunk #16 applied cleanly. diff a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c (rejected hunks) @@ -50,17 +50,8 @@ struct rte_service_spec_impl { * on currently. */ uint32_t num_mapped_cores; - - /* 32-bit builds won't naturally align a uint64_t, so force alignment, - * allowing regular reads to be atomic. - */ - uint64_t calls __rte_aligned(8); - uint64_t cycles_spent __rte_aligned(8); } __rte_cache_aligned; -/* Mask used to ensure uint64_t 8 byte vars are naturally aligned. */ -#define RTE_SERVICE_STAT_ALIGN_MASK (8 - 1) - /* the internal values of a service core */ struct core_state { /* map of services IDs are run on this core */ @@ -366,29 +361,24 @@ service_runner_do_callback(struct rte_service_spec_impl *s, { void *userdata = s->spec.callback_userdata; - /* Ensure the atomically stored variables are naturally aligned, - * as required for regular loads to be atomic. - */ - RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, calls) - & RTE_SERVICE_STAT_ALIGN_MASK) != 0); - RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, cycles_spent) - & RTE_SERVICE_STAT_ALIGN_MASK) != 0); - if (service_stats_enabled(s)) { uint64_t start = rte_rdtsc(); s->spec.callback(userdata); uint64_t end = rte_rdtsc(); uint64_t cycles = end - start; - cs->calls_per_service[service_idx]++; - if (service_mt_safe(s)) { - __atomic_fetch_add(&s->cycles_spent, cycles, __ATOMIC_RELAXED); - __atomic_fetch_add(&s->calls, 1, __ATOMIC_RELAXED); - } else { - uint64_t cycles_new = s->cycles_spent + cycles; - uint64_t calls_new = s->calls++; - __atomic_store_n(&s->cycles_spent, cycles_new, __ATOMIC_RELAXED); - __atomic_store_n(&s->calls, calls_new, __ATOMIC_RELAXED); - } + + /* The lcore service worker thread is the only writer, + * and thus only a non-atomic load and an atomic store + * is needed, and not the more expensive atomic + * add. + */ + __atomic_store_n(&cs->calls_per_service[service_idx], + cs->calls_per_service[service_idx] + 1, + __ATOMIC_RELAXED); + + __atomic_store_n(&cs->cycles_per_service[service_idx], + cs->cycles_per_service[service_idx] + cycles, + __ATOMIC_RELAXED); } else s->spec.callback(userdata); } Checking patch app/test/test_service_cores.c... Checking patch lib/eal/common/rte_service.c... error: lib/eal/common/rte_service.c: does not match index Checking patch lib/eal/include/rte_service.h... Applied patch app/test/test_service_cores.c cleanly. Applied patch lib/eal/include/rte_service.h cleanly. Checking patch lib/eal/common/rte_service.c... error: lib/eal/common/rte_service.c: does not match index Checking patch lib/eal/common/rte_service.c... error: lib/eal/common/rte_service.c: does not match index Checking patch lib/eal/include/rte_service_component.h... Applied patch lib/eal/include/rte_service_component.h cleanly. Checking patch lib/eal/include/rte_service.h... error: lib/eal/include/rte_service.h: does not match index https://lab.dpdk.org/results/dashboard/patchsets/23427/ UNH-IOL DPDK Community Lab