bnx2x: Fix logic to get total no. of PFs per engine
authorManish Chopra <manishc@marvell.com>
Wed, 11 Dec 2019 17:59:56 +0000 (09:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 10:24:23 +0000 (11:24 +0100)
[ Upstream commit ee699f89bdbaa19c399804504241b5c531b48888 ]

Driver doesn't calculate total number of PFs configured on a
given engine correctly which messed up resources in the PFs
loaded on that engine, leading driver to exceed configuration
of resources (like vlan filters etc.) beyond the limit per
engine, which ended up with asserts from the firmware.

Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h

index 2ec1c43270b7c16a9328285cb3839f770676e80d..bb36312c96969d760cf848041927250d8496141b 100644 (file)
@@ -1112,7 +1112,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp)
                for (i = 0; i < E1H_FUNC_MAX / 2; i++) {
                        u32 func_config =
                                MF_CFG_RD(bp,
-                                         func_mf_config[BP_PORT(bp) + 2 * i].
+                                         func_mf_config[BP_PATH(bp) + 2 * i].
                                          config);
                        func_num +=
                                ((func_config & FUNC_MF_CFG_FUNC_HIDE) ? 0 : 1);