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

qlcnic: fix promiscous mode for VF

o Allow promiscous mode setting for VF's depending upon the configuration.
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 6336acd5
...@@ -920,6 +920,7 @@ struct qlcnic_ipaddr { ...@@ -920,6 +920,7 @@ struct qlcnic_ipaddr {
#define QLCNIC_TAGGING_ENABLED 0x100 #define QLCNIC_TAGGING_ENABLED 0x100
#define QLCNIC_MACSPOOF 0x200 #define QLCNIC_MACSPOOF 0x200
#define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400
#define QLCNIC_PROMISC_DISABLED 0x800
#define QLCNIC_IS_MSI_FAMILY(adapter) \ #define QLCNIC_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
......
...@@ -442,7 +442,8 @@ void qlcnic_set_multi(struct net_device *netdev) ...@@ -442,7 +442,8 @@ void qlcnic_set_multi(struct net_device *netdev)
qlcnic_nic_add_mac(adapter, bcast_addr); qlcnic_nic_add_mac(adapter, bcast_addr);
if (netdev->flags & IFF_PROMISC) { if (netdev->flags & IFF_PROMISC) {
mode = VPORT_MISS_MODE_ACCEPT_ALL; if (!(adapter->flags & QLCNIC_PROMISC_DISABLED))
mode = VPORT_MISS_MODE_ACCEPT_ALL;
goto send_fw_cmd; goto send_fw_cmd;
} }
......
...@@ -718,8 +718,8 @@ static void ...@@ -718,8 +718,8 @@ static void
qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, 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 | QLCNIC_MAC_OVERRIDE_DISABLED |
adapter->flags &= ~QLCNIC_MAC_OVERRIDE_DISABLED; QLCNIC_PROMISC_DISABLED);
if (esw_cfg->mac_anti_spoof) if (esw_cfg->mac_anti_spoof)
adapter->flags |= QLCNIC_MACSPOOF; adapter->flags |= QLCNIC_MACSPOOF;
...@@ -727,6 +727,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, ...@@ -727,6 +727,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter,
if (!esw_cfg->mac_override) if (!esw_cfg->mac_override)
adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED; adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED;
if (!esw_cfg->promisc_mode)
adapter->flags |= QLCNIC_PROMISC_DISABLED;
qlcnic_set_netdev_features(adapter, esw_cfg); qlcnic_set_netdev_features(adapter, esw_cfg);
} }
...@@ -845,6 +848,7 @@ qlcnic_set_default_offload_settings(struct qlcnic_adapter *adapter) ...@@ -845,6 +848,7 @@ qlcnic_set_default_offload_settings(struct qlcnic_adapter *adapter)
esw_cfg.pci_func = i; esw_cfg.pci_func = i;
esw_cfg.offload_flags = BIT_0; esw_cfg.offload_flags = BIT_0;
esw_cfg.mac_override = BIT_0; esw_cfg.mac_override = BIT_0;
esw_cfg.promisc_mode = BIT_0;
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO)
esw_cfg.offload_flags |= (BIT_1 | BIT_2); esw_cfg.offload_flags |= (BIT_1 | BIT_2);
if (qlcnic_config_switch_port(adapter, &esw_cfg)) if (qlcnic_config_switch_port(adapter, &esw_cfg))
...@@ -3571,6 +3575,7 @@ validate_esw_config(struct qlcnic_adapter *adapter, ...@@ -3571,6 +3575,7 @@ validate_esw_config(struct qlcnic_adapter *adapter,
QLCNIC_NON_PRIV_FUNC) { QLCNIC_NON_PRIV_FUNC) {
esw_cfg[i].mac_anti_spoof = 0; esw_cfg[i].mac_anti_spoof = 0;
esw_cfg[i].mac_override = 1; esw_cfg[i].mac_override = 1;
esw_cfg[i].promisc_mode = 1;
} }
break; break;
case QLCNIC_ADD_VLAN: case QLCNIC_ADD_VLAN:
......
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