#include "vcap_api_debugfs.h"
#include "sparx5_main_regs.h"
#include "sparx5_main.h"
#include "sparx5_vcap_impl.h"
#include "sparx5_vcap_ag_api.h"
#include "sparx5_vcap_debugfs.h"
#define SUPER_VCAP_BLK_SIZE …
#define STREAMSIZE …
#define SPARX5_IS2_LOOKUPS …
#define VCAP_IS2_KEYSEL(_ena, _noneth, _v4_mc, _v4_uc, _v6_mc, _v6_uc, _arp) …
#define SPARX5_IS0_LOOKUPS …
#define VCAP_IS0_KEYSEL(_ena, _etype, _ipv4, _ipv6, _mpls_uc, _mpls_mc, _mlbs) …
#define SPARX5_ES0_LOOKUPS …
#define VCAP_ES0_KEYSEL(_key) …
#define SPARX5_STAT_ESDX_GRN_PKTS …
#define SPARX5_STAT_ESDX_YEL_PKTS …
#define SPARX5_ES2_LOOKUPS …
#define VCAP_ES2_KEYSEL(_ena, _arp, _ipv4, _ipv6) …
static struct sparx5_vcap_inst { … } sparx5_vcap_inst_cfg[] = …;
static u16 sparx5_vcap_is0_known_etypes[] = …;
static u16 sparx5_vcap_is2_known_etypes[] = …;
static u16 sparx5_vcap_es2_known_etypes[] = …;
static void sparx5_vcap_type_err(struct sparx5 *sparx5,
struct vcap_admin *admin,
const char *fname)
{ … }
static void sparx5_vcap_wait_super_update(struct sparx5 *sparx5)
{ … }
static void sparx5_vcap_wait_es0_update(struct sparx5 *sparx5)
{ … }
static void sparx5_vcap_wait_es2_update(struct sparx5 *sparx5)
{ … }
static void _sparx5_vcap_range_init(struct sparx5 *sparx5,
struct vcap_admin *admin,
u32 addr, u32 count)
{ … }
static void sparx5_vcap_block_init(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static const char *sparx5_vcap_keyset_name(struct net_device *ndev,
enum vcap_keyfield_set keyset)
{ … }
static bool sparx5_vcap_is0_is_first_chain(struct vcap_rule *rule)
{ … }
static bool sparx5_vcap_is2_is_first_chain(struct vcap_rule *rule)
{ … }
static bool sparx5_vcap_es2_is_first_chain(struct vcap_rule *rule)
{ … }
static void sparx5_vcap_add_ingress_range_port_mask(struct vcap_rule *rule,
struct net_device *ndev)
{ … }
static void sparx5_vcap_add_wide_port_mask(struct vcap_rule *rule,
struct net_device *ndev)
{ … }
static void sparx5_vcap_add_egress_range_port_mask(struct vcap_rule *rule,
struct net_device *ndev)
{ … }
static int sparx5_vcap_is0_cid_to_lookup(int cid)
{ … }
static int sparx5_vcap_is2_cid_to_lookup(int cid)
{ … }
static int sparx5_vcap_es2_cid_to_lookup(int cid)
{ … }
static void
sparx5_vcap_is0_get_port_etype_keysets(struct vcap_keyset_list *keysetlist,
u32 value)
{ … }
static int sparx5_vcap_is0_get_port_keysets(struct net_device *ndev,
int lookup,
struct vcap_keyset_list *keysetlist,
u16 l3_proto)
{ … }
static int sparx5_vcap_is2_get_port_keysets(struct net_device *ndev,
int lookup,
struct vcap_keyset_list *keysetlist,
u16 l3_proto)
{ … }
static void
sparx5_vcap_es2_get_port_ipv4_keysets(struct vcap_keyset_list *keysetlist,
u32 value)
{ … }
static int sparx5_vcap_es0_get_port_keysets(struct net_device *ndev,
struct vcap_keyset_list *keysetlist,
u16 l3_proto)
{ … }
static int sparx5_vcap_es2_get_port_keysets(struct net_device *ndev,
int lookup,
struct vcap_keyset_list *keysetlist,
u16 l3_proto)
{ … }
int sparx5_vcap_get_port_keyset(struct net_device *ndev,
struct vcap_admin *admin,
int cid,
u16 l3_proto,
struct vcap_keyset_list *kslist)
{ … }
bool sparx5_vcap_is_known_etype(struct vcap_admin *admin, u16 etype)
{ … }
static enum vcap_keyfield_set
sparx5_vcap_validate_keyset(struct net_device *ndev,
struct vcap_admin *admin,
struct vcap_rule *rule,
struct vcap_keyset_list *kslist,
u16 l3_proto)
{ … }
static void sparx5_vcap_ingress_add_default_fields(struct net_device *ndev,
struct vcap_admin *admin,
struct vcap_rule *rule)
{ … }
static void sparx5_vcap_es0_add_default_fields(struct net_device *ndev,
struct vcap_admin *admin,
struct vcap_rule *rule)
{ … }
static void sparx5_vcap_es2_add_default_fields(struct net_device *ndev,
struct vcap_admin *admin,
struct vcap_rule *rule)
{ … }
static void sparx5_vcap_add_default_fields(struct net_device *ndev,
struct vcap_admin *admin,
struct vcap_rule *rule)
{ … }
static void sparx5_vcap_cache_erase(struct vcap_admin *admin)
{ … }
static void sparx5_vcap_is0_cache_write(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_is2_cache_write(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_es0_write_esdx_counter(struct sparx5 *sparx5,
struct vcap_admin *admin, u32 id)
{ … }
static void sparx5_vcap_es0_cache_write(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_es2_cache_write(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_cache_write(struct net_device *ndev,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_is0_cache_read(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_is2_cache_read(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_es0_read_esdx_counter(struct sparx5 *sparx5,
struct vcap_admin *admin, u32 id)
{ … }
static void sparx5_vcap_es0_cache_read(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_es2_cache_read(struct sparx5 *sparx5,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_cache_read(struct net_device *ndev,
struct vcap_admin *admin,
enum vcap_selection sel,
u32 start,
u32 count)
{ … }
static void sparx5_vcap_range_init(struct net_device *ndev,
struct vcap_admin *admin, u32 addr,
u32 count)
{ … }
static void sparx5_vcap_super_update(struct sparx5 *sparx5,
enum vcap_command cmd,
enum vcap_selection sel, u32 addr)
{ … }
static void sparx5_vcap_es0_update(struct sparx5 *sparx5,
enum vcap_command cmd,
enum vcap_selection sel, u32 addr)
{ … }
static void sparx5_vcap_es2_update(struct sparx5 *sparx5,
enum vcap_command cmd,
enum vcap_selection sel, u32 addr)
{ … }
static void sparx5_vcap_update(struct net_device *ndev,
struct vcap_admin *admin, enum vcap_command cmd,
enum vcap_selection sel, u32 addr)
{ … }
static void sparx5_vcap_super_move(struct sparx5 *sparx5,
u32 addr,
enum vcap_command cmd,
u16 mv_num_pos,
u16 mv_size)
{ … }
static void sparx5_vcap_es0_move(struct sparx5 *sparx5,
u32 addr,
enum vcap_command cmd,
u16 mv_num_pos,
u16 mv_size)
{ … }
static void sparx5_vcap_es2_move(struct sparx5 *sparx5,
u32 addr,
enum vcap_command cmd,
u16 mv_num_pos,
u16 mv_size)
{ … }
static void sparx5_vcap_move(struct net_device *ndev, struct vcap_admin *admin,
u32 addr, int offset, int count)
{ … }
static const struct vcap_operations sparx5_vcap_ops = …;
static u32 sparx5_vcap_is0_keyset_to_etype_ps(enum vcap_keyfield_set keyset)
{ … }
static void sparx5_vcap_is0_set_port_keyset(struct net_device *ndev, int lookup,
enum vcap_keyfield_set keyset,
int l3_proto)
{ … }
static u32 sparx5_vcap_is2_keyset_to_arp_ps(enum vcap_keyfield_set keyset)
{ … }
static u32 sparx5_vcap_is2_keyset_to_ipv4_ps(enum vcap_keyfield_set keyset)
{ … }
static u32 sparx5_vcap_is2_keyset_to_ipv6_uc_ps(enum vcap_keyfield_set keyset)
{ … }
static u32 sparx5_vcap_is2_keyset_to_ipv6_mc_ps(enum vcap_keyfield_set keyset)
{ … }
static void sparx5_vcap_is2_set_port_keyset(struct net_device *ndev, int lookup,
enum vcap_keyfield_set keyset,
int l3_proto)
{ … }
static u32 sparx5_vcap_es2_keyset_to_arp_ps(enum vcap_keyfield_set keyset)
{ … }
static u32 sparx5_vcap_es2_keyset_to_ipv4_ps(enum vcap_keyfield_set keyset)
{ … }
static u32 sparx5_vcap_es2_keyset_to_ipv6_ps(enum vcap_keyfield_set keyset)
{ … }
static void sparx5_vcap_es2_set_port_keyset(struct net_device *ndev, int lookup,
enum vcap_keyfield_set keyset,
int l3_proto)
{ … }
void sparx5_vcap_set_port_keyset(struct net_device *ndev,
struct vcap_admin *admin,
int cid,
u16 l3_proto,
enum vcap_keyfield_set keyset,
struct vcap_keyset_list *orig)
{ … }
static void sparx5_vcap_is0_port_key_selection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_is2_port_key_selection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_es0_port_key_selection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_es2_port_key_selection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_port_key_selection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_port_key_deselection(struct sparx5 *sparx5,
struct vcap_admin *admin)
{ … }
static void sparx5_vcap_admin_free(struct vcap_admin *admin)
{ … }
static struct vcap_admin *
sparx5_vcap_admin_alloc(struct sparx5 *sparx5, struct vcap_control *ctrl,
const struct sparx5_vcap_inst *cfg)
{ … }
static void sparx5_vcap_block_alloc(struct sparx5 *sparx5,
struct vcap_admin *admin,
const struct sparx5_vcap_inst *cfg)
{ … }
int sparx5_vcap_init(struct sparx5 *sparx5)
{ … }
void sparx5_vcap_destroy(struct sparx5 *sparx5)
{ … }