Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlcnic: fix promiscous mode for VF

o Allow promiscous mode setting for VF's depending upon the configuration.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Rajesh Borundia and committed by
David S. Miller
ee07c1a7 6336acd5

+10 -3
+1
drivers/net/qlcnic/qlcnic.h
··· 920 920 #define QLCNIC_TAGGING_ENABLED 0x100 921 921 #define QLCNIC_MACSPOOF 0x200 922 922 #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 923 + #define QLCNIC_PROMISC_DISABLED 0x800 923 924 #define QLCNIC_IS_MSI_FAMILY(adapter) \ 924 925 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) 925 926
+2 -1
drivers/net/qlcnic/qlcnic_hw.c
··· 442 442 qlcnic_nic_add_mac(adapter, bcast_addr); 443 443 444 444 if (netdev->flags & IFF_PROMISC) { 445 - mode = VPORT_MISS_MODE_ACCEPT_ALL; 445 + if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) 446 + mode = VPORT_MISS_MODE_ACCEPT_ALL; 446 447 goto send_fw_cmd; 447 448 } 448 449
+7 -2
drivers/net/qlcnic/qlcnic_main.c
··· 718 718 qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, 719 719 struct qlcnic_esw_func_cfg *esw_cfg) 720 720 { 721 - adapter->flags &= ~QLCNIC_MACSPOOF; 722 - adapter->flags &= ~QLCNIC_MAC_OVERRIDE_DISABLED; 721 + adapter->flags &= ~(QLCNIC_MACSPOOF | QLCNIC_MAC_OVERRIDE_DISABLED | 722 + QLCNIC_PROMISC_DISABLED); 723 723 724 724 if (esw_cfg->mac_anti_spoof) 725 725 adapter->flags |= QLCNIC_MACSPOOF; 726 726 727 727 if (!esw_cfg->mac_override) 728 728 adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED; 729 + 730 + if (!esw_cfg->promisc_mode) 731 + adapter->flags |= QLCNIC_PROMISC_DISABLED; 729 732 730 733 qlcnic_set_netdev_features(adapter, esw_cfg); 731 734 } ··· 848 845 esw_cfg.pci_func = i; 849 846 esw_cfg.offload_flags = BIT_0; 850 847 esw_cfg.mac_override = BIT_0; 848 + esw_cfg.promisc_mode = BIT_0; 851 849 if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) 852 850 esw_cfg.offload_flags |= (BIT_1 | BIT_2); 853 851 if (qlcnic_config_switch_port(adapter, &esw_cfg)) ··· 3575 3571 QLCNIC_NON_PRIV_FUNC) { 3576 3572 esw_cfg[i].mac_anti_spoof = 0; 3577 3573 esw_cfg[i].mac_override = 1; 3574 + esw_cfg[i].promisc_mode = 1; 3578 3575 } 3579 3576 break; 3580 3577 case QLCNIC_ADD_VLAN: