Commit 2f0a9afa authored by Manish Chopra's avatar Manish Chopra Committed by David S. Miller

qlcnic: Fix guest VLAN

o Clear cached vport vlan variable(vp->vlan) in PF on PCI FLR and
  back-channel termination which will allow to configure guest VLAN
  on VF after force off/shut down the guest VM.
Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b662eca0
...@@ -635,10 +635,12 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, ...@@ -635,10 +635,12 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans,
struct qlcnic_cmd_args *cmd) struct qlcnic_cmd_args *cmd)
{ {
struct qlcnic_vf_info *vf = trans->vf; struct qlcnic_vf_info *vf = trans->vf;
struct qlcnic_adapter *adapter = vf->adapter; struct qlcnic_vport *vp = vf->vp;
int err; struct qlcnic_adapter *adapter;
u16 func = vf->pci_func; u16 func = vf->pci_func;
int err;
adapter = vf->adapter;
cmd->rsp.arg[0] = trans->req_hdr->cmd_op; cmd->rsp.arg[0] = trans->req_hdr->cmd_op;
cmd->rsp.arg[0] |= (1 << 16); cmd->rsp.arg[0] |= (1 << 16);
...@@ -650,6 +652,8 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, ...@@ -650,6 +652,8 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans,
qlcnic_sriov_pf_config_vport(adapter, 0, func); qlcnic_sriov_pf_config_vport(adapter, 0, func);
} }
} else { } else {
if (vp->vlan_mode == QLC_GUEST_VLAN_MODE)
vp->vlan = 0;
err = qlcnic_sriov_pf_config_vport(adapter, 0, func); err = qlcnic_sriov_pf_config_vport(adapter, 0, func);
} }
...@@ -1561,6 +1565,7 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, ...@@ -1561,6 +1565,7 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov,
struct qlcnic_vf_info *vf) struct qlcnic_vf_info *vf)
{ {
struct net_device *dev = vf->adapter->netdev; struct net_device *dev = vf->adapter->netdev;
struct qlcnic_vport *vp = vf->vp;
if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) { if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) {
clear_bit(QLC_BC_VF_FLR, &vf->state); clear_bit(QLC_BC_VF_FLR, &vf->state);
...@@ -1573,6 +1578,9 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, ...@@ -1573,6 +1578,9 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov,
return; return;
} }
if (vp->vlan_mode == QLC_GUEST_VLAN_MODE)
vp->vlan = 0;
qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr); qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr);
netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func); netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func);
} }
......
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