Commit 31329afd authored by Ariel Elior's avatar Ariel Elior Committed by David S. Miller

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: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a6974b2
...@@ -3390,14 +3390,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) ...@@ -3390,14 +3390,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)
rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true);
if (rc) { if (rc) {
BNX2X_ERR("failed to delete eth macs\n"); BNX2X_ERR("failed to delete eth macs\n");
return -EINVAL; rc = -EINVAL;
goto out;
} }
/* remove existing uc list macs */ /* remove existing uc list macs */
rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true);
if (rc) { if (rc) {
BNX2X_ERR("failed to delete uc_list macs\n"); BNX2X_ERR("failed to delete uc_list macs\n");
return -EINVAL; rc = -EINVAL;
goto out;
} }
/* configure the new mac to device */ /* configure the new mac to device */
...@@ -3405,6 +3407,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) ...@@ -3405,6 +3407,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)
bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true,
BNX2X_ETH_MAC, &ramrod_flags); BNX2X_ETH_MAC, &ramrod_flags);
out:
bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC);
} }
...@@ -3467,7 +3470,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) ...@@ -3467,7 +3470,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
&ramrod_flags); &ramrod_flags);
if (rc) { if (rc) {
BNX2X_ERR("failed to delete vlans\n"); BNX2X_ERR("failed to delete vlans\n");
return -EINVAL; rc = -EINVAL;
goto out;
} }
/* send queue update ramrod to configure default vlan and silent /* 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,7 +3505,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
rc = bnx2x_config_vlan_mac(bp, &ramrod_param); rc = bnx2x_config_vlan_mac(bp, &ramrod_param);
if (rc) { if (rc) {
BNX2X_ERR("failed to configure vlan\n"); BNX2X_ERR("failed to configure vlan\n");
return -EINVAL; rc = -EINVAL;
goto out;
} }
/* configure default vlan to vf queue and set silent /* 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,18 +3524,18 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
rc = bnx2x_queue_state_change(bp, &q_params); rc = bnx2x_queue_state_change(bp, &q_params);
if (rc) { if (rc) {
BNX2X_ERR("Failed to configure default VLAN\n"); BNX2X_ERR("Failed to configure default VLAN\n");
return rc; goto out;
} }
/* clear the flag indicating that this VF needs its vlan /* clear the flag indicating that this VF needs its vlan
* (will only be set if the HV configured th Vlan before vf was * (will only be set if the HV configured the Vlan before vf was
* and we were called because the VF came up later * up and we were called because the VF came up later
*/ */
out:
vf->cfg_flags &= ~VF_CFG_VLAN; vf->cfg_flags &= ~VF_CFG_VLAN;
bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN);
} }
return 0; return rc;
} }
/* crc is the first field in the bulletin board. Compute the crc over the /* crc is the first field in the bulletin board. Compute the crc over the
......
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