Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Show First 20 Lines • Show All 1,067 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
mlx5e_update_stats(void *arg) | mlx5e_update_stats(void *arg) | ||||
{ | { | ||||
struct mlx5e_priv *priv = arg; | struct mlx5e_priv *priv = arg; | ||||
queue_work(priv->wq, &priv->update_stats_work); | queue_work(priv->wq, &priv->update_stats_work); | ||||
callout_reset(&priv->watchdog, hz, &mlx5e_update_stats, priv); | callout_reset_sbt_on_arg1(&priv->watchdog, tick_sbt * hz, 0, | ||||
&mlx5e_update_stats, priv, mlx5e_update_stats, -1, C_HARDCLOCK); | |||||
} | } | ||||
static void | static void | ||||
mlx5e_async_event_sub(struct mlx5e_priv *priv, | mlx5e_async_event_sub(struct mlx5e_priv *priv, | ||||
enum mlx5_dev_event event) | enum mlx5_dev_event event) | ||||
{ | { | ||||
switch (event) { | switch (event) { | ||||
case MLX5_DEV_EVENT_PORT_UP: | case MLX5_DEV_EVENT_PORT_UP: | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
mlx5e_reset_calibration_callout(struct mlx5e_priv *priv) | mlx5e_reset_calibration_callout(struct mlx5e_priv *priv) | ||||
{ | { | ||||
if (priv->clbr_done == 0) | if (priv->clbr_done == 0) | ||||
mlx5e_calibration_callout(priv); | mlx5e_calibration_callout(priv); | ||||
else | else | ||||
callout_reset_curcpu(&priv->tstmp_clbr, (priv->clbr_done < | callout_reset_sbt_on_arg1(&priv->tstmp_clbr, (priv->clbr_done < | ||||
mlx5e_calibration_duration ? mlx5e_fast_calibration : | mlx5e_calibration_duration ? mlx5e_fast_calibration : | ||||
mlx5e_normal_calibration) * hz, mlx5e_calibration_callout, | mlx5e_normal_calibration) * hz * tick_sbt, 0, | ||||
priv); | mlx5e_calibration_callout, priv, mlx5e_calibration_callout, | ||||
PCPU_GET(cpuid), C_HARDCLOCK); | |||||
} | } | ||||
static uint64_t | static uint64_t | ||||
mlx5e_timespec2usec(const struct timespec *ts) | mlx5e_timespec2usec(const struct timespec *ts) | ||||
{ | { | ||||
return ((uint64_t)ts->tv_sec * 1000000000 + ts->tv_nsec); | return ((uint64_t)ts->tv_sec * 1000000000 + ts->tv_nsec); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 691 Lines • ▼ Show 20 Lines | case MLX5E_CEV_STATE_SEND_NOPS: | ||||
break; | break; | ||||
default: | default: | ||||
/* send NOPs on next timeout */ | /* send NOPs on next timeout */ | ||||
sq->cev_next_state = MLX5E_CEV_STATE_SEND_NOPS; | sq->cev_next_state = MLX5E_CEV_STATE_SEND_NOPS; | ||||
break; | break; | ||||
} | } | ||||
/* restart timer */ | /* restart timer */ | ||||
callout_reset_curcpu(&sq->cev_callout, hz, mlx5e_sq_cev_timeout, sq); | callout_reset_sbt_on_arg1(&sq->cev_callout, tick_sbt * hz, 0, | ||||
mlx5e_sq_cev_timeout, sq, mlx5e_sq_cev_timeout, -1, C_HARDCLOCK); | |||||
} | } | ||||
void | void | ||||
mlx5e_drain_sq(struct mlx5e_sq *sq) | mlx5e_drain_sq(struct mlx5e_sq *sq) | ||||
{ | { | ||||
int error; | int error; | ||||
struct mlx5_core_dev *mdev= sq->priv->mdev; | struct mlx5_core_dev *mdev= sq->priv->mdev; | ||||
▲ Show 20 Lines • Show All 2,866 Lines • Show Last 20 Lines |