diff options
author | Mintz, Yuval <Yuval.Mintz@cavium.com> | 2017-04-06 15:58:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-06 14:26:31 -0700 |
commit | 2f2b2614e8937e95c29ac733d8956a48771613d2 (patch) | |
tree | 7223b4d8474f61f773e27f8202197284aa154632 /drivers/net/ethernet/qlogic/qed/qed_iscsi.c | |
parent | qed: Inform qedi the number of possible CQs (diff) | |
download | linux-dev-2f2b2614e8937e95c29ac733d8956a48771613d2.tar.xz linux-dev-2f2b2614e8937e95c29ac733d8956a48771613d2.zip |
qed: Provide iSCSI statistics to management
Management firmware can query for some basic iSCSI-related statistics.
Provide those just as we do for other protocols.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_iscsi.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_iscsi.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c index 417691cf4fd6..339c91dfa658 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c @@ -1324,6 +1324,26 @@ static int qed_iscsi_stats(struct qed_dev *cdev, struct qed_iscsi_stats *stats) return qed_iscsi_get_stats(QED_LEADING_HWFN(cdev), stats); } +void qed_get_protocol_stats_iscsi(struct qed_dev *cdev, + struct qed_mcp_iscsi_stats *stats) +{ + struct qed_iscsi_stats proto_stats; + + /* Retrieve FW statistics */ + memset(&proto_stats, 0, sizeof(proto_stats)); + if (qed_iscsi_stats(cdev, &proto_stats)) { + DP_VERBOSE(cdev, QED_MSG_STORAGE, + "Failed to collect ISCSI statistics\n"); + return; + } + + /* Translate FW statistics into struct */ + stats->rx_pdus = proto_stats.iscsi_rx_total_pdu_cnt; + stats->tx_pdus = proto_stats.iscsi_tx_total_pdu_cnt; + stats->rx_bytes = proto_stats.iscsi_rx_bytes_cnt; + stats->tx_bytes = proto_stats.iscsi_tx_bytes_cnt; +} + static const struct qed_iscsi_ops qed_iscsi_ops_pass = { .common = &qed_common_ops_pass, .ll2 = &qed_ll2_ops_pass, |