#include <linux/rhashtable.h>
#include "ef100_nic.h"
#include "mae.h"
#include "mcdi.h"
#include "mcdi_pcol.h"
#include "mcdi_pcol_mae.h"
#include "tc_encap_actions.h"
#include "tc_conntrack.h"
int efx_mae_allocate_mport(struct efx_nic *efx, u32 *id, u32 *label)
{ … }
int efx_mae_free_mport(struct efx_nic *efx, u32 id)
{ … }
void efx_mae_mport_wire(struct efx_nic *efx, u32 *out)
{ … }
void efx_mae_mport_uplink(struct efx_nic *efx __always_unused, u32 *out)
{ … }
void efx_mae_mport_vf(struct efx_nic *efx __always_unused, u32 vf_id, u32 *out)
{ … }
void efx_mae_mport_mport(struct efx_nic *efx __always_unused, u32 mport_id, u32 *out)
{ … }
int efx_mae_fw_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id)
{ … }
int efx_mae_start_counters(struct efx_nic *efx, struct efx_rx_queue *rx_queue)
{ … }
static bool efx_mae_counters_flushed(u32 *flush_gen, u32 *seen_gen)
{ … }
int efx_mae_stop_counters(struct efx_nic *efx, struct efx_rx_queue *rx_queue)
{ … }
void efx_mae_counters_grant_credits(struct work_struct *work)
{ … }
static int efx_mae_table_get_desc(struct efx_nic *efx,
struct efx_tc_table_desc *desc,
u32 table_id)
{ … }
static int efx_mae_table_hook_find(u16 n_fields,
struct efx_tc_table_field_fmt *fields,
u16 field_id)
{ … }
#define TABLE_FIND_KEY(_desc, _id) …
#define TABLE_FIND_RESP(_desc, _id) …
#define TABLE_HOOK_KEY(_meta, _name, _mcdi_name) …
#define TABLE_HOOK_RESP(_meta, _name, _mcdi_name) …
static int efx_mae_table_hook_ct(struct efx_nic *efx,
struct efx_tc_table_ct *meta_ct)
{ … }
static void efx_mae_table_free_desc(struct efx_tc_table_desc *desc)
{ … }
static bool efx_mae_check_table_exists(struct efx_nic *efx, u32 tbl_req)
{ … }
int efx_mae_get_tables(struct efx_nic *efx)
{ … }
void efx_mae_free_tables(struct efx_nic *efx)
{ … }
static int efx_mae_get_basic_caps(struct efx_nic *efx, struct mae_caps *caps)
{ … }
static int efx_mae_get_rule_fields(struct efx_nic *efx, u32 cmd,
u8 *field_support)
{ … }
int efx_mae_get_caps(struct efx_nic *efx, struct mae_caps *caps)
{ … }
#define is_prefix_byte(_x) …
enum mask_type { … };
static const char *mask_type_name(enum mask_type typ)
{ … }
static enum mask_type classify_mask(const u8 *mask, size_t len)
{ … }
static int efx_mae_match_check_cap_typ(u8 support, enum mask_type typ)
{ … }
#define CHECK …
#define CHECK_BIT …
int efx_mae_match_check_caps(struct efx_nic *efx,
const struct efx_tc_match_fields *mask,
struct netlink_ext_ack *extack)
{ … }
#define UNSUPPORTED …
#define UNSUPPORTED_BIT(_field) …
int efx_mae_match_check_caps_lhs(struct efx_nic *efx,
const struct efx_tc_match_fields *mask,
struct netlink_ext_ack *extack)
{ … }
#undef UNSUPPORTED
#undef CHECK_BIT
#undef CHECK
#define CHECK …
int efx_mae_check_encap_match_caps(struct efx_nic *efx, bool ipv6,
u8 ip_tos_mask, __be16 udp_sport_mask,
struct netlink_ext_ack *extack)
{ … }
#undef CHECK
int efx_mae_check_encap_type_supported(struct efx_nic *efx, enum efx_encap_type typ)
{ … }
int efx_mae_allocate_counter(struct efx_nic *efx, struct efx_tc_counter *cnt)
{ … }
int efx_mae_free_counter(struct efx_nic *efx, struct efx_tc_counter *cnt)
{ … }
static int efx_mae_encap_type_to_mae_type(enum efx_encap_type type)
{ … }
int efx_mae_allocate_encap_md(struct efx_nic *efx,
struct efx_tc_encap_action *encap)
{ … }
int efx_mae_update_encap_md(struct efx_nic *efx,
struct efx_tc_encap_action *encap)
{ … }
int efx_mae_free_encap_md(struct efx_nic *efx,
struct efx_tc_encap_action *encap)
{ … }
int efx_mae_lookup_mport(struct efx_nic *efx, u32 vf_idx, u32 *id)
{ … }
static bool efx_mae_asl_id(u32 id)
{ … }
static const struct rhashtable_params efx_mae_mports_ht_params = …;
struct mae_mport_desc *efx_mae_get_mport(struct efx_nic *efx, u32 mport_id)
{ … }
static int efx_mae_add_mport(struct efx_nic *efx, struct mae_mport_desc *desc)
{ … }
void efx_mae_remove_mport(void *desc, void *arg)
{ … }
static int efx_mae_process_mport(struct efx_nic *efx,
struct mae_mport_desc *desc)
{ … }
#define MCDI_MPORT_JOURNAL_LEN …
int efx_mae_enumerate_mports(struct efx_nic *efx)
{ … }
int efx_mae_allocate_pedit_mac(struct efx_nic *efx,
struct efx_tc_mac_pedit_action *ped)
{ … }
void efx_mae_free_pedit_mac(struct efx_nic *efx,
struct efx_tc_mac_pedit_action *ped)
{ … }
int efx_mae_alloc_action_set(struct efx_nic *efx, struct efx_tc_action_set *act)
{ … }
int efx_mae_free_action_set(struct efx_nic *efx, u32 fw_id)
{ … }
int efx_mae_alloc_action_set_list(struct efx_nic *efx,
struct efx_tc_action_set_list *acts)
{ … }
int efx_mae_free_action_set_list(struct efx_nic *efx,
struct efx_tc_action_set_list *acts)
{ … }
int efx_mae_register_encap_match(struct efx_nic *efx,
struct efx_tc_encap_match *encap)
{ … }
int efx_mae_unregister_encap_match(struct efx_nic *efx,
struct efx_tc_encap_match *encap)
{ … }
static int efx_mae_populate_lhs_match_criteria(MCDI_DECLARE_STRUCT_PTR(match_crit),
const struct efx_tc_match *match)
{ … }
static int efx_mae_insert_lhs_outer_rule(struct efx_nic *efx,
struct efx_tc_lhs_rule *rule, u32 prio)
{ … }
static int efx_mae_populate_match_criteria(MCDI_DECLARE_STRUCT_PTR(match_crit),
const struct efx_tc_match *match);
static int efx_mae_insert_lhs_action_rule(struct efx_nic *efx,
struct efx_tc_lhs_rule *rule,
u32 prio)
{ … }
int efx_mae_insert_lhs_rule(struct efx_nic *efx, struct efx_tc_lhs_rule *rule,
u32 prio)
{ … }
static int efx_mae_remove_lhs_outer_rule(struct efx_nic *efx,
struct efx_tc_lhs_rule *rule)
{ … }
int efx_mae_remove_lhs_rule(struct efx_nic *efx, struct efx_tc_lhs_rule *rule)
{ … }
static int efx_mae_table_populate(struct efx_tc_table_field_fmt field,
__le32 *row, size_t row_bits,
void *value, size_t value_size)
{ … }
static int efx_mae_table_populate_bool(struct efx_tc_table_field_fmt field,
__le32 *row, size_t row_bits, bool value)
{ … }
static int efx_mae_table_populate_ipv4(struct efx_tc_table_field_fmt field,
__le32 *row, size_t row_bits, __be32 value)
{ … }
static int efx_mae_table_populate_u24(struct efx_tc_table_field_fmt field,
__le32 *row, size_t row_bits, u32 value)
{ … }
#define _TABLE_POPULATE(dst, dw, _field, _value) …
#define TABLE_POPULATE_KEY_IPV4(dst, _table, _field, _value) …
#define TABLE_POPULATE_KEY(dst, _table, _field, _value) …
#define TABLE_POPULATE_RESP_BOOL(dst, _table, _field, _value) …
#define TABLE_POPULATE_RESP(dst, _table, _field, _value) …
#define TABLE_POPULATE_RESP_U24(dst, _table, _field, _value) …
static int efx_mae_populate_ct_key(struct efx_nic *efx, __le32 *key, size_t kw,
struct efx_tc_ct_entry *conn)
{ … }
int efx_mae_insert_ct(struct efx_nic *efx, struct efx_tc_ct_entry *conn)
{ … }
int efx_mae_remove_ct(struct efx_nic *efx, struct efx_tc_ct_entry *conn)
{ … }
static int efx_mae_populate_match_criteria(MCDI_DECLARE_STRUCT_PTR(match_crit),
const struct efx_tc_match *match)
{ … }
int efx_mae_insert_rule(struct efx_nic *efx, const struct efx_tc_match *match,
u32 prio, u32 acts_id, u32 *id)
{ … }
int efx_mae_update_rule(struct efx_nic *efx, u32 acts_id, u32 id)
{ … }
int efx_mae_delete_rule(struct efx_nic *efx, u32 id)
{ … }
int efx_init_mae(struct efx_nic *efx)
{ … }
void efx_fini_mae(struct efx_nic *efx)
{ … }