Before issuing the batch alloc, we clear the first word of
cache lines so that NPA can update the status. Make sure that
this line clear is flushed before the batch alloc is issued.
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
return compare;
}
+static __plt_always_inline uint64_t
+roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr)
+{
+ asm volatile(PLT_CPU_FEATURE_PREAMBLE
+ "casl %[compare], %[swap], [%[ptr]]\n"
+ : [compare] "+r"(compare)
+ : [swap] "r"(swap), [ptr] "r"(ptr)
+ : "memory");
+
+ return compare;
+}
+
static __plt_always_inline uint64_t
roc_atomic64_add_nosync(int64_t incr, int64_t *ptr)
{
return compare;
}
+static __plt_always_inline uint64_t
+roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr)
+{
+ PLT_SET_USED(swap);
+ PLT_SET_USED(ptr);
+
+ return compare;
+}
+
static inline uint64_t
roc_atomic64_add_nosync(int64_t incr, int64_t *ptr)
{
cmp.compare_s.dis_wait = dis_wait;
cmp.compare_s.count = num;
- res = roc_atomic64_cas(cmp.u, (uint64_t)buf, addr);
+ res = roc_atomic64_casl(cmp.u, (uint64_t)buf, addr);
if (res != ALLOC_RESULT_ACCEPTED && res != ALLOC_RESULT_NOCORE)
return -1;