xref: /linux/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h (revision fd7d598270724cc787982ea48bbe17ad383a8b7f)
1 /* Broadcom NetXtreme-C/E network driver.
2  *
3  * Copyright (c) 2014-2016 Broadcom Corporation
4  * Copyright (c) 2016-2018 Broadcom Limited
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation.
9  */
10 
11 #ifndef BNXT_DCB_H
12 #define BNXT_DCB_H
13 
14 #include <net/dcbnl.h>
15 
16 struct bnxt_dcb {
17 	u8			max_tc;
18 	struct ieee_pfc		*ieee_pfc;
19 	struct ieee_ets		*ieee_ets;
20 	u8			dcbx_cap;
21 	u8			default_pri;
22 };
23 
24 struct bnxt_cos2bw_cfg {
25 	u8			pad[3];
26 	struct_group_attr(cfg, __packed,
27 		u8		queue_id;
28 		__le32		min_bw;
29 		__le32		max_bw;
30 		u8		tsa;
31 		u8		pri_lvl;
32 		u8		bw_weight;
33 	);
34 /* for min_bw / max_bw */
35 #define BW_VALUE_UNIT_PERCENT1_100		(0x1UL << 29)
36 	u8			unused;
37 };
38 
39 struct bnxt_dscp2pri_entry {
40 	u8	dscp;
41 	u8	mask;
42 	u8	pri;
43 };
44 
45 #define BNXT_LLQ(q_profile)	\
46 	((q_profile) ==		\
47 	 QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE)
48 
49 #define BNXT_CNPQ(q_profile)	\
50 	((q_profile) ==		\
51 	 QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP)
52 
53 #define HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL	0x0300
54 
55 void bnxt_dcb_init(struct bnxt *bp);
56 void bnxt_dcb_free(struct bnxt *bp);
57 #endif
58