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

/*
 * Copyright (c) 2016, 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/dim.h>
#include <linux/debugfs.h>
#include <linux/mlx5/fs.h>
#include <net/switchdev.h>
#include <net/pkt_cls.h>
#include <net/act_api.h>
#include <net/devlink.h>
#include <net/ipv6_stubs.h>

#include "eswitch.h"
#include "en.h"
#include "en/dim.h"
#include "en_rep.h"
#include "en/params.h"
#include "en/txrx.h"
#include "en_tc.h"
#include "en/rep/tc.h"
#include "en/rep/neigh.h"
#include "en/rep/bridge.h"
#include "en/devlink.h"
#include "fs_core.h"
#include "lib/mlx5.h"
#include "lib/devcom.h"
#include "lib/vxlan.h"
#define CREATE_TRACE_POINTS
#include "diag/en_rep_tracepoint.h"
#include "diag/reporter_vnic.h"
#include "en_accel/ipsec.h"
#include "en/tc/int_port.h"
#include "en/ptp.h"
#include "en/fs_ethtool.h"

#define MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE
#define MLX5E_REP_PARAMS_DEF_NUM_CHANNELS

static const char mlx5e_rep_driver_name[] =;

static void mlx5e_rep_get_drvinfo(struct net_device *dev,
				  struct ethtool_drvinfo *drvinfo)
{}

static const struct counter_desc sw_rep_stats_desc[] =;

static const struct counter_desc vport_rep_stats_desc[] =;

static const struct counter_desc vport_rep_loopback_stats_desc[] =;

#define NUM_VPORT_REP_SW_COUNTERS
#define NUM_VPORT_REP_HW_COUNTERS
#define NUM_VPORT_REP_LOOPBACK_COUNTERS(dev)

static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(sw_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(sw_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(vport_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport_rep)
{}

static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
{}

static int mlx5e_rep_query_aggr_q_counter(struct mlx5_core_dev *dev, int vport, void *out)
{}

static void mlx5e_rep_update_vport_q_counter(struct mlx5e_priv *priv)
{}

static void mlx5e_rep_get_strings(struct net_device *dev,
				  u32 stringset, u8 *data)
{}

static void mlx5e_rep_get_ethtool_stats(struct net_device *dev,
					struct ethtool_stats *stats, u64 *data)
{}

static int mlx5e_rep_get_sset_count(struct net_device *dev, int sset)
{}

static void
mlx5e_rep_get_ringparam(struct net_device *dev,
			struct ethtool_ringparam *param,
			struct kernel_ethtool_ringparam *kernel_param,
			struct netlink_ext_ack *extack)
{}

static int
mlx5e_rep_set_ringparam(struct net_device *dev,
			struct ethtool_ringparam *param,
			struct kernel_ethtool_ringparam *kernel_param,
			struct netlink_ext_ack *extack)
{}

static void mlx5e_rep_get_channels(struct net_device *dev,
				   struct ethtool_channels *ch)
{}

static int mlx5e_rep_set_channels(struct net_device *dev,
				  struct ethtool_channels *ch)
{}

static int mlx5e_rep_get_coalesce(struct net_device *netdev,
				  struct ethtool_coalesce *coal,
				  struct kernel_ethtool_coalesce *kernel_coal,
				  struct netlink_ext_ack *extack)
{}

static int mlx5e_rep_set_coalesce(struct net_device *netdev,
				  struct ethtool_coalesce *coal,
				  struct kernel_ethtool_coalesce *kernel_coal,
				  struct netlink_ext_ack *extack)
{}

static u32 mlx5e_rep_get_rxfh_key_size(struct net_device *netdev)
{}

static u32 mlx5e_rep_get_rxfh_indir_size(struct net_device *netdev)
{}

static const struct ethtool_ops mlx5e_rep_ethtool_ops =;

static void mlx5e_sqs2vport_stop(struct mlx5_eswitch *esw,
				 struct mlx5_eswitch_rep *rep)
{}

static int mlx5e_sqs2vport_add_peers_rules(struct mlx5_eswitch *esw, struct mlx5_eswitch_rep *rep,
					   struct mlx5e_rep_sq *rep_sq, int i)
{}

static int mlx5e_sqs2vport_start(struct mlx5_eswitch *esw,
				 struct mlx5_eswitch_rep *rep,
				 u32 *sqns_array, int sqns_num)
{}

static int
mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv)
{}

static void
mlx5e_remove_sqs_fwd_rules(struct mlx5e_priv *priv)
{}

static int
mlx5e_rep_add_meta_tunnel_rule(struct mlx5e_priv *priv)
{}

static void
mlx5e_rep_del_meta_tunnel_rule(struct mlx5e_priv *priv)
{}

void mlx5e_rep_activate_channels(struct mlx5e_priv *priv)
{}

void mlx5e_rep_deactivate_channels(struct mlx5e_priv *priv)
{}

static int mlx5e_rep_open(struct net_device *dev)
{}

static int mlx5e_rep_close(struct net_device *dev)
{}

bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)
{}

bool mlx5e_rep_has_offload_stats(const struct net_device *dev, int attr_id)
{}

static int
mlx5e_get_sw_stats64(const struct net_device *dev,
		     struct rtnl_link_stats64 *stats)
{}

int mlx5e_rep_get_offload_stats(int attr_id, const struct net_device *dev,
				void *sp)
{}

static void
mlx5e_rep_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
{}

static int mlx5e_rep_change_mtu(struct net_device *netdev, int new_mtu)
{}

static int mlx5e_rep_change_carrier(struct net_device *dev, bool new_carrier)
{}

static const struct net_device_ops mlx5e_netdev_ops_rep =;

bool mlx5e_eswitch_uplink_rep(const struct net_device *netdev)
{}

bool mlx5e_eswitch_vf_rep(const struct net_device *netdev)
{}

/* One indirect TIR set for outer. Inner not supported in reps. */
#define REP_NUM_INDIR_TIRS

