From 9b1423fbd7854234abdee1d12241dd2bc432620f Mon Sep 17 00:00:00 2001 From: np Date: Tue, 4 Jun 2013 02:25:25 +0000 Subject: [PATCH] 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 --- sys/dev/cxgbe/t4_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index b8a942f87add..3120c516c9a7 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