Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(C) 2023 Marvell. 3 : : */ 4 : : 5 : : #include <rte_common.h> 6 : : #include <rte_pmd_cnxk_eventdev.h> 7 : : #include <rte_eventdev.h> 8 : : 9 : : #include "roc_platform.h" 10 : : #include "roc_sso.h" 11 : : #include "roc_sso_dp.h" 12 : : 13 : : struct pwords { 14 : : uint64_t u[5]; 15 : : }; 16 : : 17 : : void 18 : 0 : rte_pmd_cnxk_eventdev_wait_head(uint8_t dev, uint8_t port) 19 : : { 20 : 0 : struct pwords *w = rte_event_fp_ops[dev].data[port]; 21 : : uint8_t vws; 22 : : 23 [ # # ]: 0 : if (w->u[1] & 0x3) { 24 : 0 : roc_sso_hws_head_wait(w->u[0]); 25 : : } else { 26 : : /* Dual WS case */ 27 : 0 : vws = (w->u[4] >> 8) & 0x1; 28 : 0 : roc_sso_hws_head_wait(w->u[vws]); 29 : : } 30 : 0 : } 31 : : 32 : : 33 : : uint8_t 34 : 0 : rte_pmd_cnxk_eventdev_is_head(uint8_t dev, uint8_t port) 35 : : { 36 : 0 : struct pwords *w = rte_event_fp_ops[dev].data[port]; 37 : : uintptr_t base; 38 : : uint8_t vws; 39 : : 40 [ # # ]: 0 : if (w->u[1] & 0x3) { 41 : 0 : base = w->u[0]; 42 : : } else { 43 : : /* Dual WS case */ 44 : 0 : vws = (w->u[4] >> 8) & 0x1; 45 : 0 : base = w->u[vws]; 46 : : } 47 : : 48 : 0 : return roc_sso_hws_is_head(base); 49 : : }