aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2016-09-11 17:57:53 +0000
committerNavdeep Parhar <np@FreeBSD.org>2016-09-11 17:57:53 +0000
commit82c1d6b7624f3bd97e3ba45a05c0f3c6550298c2 (patch)
treebe58f1a95d75ab31aaebc6a5ec383aba45bfa271 /sys/dev
parented7e5640a54c907545331d513151680a907cde2a (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/t4_main.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index c96214a1db9c5..8e87cd75dbdc0 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -2027,11 +2027,11 @@ t4_map_bar_2(struct adapter *sc)
}
sc->udbs_base = rman_get_virtual(sc->udbs_res);
- if (is_t5(sc)) {
+ if (chip_id(sc) >= CHELSIO_T5) {
setbit(&sc->doorbells, DOORBELL_UDB);
#if defined(__i386__) || defined(__amd64__)
if (t5_write_combine) {
- int rc;
+ int rc, mode;
/*
* Enable write combining on BAR2. This is the
@@ -2054,8 +2054,9 @@ t4_map_bar_2(struct adapter *sc)
rc);
}
+ mode = is_t5(sc) ? V_STATMODE(0) : V_T6_STATMODE(0);
t4_write_reg(sc, A_SGE_STAT_CFG,
- V_STATSOURCE_T5(7) | V_STATMODE(0));
+ V_STATSOURCE_T5(7) | mode);
}
#endif
}
@@ -7472,6 +7473,8 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS)
struct sbuf *sb;
int rc, v;
+ MPASS(chip_id(sc) >= CHELSIO_T5);
+
rc = sysctl_wire_old_buffer(req, 0);
if (rc != 0)
return (rc);
@@ -7482,14 +7485,19 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS)
v = t4_read_reg(sc, A_SGE_STAT_CFG);
if (G_STATSOURCE_T5(v) == 7) {
- if (G_STATMODE(v) == 0) {
+ int mode;
+
+ mode = is_t5(sc) ? G_STATMODE(v) : G_T6_STATMODE(v);
+ if (mode == 0) {
sbuf_printf(sb, "total %d, incomplete %d",
t4_read_reg(sc, A_SGE_STAT_TOTAL),
t4_read_reg(sc, A_SGE_STAT_MATCH));
- } else if (G_STATMODE(v) == 1) {
+ } else if (mode == 1) {
sbuf_printf(sb, "total %d, data overflow %d",
t4_read_reg(sc, A_SGE_STAT_TOTAL),
t4_read_reg(sc, A_SGE_STAT_MATCH));
+ } else {
+ sbuf_printf(sb, "unknown mode %d", mode);
}
}
rc = sbuf_finish(sb);