Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_core/mlx5_cmd.c
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | static void set_signature(struct mlx5_cmd_work_ent *ent, int csum) | ||||
calc_chain_sig(ent->in, ent->token, csum); | calc_chain_sig(ent->in, ent->token, csum); | ||||
calc_chain_sig(ent->out, ent->token, csum); | calc_chain_sig(ent->out, ent->token, csum); | ||||
} | } | ||||
static void poll_timeout(struct mlx5_cmd_work_ent *ent) | static void poll_timeout(struct mlx5_cmd_work_ent *ent) | ||||
{ | { | ||||
struct mlx5_core_dev *dev = container_of(ent->cmd, | struct mlx5_core_dev *dev = container_of(ent->cmd, | ||||
struct mlx5_core_dev, cmd); | struct mlx5_core_dev, cmd); | ||||
int poll_end = jiffies + | long poll_end = jiffies + | ||||
msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); | msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000); | ||||
u8 own; | u8 own; | ||||
do { | do { | ||||
own = ent->lay->status_own; | own = ent->lay->status_own; | ||||
if (!(own & CMD_OWNER_HW) || | if (!(own & CMD_OWNER_HW) || | ||||
dev->state != MLX5_DEVICE_STATE_UP) { | dev->state != MLX5_DEVICE_STATE_UP) { | ||||
ent->ret = 0; | ent->ret = 0; | ||||
▲ Show 20 Lines • Show All 686 Lines • ▼ Show 20 Lines | case MLX5_CMD_DELIVERY_STAT_CMD_DESCR_ERR: | ||||
return "bad command descriptor type"; | return "bad command descriptor type"; | ||||
default: | default: | ||||
return "unknown status code"; | return "unknown status code"; | ||||
} | } | ||||
} | } | ||||
static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent) | static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent) | ||||
{ | { | ||||
int timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC); | unsigned long timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC); | ||||
int err; | int err; | ||||
if (ent->polling) { | if (ent->polling) { | ||||
wait_for_completion(&ent->done); | wait_for_completion(&ent->done); | ||||
} else if (!wait_for_completion_timeout(&ent->done, timeout)) { | } else if (!wait_for_completion_timeout(&ent->done, timeout)) { | ||||
ent->ret = -ETIMEDOUT; | ent->ret = -ETIMEDOUT; | ||||
mlx5_cmd_comp_handler(dev, 1UL << ent->idx, MLX5_CMD_MODE_EVENTS); | mlx5_cmd_comp_handler(dev, 1UL << ent->idx, MLX5_CMD_MODE_EVENTS); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 741 Lines • Show Last 20 Lines |