*arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
*arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET);
dev_info(&adapter->pdev->dev,
- "eSwitch port config for pci func%d\n", pci_func);
+ "eSwitch port config for pci func %d\n", pci_func);
} else {
dev_err(&adapter->pdev->dev,
- "Failed to get eswitch port config%d\n", pci_func);
+ "Failed to get eswitch port config for pci func %d\n",
+ pci_func);
}
return err;
}
arg1 &= ~BIT_4;
if (!(esw_cfg->promisc_mode))
arg1 &= ~BIT_6;
- if (!(esw_cfg->mac_learning))
+ if (!(esw_cfg->mac_override))
arg1 &= ~BIT_7;
if (!(esw_cfg->mac_anti_spoof))
arg2 &= ~BIT_0;
if (err != QLCNIC_RCODE_SUCCESS) {
dev_err(&adapter->pdev->dev,
- "Failed to configure eswitch port%d\n", pci_func);
+ "Failed to configure eswitch pci func %d\n", pci_func);
} else {
dev_info(&adapter->pdev->dev,
- "Configured eSwitch for port %d\n", pci_func);
+ "Configured eSwitch for pci func %d\n", pci_func);
}
return err;
esw_cfg->discard_tagged = !!(arg1 & BIT_4);
esw_cfg->host_vlan_tag = !!(arg1 & BIT_5);
esw_cfg->promisc_mode = !!(arg1 & BIT_6);
- esw_cfg->mac_learning = !!(arg1 & BIT_7);
+ esw_cfg->mac_override = !!(arg1 & BIT_7);
esw_cfg->vlan_id = LSW(arg1 >> 16);
esw_cfg->mac_anti_spoof = (arg2 & 0x1);
esw_cfg->offload_flags = ((arg2 >> 1) & 0x7);
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
+ if ((adapter->flags & QLCNIC_MAC_OVERRIDE_DISABLED))
+ return -EOPNOTSUPP;
+
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
struct qlcnic_esw_func_cfg *esw_cfg)
{
adapter->flags &= ~QLCNIC_MACSPOOF;
+ adapter->flags &= ~QLCNIC_MAC_OVERRIDE_DISABLED;
if (esw_cfg->mac_anti_spoof)
adapter->flags |= QLCNIC_MACSPOOF;
+ if (!esw_cfg->mac_override)
+ adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED;
+
qlcnic_set_netdev_features(adapter, esw_cfg);
}
memset(&esw_cfg, 0, sizeof(struct qlcnic_esw_func_cfg));
esw_cfg.pci_func = i;
esw_cfg.offload_flags = BIT_0;
- esw_cfg.mac_learning = BIT_0;
+ esw_cfg.mac_override = BIT_0;
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO)
esw_cfg.offload_flags |= (BIT_1 | BIT_2);
if (qlcnic_config_switch_port(adapter, &esw_cfg))
return -EIO;
npar = &adapter->npars[i];
npar->pvid = esw_cfg.vlan_id;
- npar->mac_learning = esw_cfg.offload_flags;
+ npar->mac_override = esw_cfg.mac_override;
npar->mac_anti_spoof = esw_cfg.mac_anti_spoof;
npar->discard_tagged = esw_cfg.discard_tagged;
npar->promisc_mode = esw_cfg.promisc_mode;
esw_cfg.op_mode = QLCNIC_PORT_DEFAULTS;
esw_cfg.pci_func = pci_func;
esw_cfg.vlan_id = npar->pvid;
- esw_cfg.mac_learning = npar->mac_learning;
+ esw_cfg.mac_override = npar->mac_override;
esw_cfg.discard_tagged = npar->discard_tagged;
esw_cfg.mac_anti_spoof = npar->mac_anti_spoof;
esw_cfg.offload_flags = npar->offload_flags;
qlcnic_check_options(adapter);
+ err = qlcnic_set_eswitch_port_config(adapter);
+ if (err)
+ return err;
+
adapter->need_fw_reset = 0;
return err;
switch (esw_cfg[i].op_mode) {
case QLCNIC_PORT_DEFAULTS:
if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
- QLCNIC_NON_PRIV_FUNC)
+ QLCNIC_NON_PRIV_FUNC) {
esw_cfg[i].mac_anti_spoof = 0;
+ esw_cfg[i].mac_override = 1;
+ }
break;
case QLCNIC_ADD_VLAN:
if (!IS_VALID_VLAN(esw_cfg[i].vlan_id))
switch (esw_cfg[i].op_mode) {
case QLCNIC_PORT_DEFAULTS:
npar->promisc_mode = esw_cfg[i].promisc_mode;
- npar->mac_learning = esw_cfg[i].mac_learning;
+ npar->mac_override = esw_cfg[i].mac_override;
npar->offload_flags = esw_cfg[i].offload_flags;
npar->mac_anti_spoof = esw_cfg[i].mac_anti_spoof;
npar->discard_tagged = esw_cfg[i].discard_tagged;