diff options
author | Manish Chopra <manishc@marvell.com> | 2019-08-18 10:25:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-18 15:45:07 -0400 |
commit | 4a4d2d372fb9b9229327e2ed01d5d9572eddf4de (patch) | |
tree | eb1ce904cc563e017821b42373c7f649c3a6b733 | |
parent | 42eb4554702d40668968da333ffa37cc0a15ff9e (diff) |
bnx2x: Fix VF's VLAN reconfiguration in reload.
Commit 04f05230c5c13 ("bnx2x: Remove configured vlans as
part of unload sequence."), introduced a regression in driver
that as a part of VF's reload flow, VLANs created on the VF
doesn't get re-configured in hardware as vlan metadata/info
was not getting cleared for the VFs which causes vlan PING to stop.
This patch clears the vlan metadata/info so that VLANs gets
re-configured back in the hardware in VF's reload flow and
PING/traffic continues for VLANs created over the VFs.
Fixes: 04f05230c5c13 ("bnx2x: Remove configured vlans as part of unload sequence.")
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Sudarsana Kalluru <skalluru@marvell.com>
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 17 |
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e47ea92e2ae3..d10b421ed1f1 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -3057,12 +3057,13 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) | |||
3057 | /* if VF indicate to PF this function is going down (PF will delete sp | 3057 | /* if VF indicate to PF this function is going down (PF will delete sp |
3058 | * elements and clear initializations | 3058 | * elements and clear initializations |
3059 | */ | 3059 | */ |
3060 | if (IS_VF(bp)) | 3060 | if (IS_VF(bp)) { |
3061 | bnx2x_clear_vlan_info(bp); | ||
3061 | bnx2x_vfpf_close_vf(bp); | 3062 | bnx2x_vfpf_close_vf(bp); |
3062 | else if (unload_mode != UNLOAD_RECOVERY) | 3063 | } else if (unload_mode != UNLOAD_RECOVERY) { |
3063 | /* if this is a normal/close unload need to clean up chip*/ | 3064 | /* if this is a normal/close unload need to clean up chip*/ |
3064 | bnx2x_chip_cleanup(bp, unload_mode, keep_link); | 3065 | bnx2x_chip_cleanup(bp, unload_mode, keep_link); |
3065 | else { | 3066 | } else { |
3066 | /* Send the UNLOAD_REQUEST to the MCP */ | 3067 | /* Send the UNLOAD_REQUEST to the MCP */ |
3067 | bnx2x_send_unload_req(bp, unload_mode); | 3068 | bnx2x_send_unload_req(bp, unload_mode); |
3068 | 3069 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index c2f6e44e9a3f..8b08cb18e363 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -425,6 +425,8 @@ void bnx2x_set_reset_global(struct bnx2x *bp); | |||
425 | void bnx2x_disable_close_the_gate(struct bnx2x *bp); | 425 | void bnx2x_disable_close_the_gate(struct bnx2x *bp); |
426 | int bnx2x_init_hw_func_cnic(struct bnx2x *bp); | 426 | int bnx2x_init_hw_func_cnic(struct bnx2x *bp); |
427 | 427 | ||
428 | void bnx2x_clear_vlan_info(struct bnx2x *bp); | ||
429 | |||
428 | /** | 430 | /** |
429 | * bnx2x_sp_event - handle ramrods completion. | 431 | * bnx2x_sp_event - handle ramrods completion. |
430 | * | 432 | * |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 2cc14db8f0ec..192ff8d5da32 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -8482,11 +8482,21 @@ int bnx2x_set_vlan_one(struct bnx2x *bp, u16 vlan, | |||
8482 | return rc; | 8482 | return rc; |
8483 | } | 8483 | } |
8484 | 8484 | ||
8485 | void bnx2x_clear_vlan_info(struct bnx2x *bp) | ||
8486 | { | ||
8487 | struct bnx2x_vlan_entry *vlan; | ||
8488 | |||
8489 | /* Mark that hw forgot all entries */ | ||
8490 | list_for_each_entry(vlan, &bp->vlan_reg, link) | ||
8491 | vlan->hw = false; | ||
8492 | |||
8493 | bp->vlan_cnt = 0; | ||
8494 | } | ||
8495 | |||
8485 | static int bnx2x_del_all_vlans(struct bnx2x *bp) | 8496 | static int bnx2x_del_all_vlans(struct bnx2x *bp) |
8486 | { | 8497 | { |
8487 | struct bnx2x_vlan_mac_obj *vlan_obj = &bp->sp_objs[0].vlan_obj; | 8498 | struct bnx2x_vlan_mac_obj *vlan_obj = &bp->sp_objs[0].vlan_obj; |
8488 | unsigned long ramrod_flags = 0, vlan_flags = 0; | 8499 | unsigned long ramrod_flags = 0, vlan_flags = 0; |
8489 | struct bnx2x_vlan_entry *vlan; | ||
8490 | int rc; | 8500 | int rc; |
8491 | 8501 | ||
8492 | __set_bit(RAMROD_COMP_WAIT, &ramrod_flags); | 8502 | __set_bit(RAMROD_COMP_WAIT, &ramrod_flags); |
@@ -8495,10 +8505,7 @@ static int bnx2x_del_all_vlans(struct bnx2x *bp) | |||
8495 | if (rc) | 8505 | if (rc) |
8496 | return rc; | 8506 | return rc; |
8497 | 8507 | ||
8498 | /* Mark that hw forgot all entries */ | 8508 | bnx2x_clear_vlan_info(bp); |
8499 | list_for_each_entry(vlan, &bp->vlan_reg, link) | ||
8500 | vlan->hw = false; | ||
8501 | bp->vlan_cnt = 0; | ||
8502 | 8509 | ||
8503 | return 0; | 8510 | return 0; |
8504 | } | 8511 | } |