#include <linux/skbuff.h>
#include <net/psample.h>
#include "en/mapping.h"
#include "en/tc/post_act.h"
#include "en/tc/act/sample.h"
#include "en/mod_hdr.h"
#include "sample.h"
#include "eswitch.h"
#include "en_tc.h"
#include "fs_core.h"
#define MLX5_ESW_VPORT_TBL_SIZE_SAMPLE …
static struct esw_vport_tbl_namespace mlx5_esw_vport_tbl_sample_ns = …;
struct mlx5e_tc_psample { … };
struct mlx5e_sampler { … };
struct mlx5e_sample_flow { … };
struct mlx5e_sample_restore { … };
static int
sampler_termtbl_create(struct mlx5e_tc_psample *tc_psample)
{ … }
static void
sampler_termtbl_destroy(struct mlx5e_tc_psample *tc_psample)
{ … }
static int
sampler_obj_create(struct mlx5_core_dev *mdev, struct mlx5e_sampler *sampler)
{ … }
static void
sampler_obj_destroy(struct mlx5_core_dev *mdev, u32 sampler_id)
{ … }
static u32
sampler_hash(u32 sample_ratio, u32 default_table_id)
{ … }
static int
sampler_cmp(u32 sample_ratio1, u32 default_table_id1, u32 sample_ratio2, u32 default_table_id2)
{ … }
static struct mlx5e_sampler *
sampler_get(struct mlx5e_tc_psample *tc_psample, u32 sample_ratio, u32 default_table_id)
{ … }
static void
sampler_put(struct mlx5e_tc_psample *tc_psample, struct mlx5e_sampler *sampler)
{ … }
static struct mlx5_modify_hdr *
sample_modify_hdr_get(struct mlx5_core_dev *mdev, u32 obj_id,
struct mlx5e_tc_mod_hdr_acts *mod_acts)
{ … }
static struct mlx5e_sample_restore *
sample_restore_get(struct mlx5e_tc_psample *tc_psample, u32 obj_id,
struct mlx5e_tc_mod_hdr_acts *mod_acts)
{ … }
static void
sample_restore_put(struct mlx5e_tc_psample *tc_psample, struct mlx5e_sample_restore *restore)
{ … }
void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_obj)
{ … }
static int
add_post_rule(struct mlx5_eswitch *esw, struct mlx5e_sample_flow *sample_flow,
struct mlx5_flow_spec *spec, struct mlx5_flow_attr *attr,
u32 *default_tbl_id)
{ … }
static void
del_post_rule(struct mlx5_eswitch *esw, struct mlx5e_sample_flow *sample_flow,
struct mlx5_flow_attr *attr)
{ … }
struct mlx5_flow_handle *
mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
struct mlx5_flow_spec *spec,
struct mlx5_flow_attr *attr)
{ … }
void
mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,
struct mlx5_flow_handle *rule,
struct mlx5_flow_attr *attr)
{ … }
struct mlx5e_tc_psample *
mlx5e_tc_sample_init(struct mlx5_eswitch *esw, struct mlx5e_post_act *post_act)
{ … }
void
mlx5e_tc_sample_cleanup(struct mlx5e_tc_psample *tc_psample)
{ … }