summaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe/common
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2020-12-03 22:00:41 +0000
committerNavdeep Parhar <np@FreeBSD.org>2020-12-03 22:00:41 +0000
commitdbc5c85c66bf3681ccb806740cf31d95255b3c9d (patch)
treed40cced1c520abab897f61840fa712781513f81a /sys/dev/cxgbe/common
parenta42f0968212d2fb7210020f17fe52ef1dcf35658 (diff)
Notes
Diffstat (limited to 'sys/dev/cxgbe/common')
-rw-r--r--sys/dev/cxgbe/common/common.h16
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c34
2 files changed, 50 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index 3ed9040e9581..4c387d563365 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -189,6 +189,13 @@ struct tp_usm_stats {
u64 octets;
};
+struct tp_tid_stats {
+ u32 del;
+ u32 inv;
+ u32 act;
+ u32 pas;
+};
+
struct tp_fcoe_stats {
u32 frames_ddp;
u32 frames_drop;
@@ -208,6 +215,11 @@ struct tp_err_stats {
u32 ofld_cong_defer;
};
+struct tp_tnl_stats {
+ u32 out_pkt[MAX_NCHAN];
+ u32 in_pkt[MAX_NCHAN];
+};
+
struct tp_proxy_stats {
u32 proxy[MAX_NCHAN];
};
@@ -715,6 +727,8 @@ void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr,
void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr);
void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st,
bool sleep_ok);
+void t4_tp_get_tnl_stats(struct adapter *adap, struct tp_tnl_stats *st,
+ bool sleep_ok);
void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st,
bool sleep_ok);
void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st,
@@ -723,6 +737,8 @@ void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st,
bool sleep_ok);
void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st,
bool sleep_ok);
+void t4_tp_get_tid_stats(struct adapter *adap, struct tp_tid_stats *st,
+ bool sleep_ok);
void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
struct tp_tcp_stats *v6, bool sleep_ok);
void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx,
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index 427c0ff914c2..b54a71a02ca4 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -6169,6 +6169,25 @@ void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st,
}
/**
+ * t4_tp_get_err_stats - read TP's error MIB counters
+ * @adap: the adapter
+ * @st: holds the counter values
+ * @sleep_ok: if true we may sleep while awaiting command completion
+ *
+ * Returns the values of TP's error counters.
+ */
+void t4_tp_get_tnl_stats(struct adapter *adap, struct tp_tnl_stats *st,
+ bool sleep_ok)
+{
+ int nchan = adap->chip_params->nchan;
+
+ t4_tp_mib_read(adap, st->out_pkt, nchan, A_TP_MIB_TNL_OUT_PKT_0,
+ sleep_ok);
+ t4_tp_mib_read(adap, st->in_pkt, nchan, A_TP_MIB_TNL_IN_PKT_0,
+ sleep_ok);
+}
+
+/**
* t4_tp_get_proxy_stats - read TP's proxy MIB counters
* @adap: the adapter
* @st: holds the counter values
@@ -6262,6 +6281,21 @@ void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st,
}
/**
+ * t4_tp_get_tid_stats - read TP's tid MIB counters.
+ * @adap: the adapter
+ * @st: holds the counter values
+ * @sleep_ok: if true we may sleep while awaiting command completion
+ *
+ * Returns the values of TP's counters for tids.
+ */
+void t4_tp_get_tid_stats(struct adapter *adap, struct tp_tid_stats *st,
+ bool sleep_ok)
+{
+
+ t4_tp_mib_read(adap, &st->del, 4, A_TP_MIB_TID_DEL, sleep_ok);
+}
+
+/**
* t4_read_mtu_tbl - returns the values in the HW path MTU table
* @adap: the adapter
* @mtus: where to store the MTU values