Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / net / ethernet / netronome / nfp / nic / main.h
blob38b8b10b03cd3b5c94a52925751e3171a5601a7e
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2023 Corigine, Inc. */
4 #ifndef __NFP_NIC_H__
5 #define __NFP_NIC_H__ 1
7 #include <linux/netdevice.h>
9 #ifdef CONFIG_DCB
10 /* DCB feature definitions */
11 #define NFP_NET_MAX_DSCP 64
12 #define NFP_NET_MAX_TC IEEE_8021QAZ_MAX_TCS
13 #define NFP_NET_MAX_PRIO 8
14 #define NFP_DCB_CFG_STRIDE 256
16 struct nfp_dcb {
17 u8 dscp2prio[NFP_NET_MAX_DSCP];
18 u8 prio2tc[NFP_NET_MAX_PRIO];
19 u8 tc2idx[IEEE_8021QAZ_MAX_TCS];
20 u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
21 u8 tc_tx_pct[IEEE_8021QAZ_MAX_TCS];
22 u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
23 u8 dscp_cnt;
24 u8 trust_status;
25 bool rate_init;
26 bool ets_init;
28 struct nfp_cpp_area *dcbcfg_tbl_area;
29 u8 __iomem *dcbcfg_tbl;
30 u32 cfg_offset;
33 int nfp_nic_dcb_init(struct nfp_net *nn);
34 void nfp_nic_dcb_clean(struct nfp_net *nn);
35 #else
36 static inline int nfp_nic_dcb_init(struct nfp_net *nn) { return 0; }
37 static inline void nfp_nic_dcb_clean(struct nfp_net *nn) {}
38 #endif
40 struct nfp_app_nic_private {
41 #ifdef CONFIG_DCB
42 struct nfp_dcb dcb;
43 #endif
46 #endif