net/sfc: implement EF100 native Rx
[dpdk.git] / drivers / net / sfc / sfc_ef100.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2019-2020 Xilinx, Inc.
4  * Copyright(c) 2018-2019 Solarflare Communications Inc.
5  *
6  * This software was jointly developed between OKTET Labs (under contract
7  * for Solarflare) and Solarflare Communications, Inc.
8  */
9
10 #ifndef _SFC_EF100_H
11 #define _SFC_EF100_H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 static inline bool
18 sfc_ef100_ev_present(const efx_qword_t *ev, bool phase_bit)
19 {
20         return !((ev->eq_u64[0] &
21                   EFX_INPLACE_MASK64(0, 63, ESF_GZ_EV_EVQ_PHASE)) ^
22                  ((uint64_t)phase_bit << ESF_GZ_EV_EVQ_PHASE_LBN));
23 }
24
25 static inline bool
26 sfc_ef100_ev_type_is(const efx_qword_t *ev, unsigned int type)
27 {
28         return (ev->eq_u64[0] & EFX_INPLACE_MASK64(0, 63, ESF_GZ_E_TYPE)) ==
29                 EFX_INSERT_FIELD64(0, 63, ESF_GZ_E_TYPE, type);
30 }
31
32 #ifdef __cplusplus
33 }
34 #endif
35 #endif /* _SFC_EF100_H */