static int mlx5e_rep_max_nch_limit(struct mlx5_core_dev *mdev)
{}

static void mlx5e_build_rep_params(struct net_device *netdev)
{}

static void mlx5e_build_rep_netdev(struct net_device *netdev,
				   struct mlx5_core_dev *mdev)
{}

static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
			  struct net_device *netdev)
{}

static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev,
			     struct net_device *netdev)
{}

static void mlx5e_cleanup_rep(struct mlx5e_priv *priv)
{}

static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
{}

static int mlx5e_create_rep_root_ft(struct mlx5e_priv *priv)
{}

static void mlx5e_destroy_rep_root_ft(struct mlx5e_priv *priv)
{}

static int mlx5e_create_rep_vport_rx_rule(struct mlx5e_priv *priv)
{}

static void rep_vport_rx_rule_destroy(struct mlx5e_priv *priv)
{}

int mlx5e_rep_bond_update(struct mlx5e_priv *priv, bool cleanup)
{}

static int mlx5e_init_rep_rx(struct mlx5e_priv *priv)
{}

static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
{}

static void mlx5e_rep_mpesw_work(struct work_struct *work)
{}

static int mlx5e_init_ul_rep_rx(struct mlx5e_priv *priv)
{}

static void mlx5e_cleanup_ul_rep_rx(struct mlx5e_priv *priv)
{}

static int mlx5e_init_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
{}

static void mlx5e_cleanup_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
{}

static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
{}

static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)
{}

static void mlx5e_rep_enable(struct mlx5e_priv *priv)
{}

static void mlx5e_rep_disable(struct mlx5e_priv *priv)
{}

static int mlx5e_update_rep_rx(struct mlx5e_priv *priv)
{}

static void mlx5e_rep_stats_update_ndo_stats(struct mlx5e_priv *priv)
{}

static int mlx5e_rep_event_mpesw(struct mlx5e_priv *priv)
{}

static int uplink_rep_async_event(struct notifier_block *nb, unsigned long event, void *data)
{}

static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)
{}

static void mlx5e_uplink_rep_disable(struct mlx5e_priv *priv)
{}

static MLX5E_DEFINE_STATS_GRP(sw_rep, 0);
static MLX5E_DEFINE_STATS_GRP(vport_rep, MLX5E_NDO_UPDATE_STATS);

/* The stats groups order is opposite to the update_stats() order calls */
static mlx5e_stats_grp_t mlx5e_rep_stats_grps[] =;

static unsigned int mlx5e_rep_stats_grps_num(struct mlx5e_priv *priv)
{}

/* The stats groups order is opposite to the update_stats() order calls */
static mlx5e_stats_grp_t mlx5e_ul_rep_stats_grps[] =;

static unsigned int mlx5e_ul_rep_stats_grps_num(struct mlx5e_priv *priv)
{}

static int
mlx5e_rep_vnic_reporter_diagnose(struct devlink_health_reporter *reporter,
				 struct devlink_fmsg *fmsg,
				 struct netlink_ext_ack *extack)
{}

static const struct devlink_health_reporter_ops mlx5_rep_vnic_reporter_ops =;

static void mlx5e_rep_vnic_reporter_create(struct mlx5e_priv *priv,
					   struct devlink_port *dl_port)
{}

static void mlx5e_rep_vnic_reporter_destroy(struct mlx5e_priv *priv)
{}

static const struct mlx5e_profile mlx5e_rep_profile =;

static const struct mlx5e_profile mlx5e_uplink_rep_profile =;

/* e-Switch vport representors */
static int
mlx5e_vport_uplink_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
{}

static void
mlx5e_vport_uplink_rep_unload(struct mlx5e_rep_priv *rpriv)
{}

static int
mlx5e_vport_vf_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
{}

static int
mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
{}

static void
mlx5e_vport_rep_unload(struct mlx5_eswitch_rep *rep)
{}

static void *mlx5e_vport_rep_get_proto_dev(struct mlx5_eswitch_rep *rep)
{}

static void mlx5e_vport_rep_event_unpair(struct mlx5_eswitch_rep *rep,
					 struct mlx5_eswitch *peer_esw)
{}

static int mlx5e_vport_rep_event_pair(struct mlx5_eswitch *esw,
				      struct mlx5_eswitch_rep *rep,
				      struct mlx5_eswitch *peer_esw)
{}

static int mlx5e_vport_rep_event(struct mlx5_eswitch *esw,
				 struct mlx5_eswitch_rep *rep,
				 enum mlx5_switchdev_event event,
				 void *data)
{}

static const struct mlx5_eswitch_rep_ops rep_ops =;

static int mlx5e_rep_probe(struct auxiliary_device *adev,
			   const struct auxiliary_device_id *id)
{}

static void mlx5e_rep_remove(struct auxiliary_device *adev)
{}

static const struct auxiliary_device_id mlx5e_rep_id_table[] =;

MODULE_DEVICE_TABLE(auxiliary, mlx5e_rep_id_table);

static struct auxiliary_driver mlx5e_rep_driver =;

int mlx5e_rep_init(void)
{}

void mlx5e_rep_cleanup(void)
{}