1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
2 | // Copyright (c) 2021-2021 Hisilicon Limited. |
3 | |
4 | #ifndef __HCLGE_COMM_RSS_H |
5 | #define |
6 | #include <linux/types.h> |
7 | |
8 | #include "hnae3.h" |
9 | #include "hclge_comm_cmd.h" |
10 | |
11 | #define 0 |
12 | #define 1 |
13 | #define 2 |
14 | |
15 | #define GENMASK(3, 0) |
16 | #define GENMASK(4, 0) |
17 | |
18 | #define HCLGE_COMM_D_PORT_BIT BIT(0) |
19 | #define HCLGE_COMM_S_PORT_BIT BIT(1) |
20 | #define HCLGE_COMM_D_IP_BIT BIT(2) |
21 | #define HCLGE_COMM_S_IP_BIT BIT(3) |
22 | #define HCLGE_COMM_V_TAG_BIT BIT(4) |
23 | #define \ |
24 | (HCLGE_COMM_D_IP_BIT | HCLGE_COMM_S_IP_BIT | HCLGE_COMM_V_TAG_BIT) |
25 | #define HCLGE_COMM_MAX_TC_NUM 8 |
26 | |
27 | #define 0 |
28 | #define GENMASK(10, 0) |
29 | #define 11 |
30 | #define 12 |
31 | #define GENMASK(14, 12) |
32 | #define 15 |
33 | #define 3 |
34 | |
35 | struct { |
36 | u8 ; |
37 | u8 ; |
38 | u8 ; |
39 | u8 ; |
40 | u8 ; |
41 | u8 ; |
42 | u8 ; |
43 | u8 ; |
44 | }; |
45 | |
46 | #define 40 |
47 | #define 16 |
48 | #define 2U |
49 | #define 8U |
50 | #define 4 |
51 | #define GENMASK(15, 0) |
52 | #define GENMASK(3, 0) |
53 | #define 4 |
54 | |
55 | #define 16 |
56 | struct { |
57 | u8 ; |
58 | u8 [7]; |
59 | u8 [HCLGE_COMM_RSS_HASH_KEY_NUM]; |
60 | }; |
61 | |
62 | struct { |
63 | u8 [HCLGE_COMM_RSS_KEY_SIZE]; /* user configured hash keys */ |
64 | |
65 | /* shadow table */ |
66 | u16 *; |
67 | u32 ; |
68 | |
69 | struct hclge_comm_rss_tuple_cfg ; |
70 | u32 ; |
71 | }; |
72 | |
73 | struct { |
74 | u8 ; |
75 | u8 ; |
76 | u8 ; |
77 | u8 ; |
78 | u8 ; |
79 | u8 ; |
80 | u8 ; |
81 | u8 ; |
82 | u8 [16]; |
83 | }; |
84 | |
85 | struct { |
86 | __le16 ; |
87 | __le16 ; |
88 | u8 [HCLGE_COMM_RSS_CFG_TBL_SIZE_H]; |
89 | u8 [HCLGE_COMM_RSS_CFG_TBL_SIZE]; |
90 | }; |
91 | |
92 | struct { |
93 | __le16 [HCLGE_COMM_MAX_TC_NUM]; |
94 | u8 [8]; |
95 | }; |
96 | |
97 | u32 (struct hnae3_handle *handle); |
98 | void (struct hnae3_ae_dev *ae_dev, |
99 | struct hclge_comm_rss_cfg *); |
100 | int (struct hclge_comm_rss_cfg *, int flow_type, |
101 | u8 *tuple_sets); |
102 | int (struct hclge_comm_rss_cfg *, |
103 | const u8 hfunc, u8 *hash_algo); |
104 | void (struct hclge_comm_rss_cfg *, u8 *key, |
105 | u8 *hfunc); |
106 | void (struct hclge_comm_rss_cfg *, |
107 | u32 *indir, u16 ); |
108 | int (struct hclge_comm_hw *hw, const u8 hfunc, |
109 | const u8 *key); |
110 | int (struct hclge_comm_rss_cfg *, |
111 | struct ethtool_rxnfc *nfc, |
112 | struct hnae3_ae_dev *ae_dev, |
113 | struct hclge_comm_rss_input_tuple_cmd *req); |
114 | u64 (u8 tuple_sets); |
115 | int (struct hclge_comm_hw *hw, |
116 | struct hclge_comm_rss_cfg *); |
117 | int (struct hnae3_ae_dev *ae_dev, |
118 | struct hclge_comm_hw *hw, const u16 *indir); |
119 | int (struct hnae3_handle *nic, |
120 | struct hnae3_ae_dev *ae_dev, |
121 | struct hclge_comm_rss_cfg *); |
122 | void (u16 , u8 hw_tc_map, u16 *tc_offset, |
123 | u16 *tc_valid, u16 *tc_size); |
124 | int (struct hclge_comm_hw *hw, u16 *tc_offset, |
125 | u16 *tc_valid, u16 *tc_size); |
126 | int (struct hclge_comm_rss_cfg *, |
127 | struct hclge_comm_hw *hw, const u8 *key, |
128 | const u8 hfunc); |
129 | int (struct hnae3_ae_dev *ae_dev, |
130 | struct hclge_comm_hw *hw, |
131 | struct hclge_comm_rss_cfg *, |
132 | struct ethtool_rxnfc *nfc); |
133 | #endif |
134 | |