18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * RSS and Classifier definitions for Marvell PPv2 Network Controller
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2014 Marvell
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Marcin Wojtas <mw@semihalf.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _MVPP2_CLS_H_
118c2ecf20Sopenharmony_ci#define _MVPP2_CLS_H_
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include "mvpp2.h"
148c2ecf20Sopenharmony_ci#include "mvpp2_prs.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* Classifier constants */
178c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLOWS_TBL_SIZE	512
188c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLOWS_TBL_DATA_WORDS	3
198c2ecf20Sopenharmony_ci#define MVPP2_CLS_LKP_TBL_SIZE		64
208c2ecf20Sopenharmony_ci#define MVPP2_CLS_RX_QUEUES		256
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/* Classifier flow constants */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define MVPP2_FLOW_N_FIELDS		4
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cienum mvpp2_cls_engine {
278c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C2 = 1,
288c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C3A,
298c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C3B,
308c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C4,
318c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C3HA = 6,
328c2ecf20Sopenharmony_ci	MVPP22_CLS_ENGINE_C3HB = 7,
338c2ecf20Sopenharmony_ci};
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_MAC_DA	BIT(0)
368c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_VLAN_PRI	BIT(1)
378c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_VLAN		BIT(2)
388c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_L3_PROTO	BIT(3)
398c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_IP4SA	BIT(4)
408c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_IP4DA	BIT(5)
418c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_IP6SA	BIT(6)
428c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_IP6DA	BIT(7)
438c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_L4SIP	BIT(8)
448c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_OPT_L4DIP	BIT(9)
458c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_N_FIELDS		10
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_L4_OPTS	(MVPP22_CLS_HEK_OPT_L4SIP | \
488c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_OPT_L4DIP)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_IP4_2T	(MVPP22_CLS_HEK_OPT_IP4SA | \
518c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_OPT_IP4DA)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_IP6_2T	(MVPP22_CLS_HEK_OPT_IP6SA | \
548c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_OPT_IP6DA)
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* The fifth tuple in "5T" is the L4_Info field */
578c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_IP4_5T	(MVPP22_CLS_HEK_IP4_2T | \
588c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_L4_OPTS)
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_IP6_5T	(MVPP22_CLS_HEK_IP6_2T | \
618c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_L4_OPTS)
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#define MVPP22_CLS_HEK_TAGGED	(MVPP22_CLS_HEK_OPT_VLAN | \
648c2ecf20Sopenharmony_ci				 MVPP22_CLS_HEK_OPT_VLAN_PRI)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_cienum mvpp2_cls_field_id {
678c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_MAC_DA = 0x03,
688c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_VLAN_PRI = 0x05,
698c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_VLAN = 0x06,
708c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_L3_PROTO = 0x0f,
718c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_IP4SA = 0x10,
728c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_IP4DA = 0x11,
738c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_IP6SA = 0x17,
748c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_IP6DA = 0x1a,
758c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_L4SIP = 0x1d,
768c2ecf20Sopenharmony_ci	MVPP22_CLS_FIELD_L4DIP = 0x1e,
778c2ecf20Sopenharmony_ci};
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci/* Classifier C2 engine constants */
808c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_TCAM_EN(data)		((data) << 16)
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_cienum mvpp22_cls_c2_action {
838c2ecf20Sopenharmony_ci	MVPP22_C2_NO_UPD = 0,
848c2ecf20Sopenharmony_ci	MVPP22_C2_NO_UPD_LOCK,
858c2ecf20Sopenharmony_ci	MVPP22_C2_UPD,
868c2ecf20Sopenharmony_ci	MVPP22_C2_UPD_LOCK,
878c2ecf20Sopenharmony_ci};
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_cienum mvpp22_cls_c2_fwd_action {
908c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_NO_UPD = 0,
918c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_NO_UPD_LOCK,
928c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_SW,
938c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_SW_LOCK,
948c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_HW,
958c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_HW_LOCK,
968c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_HW_LOW_LAT,
978c2ecf20Sopenharmony_ci	MVPP22_C2_FWD_HW_LOW_LAT_LOCK,
988c2ecf20Sopenharmony_ci};
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_cienum mvpp22_cls_c2_color_action {
1018c2ecf20Sopenharmony_ci	MVPP22_C2_COL_NO_UPD = 0,
1028c2ecf20Sopenharmony_ci	MVPP22_C2_COL_NO_UPD_LOCK,
1038c2ecf20Sopenharmony_ci	MVPP22_C2_COL_GREEN,
1048c2ecf20Sopenharmony_ci	MVPP22_C2_COL_GREEN_LOCK,
1058c2ecf20Sopenharmony_ci	MVPP22_C2_COL_YELLOW,
1068c2ecf20Sopenharmony_ci	MVPP22_C2_COL_YELLOW_LOCK,
1078c2ecf20Sopenharmony_ci	MVPP22_C2_COL_RED,		/* Drop */
1088c2ecf20Sopenharmony_ci	MVPP22_C2_COL_RED_LOCK,		/* Drop */
1098c2ecf20Sopenharmony_ci};
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#define MVPP2_CLS_C2_TCAM_WORDS			5
1128c2ecf20Sopenharmony_ci#define MVPP2_CLS_C2_ATTR_WORDS			5
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_cistruct mvpp2_cls_c2_entry {
1158c2ecf20Sopenharmony_ci	u32 index;
1168c2ecf20Sopenharmony_ci	/* TCAM lookup key */
1178c2ecf20Sopenharmony_ci	u32 tcam[MVPP2_CLS_C2_TCAM_WORDS];
1188c2ecf20Sopenharmony_ci	/* Actions to perform upon TCAM match */
1198c2ecf20Sopenharmony_ci	u32 act;
1208c2ecf20Sopenharmony_ci	/* Attributes relative to the actions to perform */
1218c2ecf20Sopenharmony_ci	u32 attr[MVPP2_CLS_C2_ATTR_WORDS];
1228c2ecf20Sopenharmony_ci	/* Entry validity */
1238c2ecf20Sopenharmony_ci	u8 valid;
1248c2ecf20Sopenharmony_ci};
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define MVPP22_FLOW_ETHER_BIT	BIT(0)
1278c2ecf20Sopenharmony_ci#define MVPP22_FLOW_IP4_BIT	BIT(1)
1288c2ecf20Sopenharmony_ci#define MVPP22_FLOW_IP6_BIT	BIT(2)
1298c2ecf20Sopenharmony_ci#define MVPP22_FLOW_TCP_BIT	BIT(3)
1308c2ecf20Sopenharmony_ci#define MVPP22_FLOW_UDP_BIT	BIT(4)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define MVPP22_FLOW_TCP4	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_TCP_BIT)
1338c2ecf20Sopenharmony_ci#define MVPP22_FLOW_TCP6	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_TCP_BIT)
1348c2ecf20Sopenharmony_ci#define MVPP22_FLOW_UDP4	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_UDP_BIT)
1358c2ecf20Sopenharmony_ci#define MVPP22_FLOW_UDP6	(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_UDP_BIT)
1368c2ecf20Sopenharmony_ci#define MVPP22_FLOW_IP4		(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT)
1378c2ecf20Sopenharmony_ci#define MVPP22_FLOW_IP6		(MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT)
1388c2ecf20Sopenharmony_ci#define MVPP22_FLOW_ETHERNET	(MVPP22_FLOW_ETHER_BIT)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci/* Classifier C2 engine entries */
1418c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_N_ENTRIES		256
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci/* Number of per-port dedicated entries in the C2 TCAM */
1448c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_PORT_N_FLOWS	MVPP2_N_RFS_ENTRIES_PER_FLOW
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* Each port has oen range per flow type + one entry controling the global RSS
1478c2ecf20Sopenharmony_ci * setting and the default rx queue
1488c2ecf20Sopenharmony_ci */
1498c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_PORT_RANGE	(MVPP22_CLS_C2_PORT_N_FLOWS + 1)
1508c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_PORT_FIRST(p)	((p) * MVPP22_CLS_C2_PORT_RANGE)
1518c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_RSS_ENTRY(p)	(MVPP22_CLS_C2_PORT_FIRST((p) + 1) - 1)
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_PORT_FLOW_FIRST(p)	(MVPP22_CLS_C2_PORT_FIRST(p))
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define MVPP22_CLS_C2_RFS_LOC(p, loc)	(MVPP22_CLS_C2_PORT_FLOW_FIRST(p) + (loc))
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/* Packet flow ID */
1588c2ecf20Sopenharmony_cienum mvpp2_prs_flow {
1598c2ecf20Sopenharmony_ci	MVPP2_FL_START = 8,
1608c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_TCP_NF_UNTAG = MVPP2_FL_START,
1618c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_UDP_NF_UNTAG,
1628c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_TCP_NF_TAG,
1638c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_UDP_NF_TAG,
1648c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_TCP_NF_UNTAG,
1658c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_UDP_NF_UNTAG,
1668c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_TCP_NF_TAG,
1678c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_UDP_NF_TAG,
1688c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_TCP_FRAG_UNTAG,
1698c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_UDP_FRAG_UNTAG,
1708c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_TCP_FRAG_TAG,
1718c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_UDP_FRAG_TAG,
1728c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_TCP_FRAG_UNTAG,
1738c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_UDP_FRAG_UNTAG,
1748c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_TCP_FRAG_TAG,
1758c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_UDP_FRAG_TAG,
1768c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_UNTAG, /* non-TCP, non-UDP, same for below */
1778c2ecf20Sopenharmony_ci	MVPP2_FL_IP4_TAG,
1788c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_UNTAG,
1798c2ecf20Sopenharmony_ci	MVPP2_FL_IP6_TAG,
1808c2ecf20Sopenharmony_ci	MVPP2_FL_NON_IP_UNTAG,
1818c2ecf20Sopenharmony_ci	MVPP2_FL_NON_IP_TAG,
1828c2ecf20Sopenharmony_ci	MVPP2_FL_LAST,
1838c2ecf20Sopenharmony_ci};
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* LU Type defined for all engines, and specified in the flow table */
1868c2ecf20Sopenharmony_ci#define MVPP2_CLS_LU_TYPE_MASK			0x3f
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_cienum mvpp2_cls_lu_type {
1898c2ecf20Sopenharmony_ci	/* rule->loc is used as a lu-type for the entries 0 - 62. */
1908c2ecf20Sopenharmony_ci	MVPP22_CLS_LU_TYPE_ALL = 63,
1918c2ecf20Sopenharmony_ci};
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define MVPP2_N_FLOWS		(MVPP2_FL_LAST - MVPP2_FL_START)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_cistruct mvpp2_cls_flow {
1968c2ecf20Sopenharmony_ci	/* The L2-L4 traffic flow type */
1978c2ecf20Sopenharmony_ci	int flow_type;
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci	/* The first id in the flow table for this flow */
2008c2ecf20Sopenharmony_ci	u16 flow_id;
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci	/* The supported HEK fields for this flow */
2038c2ecf20Sopenharmony_ci	u16 supported_hash_opts;
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci	/* The Header Parser result_info that matches this flow */
2068c2ecf20Sopenharmony_ci	struct mvpp2_prs_result_info prs_ri;
2078c2ecf20Sopenharmony_ci};
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_ENTRIES_PER_FLOW		(MVPP2_MAX_PORTS + 1 + 16)
2108c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_FIRST(id)			(((id) - MVPP2_FL_START) * \
2118c2ecf20Sopenharmony_ci						 MVPP2_CLS_FLT_ENTRIES_PER_FLOW)
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_C2_RFS(port, id, rfs_n)	(MVPP2_CLS_FLT_FIRST(id) + \
2148c2ecf20Sopenharmony_ci						 ((port) * MVPP2_MAX_PORTS) + \
2158c2ecf20Sopenharmony_ci						 (rfs_n))
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_C2_RSS_ENTRY(id)		(MVPP2_CLS_FLT_C2_RFS(MVPP2_MAX_PORTS, id, 0))
2188c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_HASH_ENTRY(port, id)	(MVPP2_CLS_FLT_C2_RSS_ENTRY(id) + 1 + (port))
2198c2ecf20Sopenharmony_ci#define MVPP2_CLS_FLT_LAST(id)			(MVPP2_CLS_FLT_FIRST(id) + \
2208c2ecf20Sopenharmony_ci						 MVPP2_CLS_FLT_ENTRIES_PER_FLOW - 1)
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci/* Iterate on each classifier flow id. Sets 'i' to be the index of the first
2238c2ecf20Sopenharmony_ci * entry in the cls_flows table for each different flow_id.
2248c2ecf20Sopenharmony_ci * This relies on entries having the same flow_id in the cls_flows table being
2258c2ecf20Sopenharmony_ci * contiguous.
2268c2ecf20Sopenharmony_ci */
2278c2ecf20Sopenharmony_ci#define for_each_cls_flow_id(i)						      \
2288c2ecf20Sopenharmony_ci	for ((i) = 0; (i) < MVPP2_N_PRS_FLOWS; (i)++)			      \
2298c2ecf20Sopenharmony_ci		if ((i) > 0 &&						      \
2308c2ecf20Sopenharmony_ci		    cls_flows[(i)].flow_id == cls_flows[(i) - 1].flow_id)       \
2318c2ecf20Sopenharmony_ci			continue;					      \
2328c2ecf20Sopenharmony_ci		else
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci/* Iterate on each classifier flow that has a given flow_type. Sets 'i' to be
2358c2ecf20Sopenharmony_ci * the index of the first entry in the cls_flow table for each different flow_id
2368c2ecf20Sopenharmony_ci * that has the given flow_type. This allows to operate on all flows that
2378c2ecf20Sopenharmony_ci * matches a given ethtool flow type.
2388c2ecf20Sopenharmony_ci */
2398c2ecf20Sopenharmony_ci#define for_each_cls_flow_id_with_type(i, type)				      \
2408c2ecf20Sopenharmony_ci	for_each_cls_flow_id((i))					      \
2418c2ecf20Sopenharmony_ci		if (cls_flows[(i)].flow_type != (type))			      \
2428c2ecf20Sopenharmony_ci			continue;					      \
2438c2ecf20Sopenharmony_ci		else
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci#define for_each_cls_flow_id_containing_type(i, type)			      \
2468c2ecf20Sopenharmony_ci	for_each_cls_flow_id((i))					      \
2478c2ecf20Sopenharmony_ci		if ((cls_flows[(i)].flow_type & (type)) != (type))	      \
2488c2ecf20Sopenharmony_ci			continue;					      \
2498c2ecf20Sopenharmony_ci		else
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_cistruct mvpp2_cls_flow_entry {
2528c2ecf20Sopenharmony_ci	u32 index;
2538c2ecf20Sopenharmony_ci	u32 data[MVPP2_CLS_FLOWS_TBL_DATA_WORDS];
2548c2ecf20Sopenharmony_ci};
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_cistruct mvpp2_cls_lookup_entry {
2578c2ecf20Sopenharmony_ci	u32 lkpid;
2588c2ecf20Sopenharmony_ci	u32 way;
2598c2ecf20Sopenharmony_ci	u32 data;
2608c2ecf20Sopenharmony_ci};
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ciint mvpp22_port_rss_init(struct mvpp2_port *port);
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ciint mvpp22_port_rss_enable(struct mvpp2_port *port);
2658c2ecf20Sopenharmony_ciint mvpp22_port_rss_disable(struct mvpp2_port *port);
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ciint mvpp22_port_rss_ctx_create(struct mvpp2_port *port, u32 *rss_ctx);
2688c2ecf20Sopenharmony_ciint mvpp22_port_rss_ctx_delete(struct mvpp2_port *port, u32 rss_ctx);
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ciint mvpp22_port_rss_ctx_indir_set(struct mvpp2_port *port, u32 rss_ctx,
2718c2ecf20Sopenharmony_ci				  const u32 *indir);
2728c2ecf20Sopenharmony_ciint mvpp22_port_rss_ctx_indir_get(struct mvpp2_port *port, u32 rss_ctx,
2738c2ecf20Sopenharmony_ci				  u32 *indir);
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ciint mvpp2_ethtool_rxfh_get(struct mvpp2_port *port, struct ethtool_rxnfc *info);
2768c2ecf20Sopenharmony_ciint mvpp2_ethtool_rxfh_set(struct mvpp2_port *port, struct ethtool_rxnfc *info);
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_civoid mvpp2_cls_init(struct mvpp2 *priv);
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_civoid mvpp2_cls_port_config(struct mvpp2_port *port);
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_civoid mvpp2_cls_oversize_rxq_set(struct mvpp2_port *port);
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ciint mvpp2_cls_flow_eng_get(struct mvpp2_cls_flow_entry *fe);
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ciu16 mvpp2_flow_get_hek_fields(struct mvpp2_cls_flow_entry *fe);
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ciconst struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow);
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ciu32 mvpp2_cls_flow_hits(struct mvpp2 *priv, int index);
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_civoid mvpp2_cls_flow_read(struct mvpp2 *priv, int index,
2938c2ecf20Sopenharmony_ci			 struct mvpp2_cls_flow_entry *fe);
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ciu32 mvpp2_cls_lookup_hits(struct mvpp2 *priv, int index);
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_civoid mvpp2_cls_lookup_read(struct mvpp2 *priv, int lkpid, int way,
2988c2ecf20Sopenharmony_ci			   struct mvpp2_cls_lookup_entry *le);
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ciu32 mvpp2_cls_c2_hit_count(struct mvpp2 *priv, int c2_index);
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_civoid mvpp2_cls_c2_read(struct mvpp2 *priv, int index,
3038c2ecf20Sopenharmony_ci		       struct mvpp2_cls_c2_entry *c2);
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ciint mvpp2_ethtool_cls_rule_get(struct mvpp2_port *port,
3068c2ecf20Sopenharmony_ci			       struct ethtool_rxnfc *rxnfc);
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ciint mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
3098c2ecf20Sopenharmony_ci			       struct ethtool_rxnfc *info);
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ciint mvpp2_ethtool_cls_rule_del(struct mvpp2_port *port,
3128c2ecf20Sopenharmony_ci			       struct ethtool_rxnfc *info);
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci#endif
315