linux/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c

// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
// Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.

#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/tcp.h>
#include <linux/mlx5/fs.h>
#include <linux/mlx5/driver.h>
#include "mlx5_core.h"
#include "lib/fs_ttc.h"

#define MLX5_TTC_MAX_NUM_GROUPS
#define MLX5_TTC_GROUP_TCPUDP_SIZE

struct mlx5_fs_ttc_groups {};

static int mlx5_fs_ttc_table_size(const struct mlx5_fs_ttc_groups *groups)
{}

/* L3/L4 traffic type classifier */
struct mlx5_ttc_table {};

struct mlx5_flow_table *mlx5_get_ttc_flow_table(struct mlx5_ttc_table *ttc)
{}

static void mlx5_cleanup_ttc_rules(struct mlx5_ttc_table *ttc)
{}

struct mlx5_etype_proto {};

static struct mlx5_etype_proto ttc_rules[] =;

static struct mlx5_etype_proto ttc_tunnel_rules[] =;

enum TTC_GROUP_TYPE {};

static const struct mlx5_fs_ttc_groups ttc_groups[] =;

static const struct mlx5_fs_ttc_groups inner_ttc_groups[] =;

u8 mlx5_get_proto_by_tunnel_type(enum mlx5_tunnel_types tt)
{}

static bool mlx5_tunnel_proto_supported_rx(struct mlx5_core_dev *mdev,
					   u8 proto_type)
{}

static bool mlx5_tunnel_any_rx_proto_supported(struct mlx5_core_dev *mdev)
{}

bool mlx5_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
{}

static u8 mlx5_etype_to_ipv(u16 ethertype)
{}

static void mlx5_fs_ttc_set_match_proto(void *headers_c, void *headers_v,
					u8 proto, bool use_l4_type)
{}

static struct mlx5_flow_handle *
mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft,
		       struct mlx5_flow_destination *dest, u16 etype, u8 proto,
		       bool use_l4_type)
{}

static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
					 struct ttc_params *params,
					 struct mlx5_ttc_table *ttc,
					 bool use_l4_type)
{}

static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
					bool use_ipv,
					const struct mlx5_fs_ttc_groups *groups)
{}

static struct mlx5_flow_handle *
mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev,
			     struct mlx5_flow_table *ft,
			     struct mlx5_flow_destination *dest,
			     u16 etype, u8 proto, bool use_l4_type)
{}

static int mlx5_generate_inner_ttc_table_rules(struct mlx5_core_dev *dev,
					       struct ttc_params *params,
					       struct mlx5_ttc_table *ttc,
					       bool use_l4_type)
{}

static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc,
					      const struct mlx5_fs_ttc_groups *groups)
{}

struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev,
						   struct ttc_params *params)
{}

void mlx5_destroy_ttc_table(struct mlx5_ttc_table *ttc)
{}

struct mlx5_ttc_table *mlx5_create_ttc_table(struct mlx5_core_dev *dev,
					     struct ttc_params *params)
{}

int mlx5_ttc_fwd_dest(struct mlx5_ttc_table *ttc, enum mlx5_traffic_types type,
		      struct mlx5_flow_destination *new_dest)
{}

struct mlx5_flow_destination
mlx5_ttc_get_default_dest(struct mlx5_ttc_table *ttc,
			  enum mlx5_traffic_types type)
{}

int mlx5_ttc_fwd_default_dest(struct mlx5_ttc_table *ttc,
			      enum mlx5_traffic_types type)
{}