#include <linux/rhashtable.h>
#include "prestera_acl.h"
#include "prestera_flow.h"
#include "prestera_hw.h"
#include "prestera.h"
#define ACL_KEYMASK_SIZE …
struct prestera_acl { … };
struct prestera_acl_ruleset_ht_key { … };
struct prestera_acl_rule_entry { … };
struct prestera_acl_ruleset { … };
struct prestera_acl_vtcam { … };
static const struct rhashtable_params prestera_acl_ruleset_ht_params = …;
static const struct rhashtable_params prestera_acl_rule_ht_params = …;
static const struct rhashtable_params __prestera_acl_rule_entry_ht_params = …;
int prestera_acl_chain_to_client(u32 chain_index, bool ingress, u32 *client)
{ … }
static bool prestera_acl_chain_is_supported(u32 chain_index, bool ingress)
{ … }
static struct prestera_acl_ruleset *
prestera_acl_ruleset_create(struct prestera_acl *acl,
struct prestera_flow_block *block,
u32 chain_index)
{ … }
int prestera_acl_ruleset_keymask_set(struct prestera_acl_ruleset *ruleset,
void *keymask)
{ … }
int prestera_acl_ruleset_offload(struct prestera_acl_ruleset *ruleset)
{ … }
static void prestera_acl_ruleset_destroy(struct prestera_acl_ruleset *ruleset)
{ … }
static struct prestera_acl_ruleset *
__prestera_acl_ruleset_lookup(struct prestera_acl *acl,
struct prestera_flow_block *block,
u32 chain_index)
{ … }
struct prestera_acl_ruleset *
prestera_acl_ruleset_lookup(struct prestera_acl *acl,
struct prestera_flow_block *block,
u32 chain_index)
{ … }
struct prestera_acl_ruleset *
prestera_acl_ruleset_get(struct prestera_acl *acl,
struct prestera_flow_block *block,
u32 chain_index)
{ … }
void prestera_acl_ruleset_put(struct prestera_acl_ruleset *ruleset)
{ … }
int prestera_acl_ruleset_bind(struct prestera_acl_ruleset *ruleset,
struct prestera_port *port)
{ … }
int prestera_acl_ruleset_unbind(struct prestera_acl_ruleset *ruleset,
struct prestera_port *port)
{ … }
static int prestera_acl_ruleset_block_bind(struct prestera_acl_ruleset *ruleset,
struct prestera_flow_block *block)
{ … }
static void
prestera_acl_ruleset_block_unbind(struct prestera_acl_ruleset *ruleset,
struct prestera_flow_block *block)
{ … }
static void
prestera_acl_ruleset_prio_refresh(struct prestera_acl *acl,
struct prestera_acl_ruleset *ruleset)
{ … }
void
prestera_acl_rule_keymask_pcl_id_set(struct prestera_acl_rule *rule, u16 pcl_id)
{ … }
struct prestera_acl_rule *
prestera_acl_rule_lookup(struct prestera_acl_ruleset *ruleset,
unsigned long cookie)
{ … }
u32 prestera_acl_ruleset_index_get(const struct prestera_acl_ruleset *ruleset)
{ … }
void prestera_acl_ruleset_prio_get(struct prestera_acl_ruleset *ruleset,
u32 *prio_min, u32 *prio_max)
{ … }
bool prestera_acl_ruleset_is_offload(struct prestera_acl_ruleset *ruleset)
{ … }
struct prestera_acl_rule *
prestera_acl_rule_create(struct prestera_acl_ruleset *ruleset,
unsigned long cookie, u32 chain_index)
{ … }
void prestera_acl_rule_priority_set(struct prestera_acl_rule *rule,
u32 priority)
{ … }
void prestera_acl_rule_destroy(struct prestera_acl_rule *rule)
{ … }
static void prestera_acl_ruleset_prio_update(struct prestera_acl_ruleset *ruleset,
u32 prio)
{ … }
int prestera_acl_rule_add(struct prestera_switch *sw,
struct prestera_acl_rule *rule)
{ … }
void prestera_acl_rule_del(struct prestera_switch *sw,
struct prestera_acl_rule *rule)
{ … }
int prestera_acl_rule_get_stats(struct prestera_acl *acl,
struct prestera_acl_rule *rule,
u64 *packets, u64 *bytes, u64 *last_use)
{ … }
struct prestera_acl_rule_entry *
prestera_acl_rule_entry_find(struct prestera_acl *acl,
struct prestera_acl_rule_entry_key *key)
{ … }
static int __prestera_acl_rule_entry2hw_del(struct prestera_switch *sw,
struct prestera_acl_rule_entry *e)
{ … }
static int __prestera_acl_rule_entry2hw_add(struct prestera_switch *sw,
struct prestera_acl_rule_entry *e)
{ … }
static void
__prestera_acl_rule_entry_act_destruct(struct prestera_switch *sw,
struct prestera_acl_rule_entry *e)
{ … }
void prestera_acl_rule_entry_destroy(struct prestera_acl *acl,
struct prestera_acl_rule_entry *e)
{ … }
static int
__prestera_acl_rule_entry_act_construct(struct prestera_switch *sw,
struct prestera_acl_rule_entry *e,
struct prestera_acl_rule_entry_arg *arg)
{ … }
struct prestera_acl_rule_entry *
prestera_acl_rule_entry_create(struct prestera_acl *acl,
struct prestera_acl_rule_entry_key *key,
struct prestera_acl_rule_entry_arg *arg)
{ … }
static int __prestera_acl_vtcam_id_try_fit(struct prestera_acl *acl, u8 lookup,
void *keymask, u32 *vtcam_id)
{ … }
int prestera_acl_vtcam_id_get(struct prestera_acl *acl, u8 lookup, u8 dir,
void *keymask, u32 *vtcam_id)
{ … }
int prestera_acl_vtcam_id_put(struct prestera_acl *acl, u32 vtcam_id)
{ … }
int prestera_acl_init(struct prestera_switch *sw)
{ … }
void prestera_acl_fini(struct prestera_switch *sw)
{ … }