if (rq->icosq) {
struct mlx5e_icosq *icosq = rq->icosq;
u8 icosq_hw_state;
+ int err;
+
+ err = mlx5_core_query_sq_state(rq->mdev, icosq->sqn, &icosq_hw_state);
+ if (err)
+ return err;
- mlx5_core_query_sq_state(rq->mdev, icosq->sqn, &icosq_hw_state);
mlx5e_reporter_icosq_diagnose(icosq, icosq_hw_state, fmsg);
}
bool stopped = netif_xmit_stopped(sq->txq);
struct mlx5e_priv *priv = sq->priv;
u8 state;
+ int err;
- mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state);
devlink_fmsg_u32_pair_put(fmsg, "tc", tc);
devlink_fmsg_u32_pair_put(fmsg, "txq ix", sq->txq_ix);
devlink_fmsg_u32_pair_put(fmsg, "sqn", sq->sqn);
- devlink_fmsg_u8_pair_put(fmsg, "HW state", state);
+
+ err = mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state);
+ if (!err)
+ devlink_fmsg_u8_pair_put(fmsg, "HW state", state);
+
devlink_fmsg_bool_pair_put(fmsg, "stopped", stopped);
devlink_fmsg_u32_pair_put(fmsg, "cc", sq->cc);
devlink_fmsg_u32_pair_put(fmsg, "pc", sq->pc);