summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-06-04 02:25:25 +0000
committernp <np@FreeBSD.org>2013-06-04 02:25:25 +0000
commit9b1423fbd7854234abdee1d12241dd2bc432620f (patch)
tree97e873ca3b66957ae4173a0d3e4ff3736b3e6ee6 /sys/dev
parent6b6c46b522931d59e504ddef1fddd7aa8ed91889 (diff)
downloadFreeBSD-src-9b1423fbd7854234abdee1d12241dd2bc432620f.zip
FreeBSD-src-9b1423fbd7854234abdee1d12241dd2bc432620f.tar.gz
cxgbe(4): Provide accurate hit count for filters on T5 cards. The
location within the TCB and the size have both changed. MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/t4_main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index b8a942f..3120c51 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -6573,9 +6573,15 @@ get_filter_hits(struct adapter *sc, uint32_t fid)
memwin_info(sc, 0, &mw_base, NULL);
off = position_memwin(sc, 0,
tcb_base + (fid + sc->tids.ftid_base) * TCB_SIZE);
- hits = t4_read_reg64(sc, mw_base + off + 16);
+ if (is_t4(sc)) {
+ hits = t4_read_reg64(sc, mw_base + off + 16);
+ hits = be64toh(hits);
+ } else {
+ hits = t4_read_reg(sc, mw_base + off + 24);
+ hits = be32toh(hits);
+ }
- return (be64toh(hits));
+ return (hits);
}
static int
OpenPOWER on IntegriCloud