Loading drivers/net/ethernet/mellanox/mlx5/core/en.h +5 −7 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ struct mlx5e_params { struct { u16 mode; u8 num_tc; struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE]; } mqprio; bool rx_cqe_compress_def; bool tunneled_offload_en; Loading Loading @@ -845,6 +846,7 @@ struct mlx5e_priv { struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS]; struct mlx5e_channel_stats trap_stats; struct mlx5e_ptp_stats ptp_stats; u16 stats_nch; u16 max_nch; u8 max_opened_tc; bool tx_ptp_opened; Loading Loading @@ -1100,12 +1102,6 @@ int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, struct ethtool_pauseparam *pauseparam); /* mlx5e generic netdev management API */ static inline unsigned int mlx5e_calc_max_nch(struct mlx5e_priv *priv, const struct mlx5e_profile *profile) { return priv->netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1); } static inline bool mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev) { Loading @@ -1114,11 +1110,13 @@ mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev) } int mlx5e_priv_init(struct mlx5e_priv *priv, const struct mlx5e_profile *profile, struct net_device *netdev, struct mlx5_core_dev *mdev); void mlx5e_priv_cleanup(struct mlx5e_priv *priv); struct net_device * mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int rxqs); mlx5e_create_netdev(struct mlx5_core_dev *mdev, const struct mlx5e_profile *profile, unsigned int txqs, unsigned int rxqs); int mlx5e_attach_netdev(struct mlx5e_priv *priv); void mlx5e_detach_netdev(struct mlx5e_priv *priv); void mlx5e_destroy_netdev(struct mlx5e_priv *priv); Loading drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, { int ch, i = 0; for (ch = 0; ch < priv->max_nch; ch++) { for (ch = 0; ch < priv->stats_nch; ch++) { void *buf = data + i; if (WARN_ON_ONCE(buf + Loading @@ -51,7 +51,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, static int mlx5e_hv_vhca_stats_buf_size(struct mlx5e_priv *priv) { return (sizeof(struct mlx5e_hv_vhca_per_ring_stats) * priv->max_nch); priv->stats_nch); } static void mlx5e_hv_vhca_stats_work(struct work_struct *work) Loading Loading @@ -100,7 +100,7 @@ static void mlx5e_hv_vhca_stats_control(struct mlx5_hv_vhca_agent *agent, sagent = &priv->stats_agent; block->version = MLX5_HV_VHCA_STATS_VERSION; block->rings = priv->max_nch; block->rings = priv->stats_nch; if (!block->command) { cancel_delayed_work_sync(&priv->stats_agent.work); Loading drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +1 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ struct mlx5e_ptp_fs { bool valid; }; #define MLX5E_PTP_CHANNEL_IX 0 struct mlx5e_ptp_params { struct mlx5e_params params; struct mlx5e_sq_param txq_sq_param; Loading Loading @@ -509,6 +507,7 @@ static int mlx5e_init_ptp_rq(struct mlx5e_ptp *c, struct mlx5e_params *params, rq->mdev = mdev; rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); rq->stats = &c->priv->ptp_stats.rq; rq->ix = MLX5E_PTP_CHANNEL_IX; rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev); err = mlx5e_rq_set_handlers(rq, params, false); if (err) Loading drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #include "en_stats.h" #include <linux/ptp_classify.h> #define MLX5E_PTP_CHANNEL_IX 0 struct mlx5e_ptpsq { struct mlx5e_txqsq txqsq; struct mlx5e_cq ts_cq; Loading drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +11 −0 Original line number Diff line number Diff line Loading @@ -2036,6 +2036,17 @@ static int set_pflag_tx_port_ts(struct net_device *netdev, bool enable) } new_params = priv->channels.params; /* Don't allow enabling TX-port-TS if MQPRIO mode channel offload is * active, since it defines explicitly which TC accepts the packet. * This conflicts with TX-port-TS hijacking the PTP traffic to a specific * HW TX-queue. */ if (enable && new_params.mqprio.mode == TC_MQPRIO_MODE_CHANNEL) { netdev_err(priv->netdev, "%s: MQPRIO mode channel offload is active, cannot set the TX-port-TS\n", __func__); return -EINVAL; } MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_TX_PORT_TS, enable); /* No need to verify SQ stop room as * ptpsq.txqsq.stop_room <= generic_sq->stop_room, and both Loading Loading
drivers/net/ethernet/mellanox/mlx5/core/en.h +5 −7 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ struct mlx5e_params { struct { u16 mode; u8 num_tc; struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE]; } mqprio; bool rx_cqe_compress_def; bool tunneled_offload_en; Loading Loading @@ -845,6 +846,7 @@ struct mlx5e_priv { struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS]; struct mlx5e_channel_stats trap_stats; struct mlx5e_ptp_stats ptp_stats; u16 stats_nch; u16 max_nch; u8 max_opened_tc; bool tx_ptp_opened; Loading Loading @@ -1100,12 +1102,6 @@ int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, struct ethtool_pauseparam *pauseparam); /* mlx5e generic netdev management API */ static inline unsigned int mlx5e_calc_max_nch(struct mlx5e_priv *priv, const struct mlx5e_profile *profile) { return priv->netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1); } static inline bool mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev) { Loading @@ -1114,11 +1110,13 @@ mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev) } int mlx5e_priv_init(struct mlx5e_priv *priv, const struct mlx5e_profile *profile, struct net_device *netdev, struct mlx5_core_dev *mdev); void mlx5e_priv_cleanup(struct mlx5e_priv *priv); struct net_device * mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int rxqs); mlx5e_create_netdev(struct mlx5_core_dev *mdev, const struct mlx5e_profile *profile, unsigned int txqs, unsigned int rxqs); int mlx5e_attach_netdev(struct mlx5e_priv *priv); void mlx5e_detach_netdev(struct mlx5e_priv *priv); void mlx5e_destroy_netdev(struct mlx5e_priv *priv); Loading
drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, { int ch, i = 0; for (ch = 0; ch < priv->max_nch; ch++) { for (ch = 0; ch < priv->stats_nch; ch++) { void *buf = data + i; if (WARN_ON_ONCE(buf + Loading @@ -51,7 +51,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, static int mlx5e_hv_vhca_stats_buf_size(struct mlx5e_priv *priv) { return (sizeof(struct mlx5e_hv_vhca_per_ring_stats) * priv->max_nch); priv->stats_nch); } static void mlx5e_hv_vhca_stats_work(struct work_struct *work) Loading Loading @@ -100,7 +100,7 @@ static void mlx5e_hv_vhca_stats_control(struct mlx5_hv_vhca_agent *agent, sagent = &priv->stats_agent; block->version = MLX5_HV_VHCA_STATS_VERSION; block->rings = priv->max_nch; block->rings = priv->stats_nch; if (!block->command) { cancel_delayed_work_sync(&priv->stats_agent.work); Loading
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +1 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ struct mlx5e_ptp_fs { bool valid; }; #define MLX5E_PTP_CHANNEL_IX 0 struct mlx5e_ptp_params { struct mlx5e_params params; struct mlx5e_sq_param txq_sq_param; Loading Loading @@ -509,6 +507,7 @@ static int mlx5e_init_ptp_rq(struct mlx5e_ptp *c, struct mlx5e_params *params, rq->mdev = mdev; rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); rq->stats = &c->priv->ptp_stats.rq; rq->ix = MLX5E_PTP_CHANNEL_IX; rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev); err = mlx5e_rq_set_handlers(rq, params, false); if (err) Loading
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #include "en_stats.h" #include <linux/ptp_classify.h> #define MLX5E_PTP_CHANNEL_IX 0 struct mlx5e_ptpsq { struct mlx5e_txqsq txqsq; struct mlx5e_cq ts_cq; Loading
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +11 −0 Original line number Diff line number Diff line Loading @@ -2036,6 +2036,17 @@ static int set_pflag_tx_port_ts(struct net_device *netdev, bool enable) } new_params = priv->channels.params; /* Don't allow enabling TX-port-TS if MQPRIO mode channel offload is * active, since it defines explicitly which TC accepts the packet. * This conflicts with TX-port-TS hijacking the PTP traffic to a specific * HW TX-queue. */ if (enable && new_params.mqprio.mode == TC_MQPRIO_MODE_CHANNEL) { netdev_err(priv->netdev, "%s: MQPRIO mode channel offload is active, cannot set the TX-port-TS\n", __func__); return -EINVAL; } MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_TX_PORT_TS, enable); /* No need to verify SQ stop room as * ptpsq.txqsq.stop_room <= generic_sq->stop_room, and both Loading