Commit 7613c87b authored by Rajesh Borundia's avatar Rajesh Borundia Committed by David S. Miller

qlcnic: fix mac anti spoof policy

o Allow enabling/disabling mac anti spoof policy only for
  Non privilege functions.
Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 174240a8
...@@ -741,9 +741,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, ...@@ -741,9 +741,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter,
struct qlcnic_esw_func_cfg *esw_cfg) struct qlcnic_esw_func_cfg *esw_cfg)
{ {
adapter->flags &= ~QLCNIC_MACSPOOF; adapter->flags &= ~QLCNIC_MACSPOOF;
if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC)
if (esw_cfg->mac_anti_spoof) if (esw_cfg->mac_anti_spoof)
adapter->flags |= QLCNIC_MACSPOOF; adapter->flags |= QLCNIC_MACSPOOF;
qlcnic_set_netdev_features(adapter, esw_cfg); qlcnic_set_netdev_features(adapter, esw_cfg);
} }
...@@ -3377,8 +3377,12 @@ static int ...@@ -3377,8 +3377,12 @@ static int
validate_esw_config(struct qlcnic_adapter *adapter, validate_esw_config(struct qlcnic_adapter *adapter,
struct qlcnic_esw_func_cfg *esw_cfg, int count) struct qlcnic_esw_func_cfg *esw_cfg, int count)
{ {
u32 op_mode;
u8 pci_func; u8 pci_func;
int i; int i;
op_mode = readl(adapter->ahw.pci_base0 + QLCNIC_DRV_OP_MODE);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
pci_func = esw_cfg[i].pci_func; pci_func = esw_cfg[i].pci_func;
if (pci_func >= QLCNIC_MAX_PCI_FUNC) if (pci_func >= QLCNIC_MAX_PCI_FUNC)
...@@ -3390,6 +3394,9 @@ validate_esw_config(struct qlcnic_adapter *adapter, ...@@ -3390,6 +3394,9 @@ validate_esw_config(struct qlcnic_adapter *adapter,
switch (esw_cfg[i].op_mode) { switch (esw_cfg[i].op_mode) {
case QLCNIC_PORT_DEFAULTS: case QLCNIC_PORT_DEFAULTS:
if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
QLCNIC_NON_PRIV_FUNC)
esw_cfg[i].mac_anti_spoof = 0;
break; break;
case QLCNIC_ADD_VLAN: case QLCNIC_ADD_VLAN:
if (!IS_VALID_VLAN(esw_cfg[i].vlan_id)) if (!IS_VALID_VLAN(esw_cfg[i].vlan_id))
......
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