Skip to content

Commit 8238c7b

Browse files
selvintxavierrleon
authored andcommitted
RDMA/bnxt_re: Fix the statistics for Gen P7 VF
Gen P7 VF support the extended stats and is prevented by a VF check. Fix the check to issue the FW command for GenP7 VFs also. Fixes: 1801d87 ("RDMA/bnxt_re: Support new 5760X P7 devices") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Link: https://patch.msgid.link/1738657285-23968-5-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent e2f1052 commit 8238c7b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

drivers/infiniband/hw/bnxt_re/hw_counters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
348348
goto done;
349349
}
350350
bnxt_re_copy_err_stats(rdev, stats, err_s);
351-
if (_is_ext_stats_supported(rdev->dev_attr->dev_cap_flags) &&
352-
!rdev->is_virtfn) {
351+
if (bnxt_ext_stats_supported(rdev->chip_ctx, rdev->dev_attr->dev_cap_flags,
352+
rdev->is_virtfn)) {
353353
rc = bnxt_re_get_ext_stat(rdev, stats);
354354
if (rc) {
355355
clear_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS,

drivers/infiniband/hw/bnxt_re/qplib_res.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,14 @@ static inline bool _is_ext_stats_supported(u16 dev_cap_flags)
547547
CREQ_QUERY_FUNC_RESP_SB_EXT_STATS;
548548
}
549549

550+
static inline int bnxt_ext_stats_supported(struct bnxt_qplib_chip_ctx *ctx,
551+
u16 flags, bool virtfn)
552+
{
553+
/* ext stats supported if cap flag is set AND is a PF OR a Thor2 VF */
554+
return (_is_ext_stats_supported(flags) &&
555+
((virtfn && bnxt_qplib_is_chip_gen_p7(ctx)) || (!virtfn)));
556+
}
557+
550558
static inline bool _is_hw_retx_supported(u16 dev_cap_flags)
551559
{
552560
return dev_cap_flags &

0 commit comments

Comments
 (0)