linux/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

/*
 * Copyright (c) 2015, Mellanox Technologies. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include <linux/debugfs.h>
#include <linux/list.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/tcp.h>
#include <linux/mlx5/fs.h>
#include <linux/mlx5/mpfs.h>
#include "en_tc.h"
#include "lib/mpfs.h"
#include "en/ptp.h"
#include "en/fs_ethtool.h"

struct mlx5e_flow_steering {};

static int mlx5e_add_l2_flow_rule(struct mlx5e_flow_steering *fs,
				  struct mlx5e_l2_rule *ai, int type);
static void mlx5e_del_l2_flow_rule(struct mlx5e_flow_steering *fs,
				   struct mlx5e_l2_rule *ai);

enum {};

enum {};

enum {};

struct mlx5e_l2_hash_node {};

static inline int mlx5e_hash_l2(const u8 *addr)
{}

struct dentry *mlx5e_fs_get_debugfs_root(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_add_l2_to_hash(struct hlist_head *hash, const u8 *addr)
{}

static void mlx5e_del_l2_from_hash(struct mlx5e_l2_hash_node *hn)
{}

struct mlx5e_vlan_table {};

unsigned long *mlx5e_vlan_get_active_svlans(struct mlx5e_vlan_table *vlan)
{}

struct mlx5_flow_table *mlx5e_vlan_get_flowtable(struct mlx5e_vlan_table *vlan)
{}

static int mlx5e_vport_context_update_vlans(struct mlx5e_flow_steering *fs)
{}

enum mlx5e_vlan_rule_type {};

static int __mlx5e_add_vlan_rule(struct mlx5e_flow_steering *fs,
				 enum mlx5e_vlan_rule_type rule_type,
				 u16 vid, struct mlx5_flow_spec *spec)
{}

static int mlx5e_add_vlan_rule(struct mlx5e_flow_steering *fs,
			       enum mlx5e_vlan_rule_type rule_type, u16 vid)
{}

static void mlx5e_fs_del_vlan_rule(struct mlx5e_flow_steering *fs,
				   enum mlx5e_vlan_rule_type rule_type, u16 vid)
{}

static void mlx5e_fs_del_any_vid_rules(struct mlx5e_flow_steering *fs)
{}

static int mlx5e_fs_add_any_vid_rules(struct mlx5e_flow_steering *fs)
{}

static struct mlx5_flow_handle *
mlx5e_add_trap_rule(struct mlx5_flow_table *ft, int trap_id, int tir_num)
{}

int mlx5e_add_vlan_trap(struct mlx5e_flow_steering *fs, int trap_id, int tir_num)
{}

void mlx5e_remove_vlan_trap(struct mlx5e_flow_steering *fs)
{}

int mlx5e_add_mac_trap(struct mlx5e_flow_steering *fs, int trap_id, int tir_num)
{}

void mlx5e_remove_mac_trap(struct mlx5e_flow_steering *fs)
{}

void mlx5e_enable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc)
{}

void mlx5e_disable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc)
{}

static int mlx5e_vlan_rx_add_cvid(struct mlx5e_flow_steering *fs, u16 vid)
{}

static int mlx5e_vlan_rx_add_svid(struct mlx5e_flow_steering *fs,
				  struct net_device *netdev, u16 vid)
{}

int mlx5e_fs_vlan_rx_add_vid(struct mlx5e_flow_steering *fs,
			     struct net_device *netdev,
			     __be16 proto, u16 vid)
{}

int mlx5e_fs_vlan_rx_kill_vid(struct mlx5e_flow_steering *fs,
			      struct net_device *netdev,
			      __be16 proto, u16 vid)
{}

static void mlx5e_fs_add_vlan_rules(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_del_vlan_rules(struct mlx5e_flow_steering *fs)
{}

#define mlx5e_for_each_hash_node(hn, tmp, hash, i)

static void mlx5e_execute_l2_action(struct mlx5e_flow_steering *fs,
				    struct mlx5e_l2_hash_node *hn)
{}

static void mlx5e_sync_netdev_addr(struct mlx5e_flow_steering *fs,
				   struct net_device *netdev)
{}

static void mlx5e_fill_addr_array(struct mlx5e_flow_steering *fs, int list_type,
				  struct net_device *ndev,
				  u8 addr_array[][ETH_ALEN], int size)
{}

static void mlx5e_vport_context_update_addr_list(struct mlx5e_flow_steering *fs,
						 struct net_device *netdev,
						 int list_type)
{}

static void mlx5e_vport_context_update(struct mlx5e_flow_steering *fs,
				       struct net_device *netdev)
{}

static void mlx5e_apply_netdev_addr(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_handle_netdev_addr(struct mlx5e_flow_steering *fs,
				     struct net_device *netdev)
{}

#define MLX5E_PROMISC_GROUP0_SIZE
#define MLX5E_PROMISC_TABLE_SIZE

static int mlx5e_add_promisc_rule(struct mlx5e_flow_steering *fs)
{}

static int mlx5e_create_promisc_table(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_del_promisc_rule(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_destroy_promisc_table(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs,
			       struct net_device *netdev)
{}

static void mlx5e_destroy_groups(struct mlx5e_flow_table *ft)
{}

void mlx5e_fs_init_l2_addr(struct mlx5e_flow_steering *fs, struct net_device *netdev)
{}

void mlx5e_destroy_flow_table(struct mlx5e_flow_table *ft)
{}

static void mlx5e_set_inner_ttc_params(struct mlx5e_flow_steering *fs,
				       struct mlx5e_rx_res *rx_res,
				       struct ttc_params *ttc_params)
{}

void mlx5e_set_ttc_params(struct mlx5e_flow_steering *fs,
			  struct mlx5e_rx_res *rx_res,
			  struct ttc_params *ttc_params, bool tunnel)

{}

static void mlx5e_del_l2_flow_rule(struct mlx5e_flow_steering *fs,
				   struct mlx5e_l2_rule *ai)
{}

static int mlx5e_add_l2_flow_rule(struct mlx5e_flow_steering *fs,
				  struct mlx5e_l2_rule *ai, int type)
{}

#define MLX5E_NUM_L2_GROUPS
#define MLX5E_L2_GROUP1_SIZE
#define MLX5E_L2_GROUP2_SIZE
#define MLX5E_L2_GROUP_TRAP_SIZE
#define MLX5E_L2_TABLE_SIZE
static int mlx5e_create_l2_table_groups(struct mlx5e_l2_table *l2_table)
{}

static void mlx5e_destroy_l2_table(struct mlx5e_flow_steering *fs)
{}

static int mlx5e_create_l2_table(struct mlx5e_flow_steering *fs)
{}

#define MLX5E_NUM_VLAN_GROUPS
#define MLX5E_VLAN_GROUP0_SIZE
#define MLX5E_VLAN_GROUP1_SIZE
#define MLX5E_VLAN_GROUP2_SIZE
#define MLX5E_VLAN_GROUP3_SIZE
#define MLX5E_VLAN_GROUP_TRAP_SIZE
#define MLX5E_VLAN_TABLE_SIZE

static int __mlx5e_create_vlan_table_groups(struct mlx5e_flow_table *ft, u32 *in,
					    int inlen)
{}

static int mlx5e_create_vlan_table_groups(struct mlx5e_flow_table *ft)
{}

static int mlx5e_fs_create_vlan_table(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_destroy_vlan_table(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_destroy_inner_ttc_table(struct mlx5e_flow_steering *fs)
{}

void mlx5e_destroy_ttc_table(struct mlx5e_flow_steering *fs)
{}

static int mlx5e_create_inner_ttc_table(struct mlx5e_flow_steering *fs,
					struct mlx5e_rx_res *rx_res)
{}

int mlx5e_create_ttc_table(struct mlx5e_flow_steering *fs,
			   struct mlx5e_rx_res *rx_res)
{}

int mlx5e_create_flow_steering(struct mlx5e_flow_steering *fs,
			       struct mlx5e_rx_res *rx_res,
			       const struct mlx5e_profile *profile,
			       struct net_device *netdev)
{}

void mlx5e_destroy_flow_steering(struct mlx5e_flow_steering *fs, bool ntuple,
				 const struct mlx5e_profile *profile)
{}

static int mlx5e_fs_vlan_alloc(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_fs_vlan_free(struct mlx5e_flow_steering *fs)
{}

struct mlx5e_vlan_table *mlx5e_fs_get_vlan(struct mlx5e_flow_steering *fs)
{}

static int mlx5e_fs_tc_alloc(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_fs_tc_free(struct mlx5e_flow_steering *fs)
{}

struct mlx5e_tc_table *mlx5e_fs_get_tc(struct mlx5e_flow_steering *fs)
{}

#ifdef CONFIG_MLX5_EN_RXNFC
static int mlx5e_fs_ethtool_alloc(struct mlx5e_flow_steering *fs)
{}

static void mlx5e_fs_ethtool_free(struct mlx5e_flow_steering *fs)
{}

struct mlx5e_ethtool_steering *mlx5e_fs_get_ethtool(struct mlx5e_flow_steering *fs)
{}
#else
static int mlx5e_fs_ethtool_alloc(struct mlx5e_flow_steering *fs)
{ return 0; }
static void mlx5e_fs_ethtool_free(struct mlx5e_flow_steering *fs) { }
#endif

static void mlx5e_fs_debugfs_init(struct mlx5e_flow_steering *fs,
				  struct dentry *dfs_root)
{}

struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
					  struct mlx5_core_dev *mdev,
					  bool state_destroy,
					  struct dentry *dfs_root)
{}

void mlx5e_fs_cleanup(struct mlx5e_flow_steering *fs)
{}

struct mlx5e_l2_table *mlx5e_fs_get_l2(struct mlx5e_flow_steering *fs)
{}

struct mlx5_flow_namespace *mlx5e_fs_get_ns(struct mlx5e_flow_steering *fs, bool egress)
{}

void mlx5e_fs_set_ns(struct mlx5e_flow_steering *fs, struct mlx5_flow_namespace *ns, bool egress)
{}

struct mlx5_ttc_table *mlx5e_fs_get_ttc(struct mlx5e_flow_steering *fs, bool inner)
{}

void mlx5e_fs_set_ttc(struct mlx5e_flow_steering *fs, struct mlx5_ttc_table *ttc, bool inner)
{}

#ifdef CONFIG_MLX5_EN_ARFS
struct mlx5e_arfs_tables *mlx5e_fs_get_arfs(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_arfs(struct mlx5e_flow_steering *fs, struct mlx5e_arfs_tables *arfs)
{}
#endif

struct mlx5e_ptp_fs *mlx5e_fs_get_ptp(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_ptp(struct mlx5e_flow_steering *fs, struct mlx5e_ptp_fs *ptp_fs)
{}

struct mlx5e_fs_any *mlx5e_fs_get_any(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_any(struct mlx5e_flow_steering *fs, struct mlx5e_fs_any *any)
{}

#ifdef CONFIG_MLX5_EN_TLS
struct mlx5e_accel_fs_tcp *mlx5e_fs_get_accel_tcp(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_accel_tcp(struct mlx5e_flow_steering *fs, struct mlx5e_accel_fs_tcp *accel_tcp)
{}
#endif

void mlx5e_fs_set_state_destroy(struct mlx5e_flow_steering *fs, bool state_destroy)
{}

void mlx5e_fs_set_vlan_strip_disable(struct mlx5e_flow_steering *fs,
				     bool vlan_strip_disable)
{}

struct mlx5e_fs_udp *mlx5e_fs_get_udp(struct mlx5e_flow_steering *fs)
{}

void mlx5e_fs_set_udp(struct mlx5e_flow_steering *fs, struct mlx5e_fs_udp *udp)
{}

struct mlx5_core_dev *mlx5e_fs_get_mdev(struct mlx5e_flow_steering *fs)
{}