#include "lib/events.h"
#include "en.h"
#include "en_accel/ktls.h"
#include "en_accel/en_accel.h"
#include "en/ptp.h"
#include "en/port.h"
#ifdef CONFIG_PAGE_POOL_STATS
#include <net/page_pool/helpers.h>
#endif
void mlx5e_ethtool_put_stat(u64 **data, u64 val)
{ … }
static unsigned int stats_grps_num(struct mlx5e_priv *priv)
{ … }
unsigned int mlx5e_stats_total_num(struct mlx5e_priv *priv)
{ … }
void mlx5e_stats_update_ndo_stats(struct mlx5e_priv *priv)
{ … }
void mlx5e_stats_update(struct mlx5e_priv *priv)
{ … }
void mlx5e_stats_fill(struct mlx5e_priv *priv, u64 *data, int idx)
{ … }
void mlx5e_stats_fill_strings(struct mlx5e_priv *priv, u8 *data)
{ … }
static const struct counter_desc sw_stats_desc[] = …;
#define NUM_SW_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(sw)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(sw)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw)
{ … }
static void mlx5e_stats_grp_sw_update_stats_xdp_red(struct mlx5e_sw_stats *s,
struct mlx5e_xdpsq_stats *xdpsq_red_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_xdpsq(struct mlx5e_sw_stats *s,
struct mlx5e_xdpsq_stats *xdpsq_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_xsksq(struct mlx5e_sw_stats *s,
struct mlx5e_xdpsq_stats *xsksq_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_xskrq(struct mlx5e_sw_stats *s,
struct mlx5e_rq_stats *xskrq_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
struct mlx5e_rq_stats *rq_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_ch_stats(struct mlx5e_sw_stats *s,
struct mlx5e_ch_stats *ch_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_sq(struct mlx5e_sw_stats *s,
struct mlx5e_sq_stats *sq_stats)
{ … }
static void mlx5e_stats_grp_sw_update_stats_ptp(struct mlx5e_priv *priv,
struct mlx5e_sw_stats *s)
{ … }
static void mlx5e_stats_grp_sw_update_stats_qos(struct mlx5e_priv *priv,
struct mlx5e_sw_stats *s)
{ … }
#ifdef CONFIG_PAGE_POOL_STATS
static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c)
{ … }
#else
static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c)
{
}
#endif
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw)
{ … }
static const struct counter_desc q_stats_desc[] = …;
static const struct counter_desc drop_rq_stats_desc[] = …;
#define NUM_Q_COUNTERS …
#define NUM_DROP_RQ_COUNTERS …
static bool q_counter_any(struct mlx5e_priv *priv)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(qcnt)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(qcnt)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qcnt)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(qcnt)
{ … }
#define VNIC_ENV_OFF(c) …
static const struct counter_desc vnic_env_stats_steer_desc[] = …;
static const struct counter_desc vnic_env_stats_dev_oob_desc[] = …;
static const struct counter_desc vnic_env_stats_drop_desc[] = …;
#define NUM_VNIC_ENV_STEER_COUNTERS(dev) …
#define NUM_VNIC_ENV_DEV_OOB_COUNTERS(dev) …
#define NUM_VNIC_ENV_DROP_COUNTERS(dev) …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(vnic_env)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vnic_env)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vnic_env)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vnic_env)
{ … }
#define VPORT_COUNTER_OFF(c) …
static const struct counter_desc vport_stats_desc[] = …;
static const struct counter_desc vport_loopback_stats_desc[] = …;
#define NUM_VPORT_COUNTERS …
#define NUM_VPORT_LOOPBACK_COUNTERS(dev) …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(vport)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport)
{ … }
#define PPORT_802_3_OFF(c) …
static const struct counter_desc pport_802_3_stats_desc[] = …;
#define NUM_PPORT_802_3_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(802_3)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(802_3)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(802_3)
{ … }
#define MLX5_BASIC_PPCNT_SUPPORTED(mdev) …
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(802_3)
{ … }
#define MLX5E_READ_CTR64_BE_F(ptr, set, c) …
static int mlx5e_stats_get_ieee(struct mlx5_core_dev *mdev,
u32 *ppcnt_ieee_802_3)
{ … }
void mlx5e_stats_pause_get(struct mlx5e_priv *priv,
struct ethtool_pause_stats *pause_stats)
{ … }
void mlx5e_stats_eth_phy_get(struct mlx5e_priv *priv,
struct ethtool_eth_phy_stats *phy_stats)
{ … }
void mlx5e_stats_eth_mac_get(struct mlx5e_priv *priv,
struct ethtool_eth_mac_stats *mac_stats)
{ … }
void mlx5e_stats_eth_ctrl_get(struct mlx5e_priv *priv,
struct ethtool_eth_ctrl_stats *ctrl_stats)
{ … }
#define PPORT_2863_OFF(c) …
static const struct counter_desc pport_2863_stats_desc[] = …;
#define NUM_PPORT_2863_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(2863)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(2863)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2863)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(2863)
{ … }
#define PPORT_2819_OFF(c) …
static const struct counter_desc pport_2819_stats_desc[] = …;
#define NUM_PPORT_2819_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(2819)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(2819)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2819)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(2819)
{ … }
static const struct ethtool_rmon_hist_range mlx5e_rmon_ranges[] = …;
void mlx5e_stats_rmon_get(struct mlx5e_priv *priv,
struct ethtool_rmon_stats *rmon,
const struct ethtool_rmon_hist_range **ranges)
{ … }
void mlx5e_stats_ts_get(struct mlx5e_priv *priv,
struct ethtool_ts_stats *ts_stats)
{ … }
#define PPORT_PHY_STATISTICAL_OFF(c) …
static const struct counter_desc pport_phy_statistical_stats_desc[] = …;
static const struct counter_desc
pport_phy_statistical_err_lanes_stats_desc[] = …;
#define NUM_PPORT_PHY_STATISTICAL_COUNTERS …
#define NUM_PPORT_PHY_STATISTICAL_PER_LANE_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(phy)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(phy)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(phy)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(phy)
{ … }
void mlx5e_get_link_ext_stats(struct net_device *dev,
struct ethtool_link_ext_stats *stats)
{ … }
static int fec_num_lanes(struct mlx5_core_dev *dev)
{ … }
static int fec_active_mode(struct mlx5_core_dev *mdev)
{ … }
#define MLX5E_STATS_SET_FEC_BLOCK(idx) …
static void fec_set_fc_stats(struct ethtool_fec_stats *fec_stats,
u32 *ppcnt, u8 lanes)
{ … }
static void fec_set_rs_stats(struct ethtool_fec_stats *fec_stats, u32 *ppcnt)
{ … }
static void fec_set_block_stats(struct mlx5e_priv *priv,
struct ethtool_fec_stats *fec_stats)
{ … }
static void fec_set_corrected_bits_total(struct mlx5e_priv *priv,
struct ethtool_fec_stats *fec_stats)
{ … }
void mlx5e_stats_fec_get(struct mlx5e_priv *priv,
struct ethtool_fec_stats *fec_stats)
{ … }
#define PPORT_ETH_EXT_OFF(c) …
static const struct counter_desc pport_eth_ext_stats_desc[] = …;
#define NUM_PPORT_ETH_EXT_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(eth_ext)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(eth_ext)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(eth_ext)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(eth_ext)
{ … }
#define PCIE_PERF_OFF(c) …
static const struct counter_desc pcie_perf_stats_desc[] = …;
#define PCIE_PERF_OFF64(c) …
static const struct counter_desc pcie_perf_stats_desc64[] = …;
static const struct counter_desc pcie_perf_stall_stats_desc[] = …;
#define NUM_PCIE_PERF_COUNTERS …
#define NUM_PCIE_PERF_COUNTERS64 …
#define NUM_PCIE_PERF_STALL_COUNTERS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(pcie)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(pcie)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pcie)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(pcie)
{ … }
#define PPORT_PER_TC_PRIO_OFF(c) …
static const struct counter_desc pport_per_tc_prio_stats_desc[] = …;
#define NUM_PPORT_PER_TC_PRIO_COUNTERS …
#define PPORT_PER_TC_CONGEST_PRIO_OFF(c) …
static const struct counter_desc pport_per_tc_congest_prio_stats_desc[] = …;
#define NUM_PPORT_PER_TC_CONGEST_PRIO_COUNTERS …
static int mlx5e_grp_per_tc_prio_get_num_stats(struct mlx5e_priv *priv)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(per_port_buff_congest)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(per_port_buff_congest)
{ … }
static void mlx5e_grp_per_tc_prio_update_stats(struct mlx5e_priv *priv)
{ … }
static int mlx5e_grp_per_tc_congest_prio_get_num_stats(struct mlx5e_priv *priv)
{ … }
static void mlx5e_grp_per_tc_congest_prio_update_stats(struct mlx5e_priv *priv)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(per_port_buff_congest)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(per_port_buff_congest)
{ … }
#define PPORT_PER_PRIO_OFF(c) …
static const struct counter_desc pport_per_prio_traffic_stats_desc[] = …;
#define NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS …
static int mlx5e_grp_per_prio_traffic_get_num_stats(void)
{ … }
static void mlx5e_grp_per_prio_traffic_fill_strings(struct mlx5e_priv *priv,
u8 **data)
{ … }
static void mlx5e_grp_per_prio_traffic_fill_stats(struct mlx5e_priv *priv,
u64 **data)
{ … }
static const struct counter_desc pport_per_prio_pfc_stats_desc[] = …;
static const struct counter_desc pport_pfc_stall_stats_desc[] = …;
#define NUM_PPORT_PER_PRIO_PFC_COUNTERS …
#define NUM_PPORT_PFC_STALL_COUNTERS(priv) …
static unsigned long mlx5e_query_pfc_combined(struct mlx5e_priv *priv)
{ … }
static bool mlx5e_query_global_pause_combined(struct mlx5e_priv *priv)
{ … }
static int mlx5e_grp_per_prio_pfc_get_num_stats(struct mlx5e_priv *priv)
{ … }
static void mlx5e_grp_per_prio_pfc_fill_strings(struct mlx5e_priv *priv,
u8 **data)
{ … }
static void mlx5e_grp_per_prio_pfc_fill_stats(struct mlx5e_priv *priv,
u64 **data)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(per_prio)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(per_prio)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(per_prio)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(per_prio)
{ … }
static const struct counter_desc mlx5e_pme_status_desc[] = …;
static const struct counter_desc mlx5e_pme_error_desc[] = …;
#define NUM_PME_STATUS_STATS …
#define NUM_PME_ERR_STATS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(pme)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(pme)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pme)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(pme) { … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(tls)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(tls)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(tls)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(tls) { … }
static const struct counter_desc rq_stats_desc[] = …;
static const struct counter_desc sq_stats_desc[] = …;
static const struct counter_desc rq_xdpsq_stats_desc[] = …;
static const struct counter_desc xdpsq_stats_desc[] = …;
static const struct counter_desc xskrq_stats_desc[] = …;
static const struct counter_desc xsksq_stats_desc[] = …;
static const struct counter_desc ch_stats_desc[] = …;
static const struct counter_desc ptp_sq_stats_desc[] = …;
static const struct counter_desc ptp_ch_stats_desc[] = …;
static const struct counter_desc ptp_cq_stats_desc[] = …;
static const struct counter_desc ptp_rq_stats_desc[] = …;
static const struct counter_desc qos_sq_stats_desc[] = …;
#define NUM_RQ_STATS …
#define NUM_SQ_STATS …
#define NUM_XDPSQ_STATS …
#define NUM_RQ_XDPSQ_STATS …
#define NUM_XSKRQ_STATS …
#define NUM_XSKSQ_STATS …
#define NUM_CH_STATS …
#define NUM_PTP_SQ_STATS …
#define NUM_PTP_CH_STATS …
#define NUM_PTP_CQ_STATS …
#define NUM_PTP_RQ_STATS …
#define NUM_QOS_SQ_STATS …
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(qos)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(qos)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qos)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(qos) { … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ptp)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ptp)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ptp)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ptp) { … }
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(channels)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(channels)
{ … }
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(channels) { … }
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
MLX5E_DEFINE_STATS_GRP(…);
static MLX5E_DEFINE_STATS_GRP(tls, 0);
MLX5E_DEFINE_STATS_GRP(…);
static MLX5E_DEFINE_STATS_GRP(qos, 0);
mlx5e_stats_grp_t mlx5e_nic_stats_grps[] = …;
unsigned int mlx5e_nic_stats_grps_num(struct mlx5e_priv *priv)
{ … }