aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAriel Elior <ariele@broadcom.com>2013-10-20 10:51:28 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-21 18:31:35 -0400
commit31329afdacd107f129dd4ed4464233a7e514ca7d (patch)
treee7b5176d6b8151015efafd0d5bfd9a25b9ea063d /drivers/net
parent1a6974b2c78755ae55d7be738866eb8d57c3ed45 (diff)
bnx2x: Unlock VF-PF channel on MAC/VLAN config error
Current code returns upon failure, leaving the VF-PF in an unusable state; This patch adds the missing release so further commands could pass between PF and VF. Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 9ad012bdd915..997c6611a2ae 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3390,14 +3390,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)
3390 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); 3390 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true);
3391 if (rc) { 3391 if (rc) {
3392 BNX2X_ERR("failed to delete eth macs\n"); 3392 BNX2X_ERR("failed to delete eth macs\n");
3393 return -EINVAL; 3393 rc = -EINVAL;
3394 goto out;
3394 } 3395 }
3395 3396
3396 /* remove existing uc list macs */ 3397 /* remove existing uc list macs */
3397 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); 3398 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true);
3398 if (rc) { 3399 if (rc) {
3399 BNX2X_ERR("failed to delete uc_list macs\n"); 3400 BNX2X_ERR("failed to delete uc_list macs\n");
3400 return -EINVAL; 3401 rc = -EINVAL;
3402 goto out;
3401 } 3403 }
3402 3404
3403 /* configure the new mac to device */ 3405 /* configure the new mac to device */
@@ -3405,6 +3407,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)
3405 bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, 3407 bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true,
3406 BNX2X_ETH_MAC, &ramrod_flags); 3408 BNX2X_ETH_MAC, &ramrod_flags);
3407 3409
3410out:
3408 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); 3411 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC);
3409 } 3412 }
3410 3413
@@ -3467,7 +3470,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
3467 &ramrod_flags); 3470 &ramrod_flags);
3468 if (rc) { 3471 if (rc) {
3469 BNX2X_ERR("failed to delete vlans\n"); 3472 BNX2X_ERR("failed to delete vlans\n");
3470 return -EINVAL; 3473 rc = -EINVAL;
3474 goto out;
3471 } 3475 }
3472 3476
3473 /* send queue update ramrod to configure default vlan and silent 3477 /* send queue update ramrod to configure default vlan and silent
@@ -3501,7 +3505,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
3501 rc = bnx2x_config_vlan_mac(bp, &ramrod_param); 3505 rc = bnx2x_config_vlan_mac(bp, &ramrod_param);
3502 if (rc) { 3506 if (rc) {
3503 BNX2X_ERR("failed to configure vlan\n"); 3507 BNX2X_ERR("failed to configure vlan\n");
3504 return -EINVAL; 3508 rc = -EINVAL;
3509 goto out;
3505 } 3510 }
3506 3511
3507 /* configure default vlan to vf queue and set silent 3512 /* configure default vlan to vf queue and set silent
@@ -3519,18 +3524,18 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
3519 rc = bnx2x_queue_state_change(bp, &q_params); 3524 rc = bnx2x_queue_state_change(bp, &q_params);
3520 if (rc) { 3525 if (rc) {
3521 BNX2X_ERR("Failed to configure default VLAN\n"); 3526 BNX2X_ERR("Failed to configure default VLAN\n");
3522 return rc; 3527 goto out;
3523 } 3528 }
3524 3529
3525 /* clear the flag indicating that this VF needs its vlan 3530 /* clear the flag indicating that this VF needs its vlan
3526 * (will only be set if the HV configured th Vlan before vf was 3531 * (will only be set if the HV configured the Vlan before vf was
3527 * and we were called because the VF came up later 3532 * up and we were called because the VF came up later
3528 */ 3533 */
3534out:
3529 vf->cfg_flags &= ~VF_CFG_VLAN; 3535 vf->cfg_flags &= ~VF_CFG_VLAN;
3530
3531 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); 3536 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN);
3532 } 3537 }
3533 return 0; 3538 return rc;
3534} 3539}
3535 3540
3536/* crc is the first field in the bulletin board. Compute the crc over the 3541/* crc is the first field in the bulletin board. Compute the crc over the