Commit 991ca269 authored by Manish Chopra's avatar Manish Chopra Committed by David S. Miller

qlcnic: Enhance PVID handling for 84xx adapters

o PF driver should not indicate PVID configuration to VF driver.
  As adapter supports VLAN stripping, VF driver should stay agnostic
  to any PVID configuration.

o Return "QLC_NO_VLAN_MODE(= 0)" to VFD when PVID is configured.
  VF driver should be in no VLAN configuration mode.
Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb3c0d83
...@@ -2069,6 +2069,14 @@ static inline bool qlcnic_82xx_check(struct qlcnic_adapter *adapter) ...@@ -2069,6 +2069,14 @@ static inline bool qlcnic_82xx_check(struct qlcnic_adapter *adapter)
return (device == PCI_DEVICE_ID_QLOGIC_QLE824X) ? true : false; return (device == PCI_DEVICE_ID_QLOGIC_QLE824X) ? true : false;
} }
static inline bool qlcnic_84xx_check(struct qlcnic_adapter *adapter)
{
unsigned short device = adapter->pdev->device;
return ((device == PCI_DEVICE_ID_QLOGIC_QLE844X) ||
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X)) ? true : false;
}
static inline bool qlcnic_83xx_check(struct qlcnic_adapter *adapter) static inline bool qlcnic_83xx_check(struct qlcnic_adapter *adapter)
{ {
unsigned short device = adapter->pdev->device; unsigned short device = adapter->pdev->device;
......
...@@ -398,14 +398,10 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *adapter, ...@@ -398,14 +398,10 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *adapter,
} }
static int qlcnic_sriov_set_pvid_mode(struct qlcnic_adapter *adapter, static int qlcnic_sriov_set_pvid_mode(struct qlcnic_adapter *adapter,
struct qlcnic_cmd_args *cmd, u32 cap) struct qlcnic_cmd_args *cmd)
{ {
if (cap & QLC_83XX_PVID_STRIP_CAPABILITY) { adapter->rx_pvid = MSW(cmd->rsp.arg[1]) & 0xffff;
adapter->rx_pvid = 0; adapter->flags &= ~QLCNIC_TAGGING_ENABLED;
} else {
adapter->rx_pvid = (cmd->rsp.arg[1] >> 16) & 0xffff;
adapter->flags &= ~QLCNIC_TAGGING_ENABLED;
}
return 0; return 0;
} }
...@@ -441,9 +437,8 @@ static int qlcnic_sriov_get_vf_acl(struct qlcnic_adapter *adapter, ...@@ -441,9 +437,8 @@ static int qlcnic_sriov_get_vf_acl(struct qlcnic_adapter *adapter,
{ {
struct qlcnic_sriov *sriov = adapter->ahw->sriov; struct qlcnic_sriov *sriov = adapter->ahw->sriov;
struct qlcnic_cmd_args cmd; struct qlcnic_cmd_args cmd;
int ret, cap; int ret = 0;
cap = info->capabilities;
ret = qlcnic_sriov_alloc_bc_mbx_args(&cmd, QLCNIC_BC_CMD_GET_ACL); ret = qlcnic_sriov_alloc_bc_mbx_args(&cmd, QLCNIC_BC_CMD_GET_ACL);
if (ret) if (ret)
return ret; return ret;
...@@ -459,7 +454,7 @@ static int qlcnic_sriov_get_vf_acl(struct qlcnic_adapter *adapter, ...@@ -459,7 +454,7 @@ static int qlcnic_sriov_get_vf_acl(struct qlcnic_adapter *adapter,
ret = qlcnic_sriov_set_guest_vlan_mode(adapter, &cmd); ret = qlcnic_sriov_set_guest_vlan_mode(adapter, &cmd);
break; break;
case QLC_PVID_MODE: case QLC_PVID_MODE:
ret = qlcnic_sriov_set_pvid_mode(adapter, &cmd, cap); ret = qlcnic_sriov_set_pvid_mode(adapter, &cmd);
break; break;
} }
} }
......
...@@ -1183,10 +1183,19 @@ static int qlcnic_sriov_pf_get_acl_cmd(struct qlcnic_bc_trans *trans, ...@@ -1183,10 +1183,19 @@ static int qlcnic_sriov_pf_get_acl_cmd(struct qlcnic_bc_trans *trans,
struct qlcnic_vf_info *vf = trans->vf; struct qlcnic_vf_info *vf = trans->vf;
struct qlcnic_vport *vp = vf->vp; struct qlcnic_vport *vp = vf->vp;
u8 cmd_op, mode = vp->vlan_mode; u8 cmd_op, mode = vp->vlan_mode;
struct qlcnic_adapter *adapter;
adapter = vf->adapter;
cmd_op = trans->req_hdr->cmd_op; cmd_op = trans->req_hdr->cmd_op;
cmd->rsp.arg[0] |= 1 << 25; cmd->rsp.arg[0] |= 1 << 25;
/* For 84xx adapter in case of PVID , PFD should send vlan mode as
* QLC_NO_VLAN_MODE to VFD which is zero in mailbox response
*/
if (qlcnic_84xx_check(adapter) && mode == QLC_PVID_MODE)
return 0;
switch (mode) { switch (mode) {
case QLC_GUEST_VLAN_MODE: case QLC_GUEST_VLAN_MODE:
cmd->rsp.arg[1] = mode | 1 << 8; cmd->rsp.arg[1] = mode | 1 << 8;
......
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