xref: /OK3568_Linux_fs/kernel/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * RSS and Classifier definitions for Marvell PPv2 Network Controller
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2014 Marvell
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Marcin Wojtas <mw@semihalf.com>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef _MVPP2_CLS_H_
11*4882a593Smuzhiyun #define _MVPP2_CLS_H_
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include "mvpp2.h"
14*4882a593Smuzhiyun #include "mvpp2_prs.h"
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun /* Classifier constants */
17*4882a593Smuzhiyun #define MVPP2_CLS_FLOWS_TBL_SIZE	512
18*4882a593Smuzhiyun #define MVPP2_CLS_FLOWS_TBL_DATA_WORDS	3
19*4882a593Smuzhiyun #define MVPP2_CLS_LKP_TBL_SIZE		64
20*4882a593Smuzhiyun #define MVPP2_CLS_RX_QUEUES		256
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun /* Classifier flow constants */
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #define MVPP2_FLOW_N_FIELDS		4
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun enum mvpp2_cls_engine {
27*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C2 = 1,
28*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C3A,
29*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C3B,
30*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C4,
31*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C3HA = 6,
32*4882a593Smuzhiyun 	MVPP22_CLS_ENGINE_C3HB = 7,
33*4882a593Smuzhiyun };
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_MAC_DA	BIT(0)
36*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_VLAN_PRI	BIT(1)
37*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_VLAN		BIT(2)
38*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_L3_PROTO	BIT(3)
39*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_IP4SA	BIT(4)
40*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_IP4DA	BIT(5)
41*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_IP6SA	BIT(6)
42*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_IP6DA	BIT(7)
43*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_L4SIP	BIT(8)
44*4882a593Smuzhiyun #define MVPP22_CLS_HEK_OPT_L4DIP	BIT(9)
45*4882a593Smuzhiyun #define MVPP22_CLS_HEK_N_FIELDS		10
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #define MVPP22_CLS_HEK_L4_OPTS	(MVPP22_CLS_HEK_OPT_L4SIP | \
48*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_OPT_L4DIP)
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #define MVPP22_CLS_HEK_IP4_2T	(MVPP22_CLS_HEK_OPT_IP4SA | \
51*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_OPT_IP4DA)
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #define MVPP22_CLS_HEK_IP6_2T	(MVPP22_CLS_HEK_OPT_IP6SA | \
54*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_OPT_IP6DA)
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun /* The fifth tuple in "5T" is the L4_Info field */
57*4882a593Smuzhiyun #define MVPP22_CLS_HEK_IP4_5T	(MVPP22_CLS_HEK_IP4_2T | \
58*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_L4_OPTS)
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun #define MVPP22_CLS_HEK_IP6_5T	(MVPP22_CLS_HEK_IP6_2T | \
61*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_L4_OPTS)
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun #define MVPP22_CLS_HEK_TAGGED	(MVPP22_CLS_HEK_OPT_VLAN | \
64*4882a593Smuzhiyun 				 MVPP22_CLS_HEK_OPT_VLAN_PRI)
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun enum mvpp2_cls_field_id {
67*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_MAC_DA = 0x03,
68*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_VLAN_PRI = 0x05,
69*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_VLAN = 0x06,
70*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_L3_PROTO = 0x0f,
71*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_IP4SA = 0x10,
72*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_IP4DA = 0x11,
73*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_IP6SA = 0x17,
74*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_IP6DA = 0x1a,
75*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_L4SIP = 0x1d,
76*4882a593Smuzhiyun 	MVPP22_CLS_FIELD_L4DIP = 0x1e,
77*4882a593Smuzhiyun };
78*4882a593Smuzhiyun 
79*4882a593Smuzhiyun /* Classifier C2 engine constants */
80*4882a593Smuzhiyun #define MVPP22_CLS_C2_TCAM_EN(data)		((data) << 16)
81*4882a593Smuzhiyun 
82*4882a593Smuzhiyun enum mvpp22_cls_c2_action {
83*4882a593Smuzhiyun 	MVPP22_C2_NO_UPD = 0,
84*4882a593Smuzhiyun 	MVPP22_C2_NO_UPD_LOCK,
85*4882a593Smuzhiyun 	MVPP22_C2_UPD,
86*4882a593Smuzhiyun 	MVPP22_C2_UPD_LOCK,
87*4882a593Smuzhiyun };
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun enum mvpp22_cls_c2_fwd_action {
90*4882a593Smuzhiyun 	MVPP22_C2_FWD_NO_UPD = 0,
91*4882a593Smuzhiyun 	MVPP22_C2_FWD_NO_UPD_LOCK,
92*4882a593Smuzhiyun 	MVPP22_C2_FWD_SW,
93*4882a593Smuzhiyun 	MVPP22_C2_FWD_SW_LOCK,
94*4882a593Smuzhiyun 	MVPP22_C2_FWD_HW,
95*4882a593Smuzhiyun 	MVPP22_C2_FWD_HW_LOCK,
96*4882a593Smuzhiyun 	MVPP22_C2_FWD_HW_LOW_LAT,
97*4882a593Smuzhiyun 	MVPP22_C2_FWD_HW_LOW_LAT_LOCK,
98*4882a593Smuzhiyun };
99*4882a593Smuzhiyun 
100*4882a593Smuzhiyun enum mvpp22_cls_c2_color_action {
101*4882a593Smuzhiyun 	MVPP22_C2_COL_NO_UPD = 0,
102*4882a593Smuzhiyun 	MVPP22_C2_COL_NO_UPD_LOCK,
103*4882a593Smuzhiyun 	MVPP22_C2_COL_GREEN,
104*4882a593Smuzhiyun 	MVPP22_C2_COL_GREEN_LOCK,
105*4882a593Smuzhiyun 	MVPP22_C2_COL_YELLOW,
106*4882a593Smuzhiyun 	MVPP22_C2_COL_YELLOW_LOCK,
107*4882a593Smuzhiyun 	MVPP22_C2_COL_RED,		/* Drop */
108*4882a593Smuzhiyun 	MVPP22_C2_COL_RED_LOCK,		/* Drop */
109*4882a593Smuzhiyun };
110*4882a593Smuzhiyun 
111*4882a593Smuzhiyun #define MVPP2_CLS_C2_TCAM_WORDS			5
112*4882a593Smuzhiyun #define MVPP2_CLS_C2_ATTR_WORDS			5
113*4882a593Smuzhiyun 
114*4882a593Smuzhiyun struct mvpp2_cls_c2_entry {
115*4882a593Smuzhiyun 	u32 index;
116*4882a593Smuzhiyun 	/* TCAM lookup key */
117*4882a593Smuzhiyun 	u32 tcam[MVPP2_CLS_C2_TCAM_WORDS];
118*4882a593Smuzhiyun 	/* Actions to perform upon TCAM match */
119*4882a593Smuzhiyun 	u32 act;
120*4882a593Smuzhiyun 	/* Attributes relative to the actions to perform */
121*4882a593Smuzhiyun 	u32 attr[MVPP2_CLS_C2_ATTR_WORDS];
122*4882a593Smuzhiyun 	/* Entry validity */
123*4882a593Smuzhiyun 	u8 valid;
124*4882a593Smuzhiyun };
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun #define MVPP22_FLOW_ETHER_BIT	BIT(0)
127*4882a593Smuzhiyun #define MVPP22_FLOW_IP4_BIT	BIT(1)
128*4882a593Smuzhiyun #define MVPP22_FLOW_IP6_BIT	BIT(2)
129*4882a593Smuzhiyun #define MVPP22_FLOW_TCP_BIT	BIT(3)
130*4882a593Smuzhiyun #define MVPP22_FLOW_UDP_BIT	BIT(4)
131*4882a593Smuzhiyun 
132*4882a593Smuzhiyun #define MVPP22_FLOW_TCP4	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_TCP_BIT)
133*4882a593Smuzhiyun #define MVPP22_FLOW_TCP6	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_TCP_BIT)
134*4882a593Smuzhiyun #define MVPP22_FLOW_UDP4	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_UDP_BIT)
135*4882a593Smuzhiyun #define MVPP22_FLOW_UDP6	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_UDP_BIT)
136*4882a593Smuzhiyun #define MVPP22_FLOW_IP4		(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT)
137*4882a593Smuzhiyun #define MVPP22_FLOW_IP6		(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT)
138*4882a593Smuzhiyun #define MVPP22_FLOW_ETHERNET	(MVPP22_FLOW_ETHER_BIT)
139*4882a593Smuzhiyun 
140*4882a593Smuzhiyun /* Classifier C2 engine entries */
141*4882a593Smuzhiyun #define MVPP22_CLS_C2_N_ENTRIES		256
142*4882a593Smuzhiyun 
143*4882a593Smuzhiyun /* Number of per-port dedicated entries in the C2 TCAM */
144*4882a593Smuzhiyun #define MVPP22_CLS_C2_PORT_N_FLOWS	MVPP2_N_RFS_ENTRIES_PER_FLOW
145*4882a593Smuzhiyun 
146*4882a593Smuzhiyun /* Each port has oen range per flow type + one entry controling the global RSS
147*4882a593Smuzhiyun  * setting and the default rx queue
148*4882a593Smuzhiyun  */
149*4882a593Smuzhiyun #define MVPP22_CLS_C2_PORT_RANGE	(MVPP22_CLS_C2_PORT_N_FLOWS + 1)
150*4882a593Smuzhiyun #define MVPP22_CLS_C2_PORT_FIRST(p)	((p) * MVPP22_CLS_C2_PORT_RANGE)
151*4882a593Smuzhiyun #define MVPP22_CLS_C2_RSS_ENTRY(p)	(MVPP22_CLS_C2_PORT_FIRST((p) + 1) - 1)
152*4882a593Smuzhiyun 
153*4882a593Smuzhiyun #define MVPP22_CLS_C2_PORT_FLOW_FIRST(p)	(MVPP22_CLS_C2_PORT_FIRST(p))
154*4882a593Smuzhiyun 
155*4882a593Smuzhiyun #define MVPP22_CLS_C2_RFS_LOC(p, loc)	(MVPP22_CLS_C2_PORT_FLOW_FIRST(p) + (loc))
156*4882a593Smuzhiyun 
157*4882a593Smuzhiyun /* Packet flow ID */
158*4882a593Smuzhiyun enum mvpp2_prs_flow {
159*4882a593Smuzhiyun 	MVPP2_FL_START = 8,
160*4882a593Smuzhiyun 	MVPP2_FL_IP4_TCP_NF_UNTAG = MVPP2_FL_START,
161*4882a593Smuzhiyun 	MVPP2_FL_IP4_UDP_NF_UNTAG,
162*4882a593Smuzhiyun 	MVPP2_FL_IP4_TCP_NF_TAG,
163*4882a593Smuzhiyun 	MVPP2_FL_IP4_UDP_NF_TAG,
164*4882a593Smuzhiyun 	MVPP2_FL_IP6_TCP_NF_UNTAG,
165*4882a593Smuzhiyun 	MVPP2_FL_IP6_UDP_NF_UNTAG,
166*4882a593Smuzhiyun 	MVPP2_FL_IP6_TCP_NF_TAG,
167*4882a593Smuzhiyun 	MVPP2_FL_IP6_UDP_NF_TAG,
168*4882a593Smuzhiyun 	MVPP2_FL_IP4_TCP_FRAG_UNTAG,
169*4882a593Smuzhiyun 	MVPP2_FL_IP4_UDP_FRAG_UNTAG,
170*4882a593Smuzhiyun 	MVPP2_FL_IP4_TCP_FRAG_TAG,
171*4882a593Smuzhiyun 	MVPP2_FL_IP4_UDP_FRAG_TAG,
172*4882a593Smuzhiyun 	MVPP2_FL_IP6_TCP_FRAG_UNTAG,
173*4882a593Smuzhiyun 	MVPP2_FL_IP6_UDP_FRAG_UNTAG,
174*4882a593Smuzhiyun 	MVPP2_FL_IP6_TCP_FRAG_TAG,
175*4882a593Smuzhiyun 	MVPP2_FL_IP6_UDP_FRAG_TAG,
176*4882a593Smuzhiyun 	MVPP2_FL_IP4_UNTAG, /* non-TCP, non-UDP, same for below */
177*4882a593Smuzhiyun 	MVPP2_FL_IP4_TAG,
178*4882a593Smuzhiyun 	MVPP2_FL_IP6_UNTAG,
179*4882a593Smuzhiyun 	MVPP2_FL_IP6_TAG,
180*4882a593Smuzhiyun 	MVPP2_FL_NON_IP_UNTAG,
181*4882a593Smuzhiyun 	MVPP2_FL_NON_IP_TAG,
182*4882a593Smuzhiyun 	MVPP2_FL_LAST,
183*4882a593Smuzhiyun };
184*4882a593Smuzhiyun 
185*4882a593Smuzhiyun /* LU Type defined for all engines, and specified in the flow table */
186*4882a593Smuzhiyun #define MVPP2_CLS_LU_TYPE_MASK			0x3f
187*4882a593Smuzhiyun 
188*4882a593Smuzhiyun enum mvpp2_cls_lu_type {
189*4882a593Smuzhiyun 	/* rule->loc is used as a lu-type for the entries 0 - 62. */
190*4882a593Smuzhiyun 	MVPP22_CLS_LU_TYPE_ALL = 63,
191*4882a593Smuzhiyun };
192*4882a593Smuzhiyun 
193*4882a593Smuzhiyun #define MVPP2_N_FLOWS		(MVPP2_FL_LAST - MVPP2_FL_START)
194*4882a593Smuzhiyun 
195*4882a593Smuzhiyun struct mvpp2_cls_flow {
196*4882a593Smuzhiyun 	/* The L2-L4 traffic flow type */
197*4882a593Smuzhiyun 	int flow_type;
198*4882a593Smuzhiyun 
199*4882a593Smuzhiyun 	/* The first id in the flow table for this flow */
200*4882a593Smuzhiyun 	u16 flow_id;
201*4882a593Smuzhiyun 
202*4882a593Smuzhiyun 	/* The supported HEK fields for this flow */
203*4882a593Smuzhiyun 	u16 supported_hash_opts;
204*4882a593Smuzhiyun 
205*4882a593Smuzhiyun 	/* The Header Parser result_info that matches this flow */
206*4882a593Smuzhiyun 	struct mvpp2_prs_result_info prs_ri;
207*4882a593Smuzhiyun };
208*4882a593Smuzhiyun 
209*4882a593Smuzhiyun #define MVPP2_CLS_FLT_ENTRIES_PER_FLOW		(MVPP2_MAX_PORTS + 1 + 16)
210*4882a593Smuzhiyun #define MVPP2_CLS_FLT_FIRST(id)			(((id) - MVPP2_FL_START) * \
211*4882a593Smuzhiyun 						 MVPP2_CLS_FLT_ENTRIES_PER_FLOW)
212*4882a593Smuzhiyun 
213*4882a593Smuzhiyun #define MVPP2_CLS_FLT_C2_RFS(port, id, rfs_n)	(MVPP2_CLS_FLT_FIRST(id) + \
214*4882a593Smuzhiyun 						 ((port) * MVPP2_MAX_PORTS) + \
215*4882a593Smuzhiyun 						 (rfs_n))
216*4882a593Smuzhiyun 
217*4882a593Smuzhiyun #define MVPP2_CLS_FLT_C2_RSS_ENTRY(id)		(MVPP2_CLS_FLT_C2_RFS(MVPP2_MAX_PORTS, id, 0))
218*4882a593Smuzhiyun #define MVPP2_CLS_FLT_HASH_ENTRY(port, id)	(MVPP2_CLS_FLT_C2_RSS_ENTRY(id) + 1 + (port))
219*4882a593Smuzhiyun #define MVPP2_CLS_FLT_LAST(id)			(MVPP2_CLS_FLT_FIRST(id) + \
220*4882a593Smuzhiyun 						 MVPP2_CLS_FLT_ENTRIES_PER_FLOW - 1)
221*4882a593Smuzhiyun 
222*4882a593Smuzhiyun /* Iterate on each classifier flow id. Sets 'i' to be the index of the first
223*4882a593Smuzhiyun  * entry in the cls_flows table for each different flow_id.
224*4882a593Smuzhiyun  * This relies on entries having the same flow_id in the cls_flows table being
225*4882a593Smuzhiyun  * contiguous.
226*4882a593Smuzhiyun  */
227*4882a593Smuzhiyun #define for_each_cls_flow_id(i)						      \
228*4882a593Smuzhiyun 	for ((i) = 0; (i) < MVPP2_N_PRS_FLOWS; (i)++)			      \
229*4882a593Smuzhiyun 		if ((i) > 0 &&						      \
230*4882a593Smuzhiyun 		    cls_flows[(i)].flow_id == cls_flows[(i) - 1].flow_id)       \
231*4882a593Smuzhiyun 			continue;					      \
232*4882a593Smuzhiyun 		else
233*4882a593Smuzhiyun 
234*4882a593Smuzhiyun /* Iterate on each classifier flow that has a given flow_type. Sets 'i' to be
235*4882a593Smuzhiyun  * the index of the first entry in the cls_flow table for each different flow_id
236*4882a593Smuzhiyun  * that has the given flow_type. This allows to operate on all flows that
237*4882a593Smuzhiyun  * matches a given ethtool flow type.
238*4882a593Smuzhiyun  */
239*4882a593Smuzhiyun #define for_each_cls_flow_id_with_type(i, type)				      \
240*4882a593Smuzhiyun 	for_each_cls_flow_id((i))					      \
241*4882a593Smuzhiyun 		if (cls_flows[(i)].flow_type != (type))			      \
242*4882a593Smuzhiyun 			continue;					      \
243*4882a593Smuzhiyun 		else
244*4882a593Smuzhiyun 
245*4882a593Smuzhiyun #define for_each_cls_flow_id_containing_type(i, type)			      \
246*4882a593Smuzhiyun 	for_each_cls_flow_id((i))					      \
247*4882a593Smuzhiyun 		if ((cls_flows[(i)].flow_type & (type)) != (type))	      \
248*4882a593Smuzhiyun 			continue;					      \
249*4882a593Smuzhiyun 		else
250*4882a593Smuzhiyun 
251*4882a593Smuzhiyun struct mvpp2_cls_flow_entry {
252*4882a593Smuzhiyun 	u32 index;
253*4882a593Smuzhiyun 	u32 data[MVPP2_CLS_FLOWS_TBL_DATA_WORDS];
254*4882a593Smuzhiyun };
255*4882a593Smuzhiyun 
256*4882a593Smuzhiyun struct mvpp2_cls_lookup_entry {
257*4882a593Smuzhiyun 	u32 lkpid;
258*4882a593Smuzhiyun 	u32 way;
259*4882a593Smuzhiyun 	u32 data;
260*4882a593Smuzhiyun };
261*4882a593Smuzhiyun 
262*4882a593Smuzhiyun int mvpp22_port_rss_init(struct mvpp2_port *port);
263*4882a593Smuzhiyun 
264*4882a593Smuzhiyun int mvpp22_port_rss_enable(struct mvpp2_port *port);
265*4882a593Smuzhiyun int mvpp22_port_rss_disable(struct mvpp2_port *port);
266*4882a593Smuzhiyun 
267*4882a593Smuzhiyun int mvpp22_port_rss_ctx_create(struct mvpp2_port *port, u32 *rss_ctx);
268*4882a593Smuzhiyun int mvpp22_port_rss_ctx_delete(struct mvpp2_port *port, u32 rss_ctx);
269*4882a593Smuzhiyun 
270*4882a593Smuzhiyun int mvpp22_port_rss_ctx_indir_set(struct mvpp2_port *port, u32 rss_ctx,
271*4882a593Smuzhiyun 				  const u32 *indir);
272*4882a593Smuzhiyun int mvpp22_port_rss_ctx_indir_get(struct mvpp2_port *port, u32 rss_ctx,
273*4882a593Smuzhiyun 				  u32 *indir);
274*4882a593Smuzhiyun 
275*4882a593Smuzhiyun int mvpp2_ethtool_rxfh_get(struct mvpp2_port *port, struct ethtool_rxnfc *info);
276*4882a593Smuzhiyun int mvpp2_ethtool_rxfh_set(struct mvpp2_port *port, struct ethtool_rxnfc *info);
277*4882a593Smuzhiyun 
278*4882a593Smuzhiyun void mvpp2_cls_init(struct mvpp2 *priv);
279*4882a593Smuzhiyun 
280*4882a593Smuzhiyun void mvpp2_cls_port_config(struct mvpp2_port *port);
281*4882a593Smuzhiyun 
282*4882a593Smuzhiyun void mvpp2_cls_oversize_rxq_set(struct mvpp2_port *port);
283*4882a593Smuzhiyun 
284*4882a593Smuzhiyun int mvpp2_cls_flow_eng_get(struct mvpp2_cls_flow_entry *fe);
285*4882a593Smuzhiyun 
286*4882a593Smuzhiyun u16 mvpp2_flow_get_hek_fields(struct mvpp2_cls_flow_entry *fe);
287*4882a593Smuzhiyun 
288*4882a593Smuzhiyun const struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow);
289*4882a593Smuzhiyun 
290*4882a593Smuzhiyun u32 mvpp2_cls_flow_hits(struct mvpp2 *priv, int index);
291*4882a593Smuzhiyun 
292*4882a593Smuzhiyun void mvpp2_cls_flow_read(struct mvpp2 *priv, int index,
293*4882a593Smuzhiyun 			 struct mvpp2_cls_flow_entry *fe);
294*4882a593Smuzhiyun 
295*4882a593Smuzhiyun u32 mvpp2_cls_lookup_hits(struct mvpp2 *priv, int index);
296*4882a593Smuzhiyun 
297*4882a593Smuzhiyun void mvpp2_cls_lookup_read(struct mvpp2 *priv, int lkpid, int way,
298*4882a593Smuzhiyun 			   struct mvpp2_cls_lookup_entry *le);
299*4882a593Smuzhiyun 
300*4882a593Smuzhiyun u32 mvpp2_cls_c2_hit_count(struct mvpp2 *priv, int c2_index);
301*4882a593Smuzhiyun 
302*4882a593Smuzhiyun void mvpp2_cls_c2_read(struct mvpp2 *priv, int index,
303*4882a593Smuzhiyun 		       struct mvpp2_cls_c2_entry *c2);
304*4882a593Smuzhiyun 
305*4882a593Smuzhiyun int mvpp2_ethtool_cls_rule_get(struct mvpp2_port *port,
306*4882a593Smuzhiyun 			       struct ethtool_rxnfc *rxnfc);
307*4882a593Smuzhiyun 
308*4882a593Smuzhiyun int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
309*4882a593Smuzhiyun 			       struct ethtool_rxnfc *info);
310*4882a593Smuzhiyun 
311*4882a593Smuzhiyun int mvpp2_ethtool_cls_rule_del(struct mvpp2_port *port,
312*4882a593Smuzhiyun 			       struct ethtool_rxnfc *info);
313*4882a593Smuzhiyun 
314*4882a593Smuzhiyun #endif
315