#include <net/tc_act/tc_csum.h>
#include <net/tc_act/tc_ct.h>
#include "conntrack.h"
#include "../nfp_port.h"
const struct rhashtable_params nfp_tc_ct_merge_params = …;
const struct rhashtable_params nfp_nft_ct_merge_params = …;
static struct flow_action_entry *get_flow_act(struct flow_rule *rule,
enum flow_action_id act_id);
static void *get_hashentry(struct rhashtable *ht, void *key,
const struct rhashtable_params params, size_t size)
{ … }
bool is_pre_ct_flow(struct flow_cls_offload *flow)
{ … }
bool is_post_ct_flow(struct flow_cls_offload *flow)
{ … }
static void *get_mangled_key(struct flow_rule *rule, void *buf,
u32 offset, size_t key_sz,
enum flow_action_mangle_base htype)
{ … }
#define NFP_IPV4_TOS_MASK …
#define NFP_IPV4_TTL_MASK …
#define NFP_IPV6_TCLASS_MASK …
#define NFP_IPV6_HLIMIT_MASK …
static void *get_mangled_tos_ttl(struct flow_rule *rule, void *buf,
bool is_v6)
{ … }
static bool nfp_ct_merge_check_cannot_skip(struct nfp_fl_ct_flow_entry *entry1,
struct nfp_fl_ct_flow_entry *entry2)
{ … }
static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
struct nfp_fl_ct_flow_entry *entry2)
{ … }
static int nfp_ct_check_vlan_merge(struct flow_action_entry *a_in,
struct flow_rule *rule)
{ … }
static int nfp_ct_merge_extra_check(struct nfp_fl_ct_flow_entry *nft_entry,
struct nfp_fl_ct_tc_merge *tc_m_entry)
{ … }
static int nfp_ct_merge_act_check(struct nfp_fl_ct_flow_entry *pre_ct_entry,
struct nfp_fl_ct_flow_entry *post_ct_entry,
struct nfp_fl_ct_flow_entry *nft_entry)
{ … }
static int nfp_ct_check_meta(struct nfp_fl_ct_flow_entry *post_ct_entry,
struct nfp_fl_ct_flow_entry *nft_entry)
{ … }
static int
nfp_fl_calc_key_layers_sz(struct nfp_fl_key_ls in_key_ls, uint16_t *map)
{ … }
static void nfp_fl_get_csum_flag(struct flow_action_entry *a_in, u8 ip_proto, u32 *csum)
{ … }
static int nfp_fl_merge_actions_offload(struct flow_rule **rules,
struct nfp_flower_priv *priv,
struct net_device *netdev,
struct nfp_fl_payload *flow_pay,
int num_rules)
{ … }
static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry)
{ … }
static int nfp_fl_ct_del_offload(struct nfp_app *app, unsigned long cookie,
struct net_device *netdev)
{ … }
static int nfp_ct_do_nft_merge(struct nfp_fl_ct_zone_entry *zt,
struct nfp_fl_ct_flow_entry *nft_entry,
struct nfp_fl_ct_tc_merge *tc_m_entry)
{ … }
static int nfp_ct_do_tc_merge(struct nfp_fl_ct_zone_entry *zt,
struct nfp_fl_ct_flow_entry *ct_entry1,
struct nfp_fl_ct_flow_entry *ct_entry2)
{ … }
static struct
nfp_fl_ct_zone_entry *get_nfp_zone_entry(struct nfp_flower_priv *priv,
u16 zone, bool wildcarded)
{ … }
static struct net_device *get_netdev_from_rule(struct flow_rule *rule)
{ … }
static void nfp_nft_ct_translate_mangle_action(struct flow_action_entry *mangle_action)
{ … }
static int nfp_nft_ct_set_flow_flag(struct flow_action_entry *act,
struct nfp_fl_ct_flow_entry *entry)
{ … }
static struct
nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt,
struct net_device *netdev,
struct flow_cls_offload *flow,
bool is_nft, struct netlink_ext_ack *extack)
{ … }
static void cleanup_nft_merge_entry(struct nfp_fl_nft_tc_merge *m_entry)
{ … }
static void nfp_free_nft_merge_children(void *entry, bool is_nft_flow)
{ … }
static void nfp_del_tc_merge_entry(struct nfp_fl_ct_tc_merge *m_ent)
{ … }
static void nfp_free_tc_merge_children(struct nfp_fl_ct_flow_entry *entry)
{ … }
void nfp_fl_ct_clean_flow_entry(struct nfp_fl_ct_flow_entry *entry)
{ … }
static struct flow_action_entry *get_flow_act_ct(struct flow_rule *rule)
{ … }
static struct flow_action_entry *get_flow_act(struct flow_rule *rule,
enum flow_action_id act_id)
{ … }
static void
nfp_ct_merge_tc_entries(struct nfp_fl_ct_flow_entry *ct_entry1,
struct nfp_fl_ct_zone_entry *zt_src,
struct nfp_fl_ct_zone_entry *zt_dst)
{ … }
static void
nfp_ct_merge_nft_with_tc(struct nfp_fl_ct_flow_entry *nft_entry,
struct nfp_fl_ct_zone_entry *zt)
{ … }
int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv,
struct net_device *netdev,
struct flow_cls_offload *flow,
struct netlink_ext_ack *extack,
struct nfp_fl_nft_tc_merge *m_entry)
{ … }
int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv,
struct net_device *netdev,
struct flow_cls_offload *flow,
struct netlink_ext_ack *extack)
{ … }
int nfp_fl_create_new_pre_ct(struct nfp_fl_nft_tc_merge *m_entry)
{ … }
static void
nfp_fl_ct_sub_stats(struct nfp_fl_nft_tc_merge *nft_merge,
enum ct_entry_type type, u64 *m_pkts,
u64 *m_bytes, u64 *m_used)
{ … }
int nfp_fl_ct_stats(struct flow_cls_offload *flow,
struct nfp_fl_ct_map_entry *ct_map_ent)
{ … }
static bool
nfp_fl_ct_offload_nft_supported(struct flow_cls_offload *flow)
{ … }
static int
nfp_fl_ct_offload_nft_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_cls_offload *flow)
{ … }
int nfp_fl_ct_handle_nft_flow(enum tc_setup_type type, void *type_data, void *cb_priv)
{ … }
static void
nfp_fl_ct_clean_nft_entries(struct nfp_fl_ct_zone_entry *zt)
{ … }
int nfp_fl_ct_del_flow(struct nfp_fl_ct_map_entry *ct_map_ent)
{ … }