X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fcommon%2Focteontx2%2Fotx2_io_arm64.h;h=34268e3af3e302223d88d5234d0ad4ef587c3080;hb=ac6deebb588aea78791d4985a5b85df1879dbc69;hp=468243c042f5f5c93de999eacda411d97135789a;hpb=8a4f835971f5041b86969d150f9e56f49a50375a;p=dpdk.git diff --git a/drivers/common/octeontx2/otx2_io_arm64.h b/drivers/common/octeontx2/otx2_io_arm64.h index 468243c042..34268e3af3 100644 --- a/drivers/common/octeontx2/otx2_io_arm64.h +++ b/drivers/common/octeontx2/otx2_io_arm64.h @@ -14,13 +14,19 @@ #define otx2_store_pair(val0, val1, addr) ({ \ asm volatile( \ - "stp %x[x0], %x[x1], [%x[p1]]" \ + "stp %x[x0], %x[x1], [%x[p1],#0]!" \ ::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \ ); }) #define otx2_prefetch_store_keep(ptr) ({\ asm volatile("prfm pstl1keep, [%x0]\n" : : "r" (ptr)); }) +#if defined(__ARM_FEATURE_SVE) +#define __LSE_PREAMBLE " .cpu generic+lse+sve\n" +#else +#define __LSE_PREAMBLE " .cpu generic+lse\n" +#endif + static __rte_always_inline uint64_t otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr) { @@ -28,7 +34,7 @@ otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr) /* Atomic add with no ordering */ asm volatile ( - ".cpu generic+lse\n" + __LSE_PREAMBLE "ldadd %x[i], %x[r], [%[b]]" : [r] "=r" (result), "+m" (*ptr) : [i] "r" (incr), [b] "r" (ptr) @@ -43,7 +49,7 @@ otx2_atomic64_add_sync(int64_t incr, int64_t *ptr) /* Atomic add with ordering */ asm volatile ( - ".cpu generic+lse\n" + __LSE_PREAMBLE "ldadda %x[i], %x[r], [%[b]]" : [r] "=r" (result), "+m" (*ptr) : [i] "r" (incr), [b] "r" (ptr) @@ -57,12 +63,24 @@ otx2_lmt_submit(rte_iova_t io_address) uint64_t result; asm volatile ( - ".cpu generic+lse\n" + __LSE_PREAMBLE "ldeor xzr,%x[rf],[%[rs]]" : [rf] "=r"(result): [rs] "r"(io_address)); return result; } +static __rte_always_inline uint64_t +otx2_lmt_submit_release(rte_iova_t io_address) +{ + uint64_t result; + + asm volatile ( + __LSE_PREAMBLE + "ldeorl xzr,%x[rf],[%[rs]]" : + [rf] "=r"(result) : [rs] "r"(io_address)); + return result; +} + static __rte_always_inline void otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext) { @@ -92,4 +110,5 @@ otx2_lmt_mov_seg(void *out, const void *in, const uint16_t segdw) dst128[i] = src128[i]; } +#undef __LSE_PREAMBLE #endif /* _OTX2_IO_ARM64_H_ */