Commit f86e3437 authored by Gal Pressman's avatar Gal Pressman Committed by Jason Gunthorpe

RDMA/efa: Count admin commands errors

Add a new stat that counts admin commands failures, which might help when
debugging different issues.

Link: https://lore.kernel.org/r/20200420062213.44577-4-galpress@amazon.comReviewed-by: default avatarDaniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: default avatarYossi Leybovich <sleybo@amazon.com>
Signed-off-by: default avatarGal Pressman <galpress@amazon.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent eca5757f
...@@ -631,17 +631,20 @@ int efa_com_cmd_exec(struct efa_com_admin_queue *aq, ...@@ -631,17 +631,20 @@ int efa_com_cmd_exec(struct efa_com_admin_queue *aq,
cmd->aq_common_descriptor.opcode, PTR_ERR(comp_ctx)); cmd->aq_common_descriptor.opcode, PTR_ERR(comp_ctx));
up(&aq->avail_cmds); up(&aq->avail_cmds);
atomic64_inc(&aq->stats.cmd_err);
return PTR_ERR(comp_ctx); return PTR_ERR(comp_ctx);
} }
err = efa_com_wait_and_process_admin_cq(comp_ctx, aq); err = efa_com_wait_and_process_admin_cq(comp_ctx, aq);
if (err) if (err) {
ibdev_err_ratelimited( ibdev_err_ratelimited(
aq->efa_dev, aq->efa_dev,
"Failed to process command %s (opcode %u) comp_status %d err %d\n", "Failed to process command %s (opcode %u) comp_status %d err %d\n",
efa_com_cmd_str(cmd->aq_common_descriptor.opcode), efa_com_cmd_str(cmd->aq_common_descriptor.opcode),
cmd->aq_common_descriptor.opcode, comp_ctx->comp_status, cmd->aq_common_descriptor.opcode, comp_ctx->comp_status,
err); err);
atomic64_inc(&aq->stats.cmd_err);
}
up(&aq->avail_cmds); up(&aq->avail_cmds);
......
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ /* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/* /*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All rights reserved. * Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
*/ */
#ifndef _EFA_COM_H_ #ifndef _EFA_COM_H_
...@@ -47,6 +47,7 @@ struct efa_com_admin_sq { ...@@ -47,6 +47,7 @@ struct efa_com_admin_sq {
struct efa_com_stats_admin { struct efa_com_stats_admin {
atomic64_t submitted_cmd; atomic64_t submitted_cmd;
atomic64_t completed_cmd; atomic64_t completed_cmd;
atomic64_t cmd_err;
atomic64_t no_completion; atomic64_t no_completion;
}; };
......
...@@ -37,6 +37,7 @@ struct efa_user_mmap_entry { ...@@ -37,6 +37,7 @@ struct efa_user_mmap_entry {
op(EFA_RX_DROPS, "rx_drops") \ op(EFA_RX_DROPS, "rx_drops") \
op(EFA_SUBMITTED_CMDS, "submitted_cmds") \ op(EFA_SUBMITTED_CMDS, "submitted_cmds") \
op(EFA_COMPLETED_CMDS, "completed_cmds") \ op(EFA_COMPLETED_CMDS, "completed_cmds") \
op(EFA_CMDS_ERR, "cmds_err") \
op(EFA_NO_COMPLETION_CMDS, "no_completion_cmds") \ op(EFA_NO_COMPLETION_CMDS, "no_completion_cmds") \
op(EFA_KEEP_ALIVE_RCVD, "keep_alive_rcvd") \ op(EFA_KEEP_ALIVE_RCVD, "keep_alive_rcvd") \
op(EFA_ALLOC_PD_ERR, "alloc_pd_err") \ op(EFA_ALLOC_PD_ERR, "alloc_pd_err") \
...@@ -1752,6 +1753,7 @@ int efa_get_hw_stats(struct ib_device *ibdev, struct rdma_hw_stats *stats, ...@@ -1752,6 +1753,7 @@ int efa_get_hw_stats(struct ib_device *ibdev, struct rdma_hw_stats *stats,
as = &dev->edev.aq.stats; as = &dev->edev.aq.stats;
stats->value[EFA_SUBMITTED_CMDS] = atomic64_read(&as->submitted_cmd); stats->value[EFA_SUBMITTED_CMDS] = atomic64_read(&as->submitted_cmd);
stats->value[EFA_COMPLETED_CMDS] = atomic64_read(&as->completed_cmd); stats->value[EFA_COMPLETED_CMDS] = atomic64_read(&as->completed_cmd);
stats->value[EFA_CMDS_ERR] = atomic64_read(&as->cmd_err);
stats->value[EFA_NO_COMPLETION_CMDS] = atomic64_read(&as->no_completion); stats->value[EFA_NO_COMPLETION_CMDS] = atomic64_read(&as->no_completion);
s = &dev->stats; s = &dev->stats;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment