Commit 7ae1629d authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'bnx2x-bug-fixes'

Manish Chopra says:

====================
bnx2x: bug fixes

This series has two driver changes, one to fix some unexpected
hardware behaviour casued during the parity error recovery in
presence of SR-IOV VFs and another one related for fixing resource
management in the driver among the PFs configured on an engine.

Please consider applying it to "net".

V1->V2:
=======
Fix the compilation errors reported by kbuild test robot
on the patch #1 with CONFIG_BNX2X_SRIOV=n
====================
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parents ed56dd8f ee699f89
......@@ -1109,7 +1109,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);
......
......@@ -9976,10 +9976,18 @@ static void bnx2x_recovery_failed(struct bnx2x *bp)
*/
static void bnx2x_parity_recover(struct bnx2x *bp)
{
bool global = false;
u32 error_recovered, error_unrecovered;
bool is_parity;
bool is_parity, global = false;
#ifdef CONFIG_BNX2X_SRIOV
int vf_idx;
for (vf_idx = 0; vf_idx < bp->requested_nr_virtfn; vf_idx++) {
struct bnx2x_virtf *vf = BP_VF(bp, vf_idx);
if (vf)
vf->state = VF_LOST;
}
#endif
DP(NETIF_MSG_HW, "Handling parity\n");
while (1) {
switch (bp->recovery_state) {
......
......@@ -139,6 +139,7 @@ struct bnx2x_virtf {
#define VF_ACQUIRED 1 /* VF acquired, but not initialized */
#define VF_ENABLED 2 /* VF Enabled */
#define VF_RESET 3 /* VF FLR'd, pending cleanup */
#define VF_LOST 4 /* Recovery while VFs are loaded */
bool flr_clnup_stage; /* true during flr cleanup */
bool malicious; /* true if FW indicated so, until FLR */
......
......@@ -2107,6 +2107,18 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
{
int i;
if (vf->state == VF_LOST) {
/* Just ack the FW and return if VFs are lost
* in case of parity error. VFs are supposed to be timedout
* on waiting for PF response.
*/
DP(BNX2X_MSG_IOV,
"VF 0x%x lost, not handling the request\n", vf->abs_vfid);
storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
return;
}
/* check if tlv type is known */
if (bnx2x_tlv_supported(mbx->first_tlv.tl.type)) {
/* Lock the per vf op mutex and note the locker's identity.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment