diff options
author | Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> | 2011-07-13 23:16:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-14 11:49:44 -0400 |
commit | e5dcf6dcde26ffdbd237dda4956bc6d7115dfae6 (patch) | |
tree | f3ba42a0661b9eb7bbb005e43b801064ab51247d /drivers/net/qlcnic | |
parent | a941fef81b48179ea64728034f3ed5cda2336987 (diff) |
qlcnic: enable mac-learning in promiscous mode.
MAC learning is required in bridge mode.
During bridge mode device will be put in promiscous mode.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 2 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 7 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 13 |
3 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 7c0d6ee1697e..3ae24501911e 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -1015,6 +1015,7 @@ struct qlcnic_adapter { | |||
1015 | u8 mac_addr[ETH_ALEN]; | 1015 | u8 mac_addr[ETH_ALEN]; |
1016 | 1016 | ||
1017 | u64 dev_rst_time; | 1017 | u64 dev_rst_time; |
1018 | u8 mac_learn; | ||
1018 | unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)]; | 1019 | unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)]; |
1019 | 1020 | ||
1020 | struct qlcnic_npar_info *npars; | 1021 | struct qlcnic_npar_info *npars; |
@@ -1460,6 +1461,7 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev); | |||
1460 | int qlcnic_validate_max_rss(struct net_device *netdev, u8 max_hw, u8 val); | 1461 | int qlcnic_validate_max_rss(struct net_device *netdev, u8 max_hw, u8 val); |
1461 | int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data); | 1462 | int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data); |
1462 | void qlcnic_dev_request_reset(struct qlcnic_adapter *); | 1463 | void qlcnic_dev_request_reset(struct qlcnic_adapter *); |
1464 | void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); | ||
1463 | 1465 | ||
1464 | /* Management functions */ | 1466 | /* Management functions */ |
1465 | int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*); | 1467 | int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*); |
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index 0391a04695dd..4055c218ef2a 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -446,6 +446,13 @@ void qlcnic_set_multi(struct net_device *netdev) | |||
446 | } | 446 | } |
447 | 447 | ||
448 | send_fw_cmd: | 448 | send_fw_cmd: |
449 | if (mode == VPORT_MISS_MODE_ACCEPT_ALL) { | ||
450 | qlcnic_alloc_lb_filters_mem(adapter); | ||
451 | adapter->mac_learn = 1; | ||
452 | } else { | ||
453 | adapter->mac_learn = 0; | ||
454 | } | ||
455 | |||
449 | qlcnic_nic_set_promisc(adapter, mode); | 456 | qlcnic_nic_set_promisc(adapter, mode); |
450 | } | 457 | } |
451 | 458 | ||
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 6b646c65f2fd..916570db3aa4 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -90,7 +90,6 @@ static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev); | |||
90 | static void qlcnic_restore_indev_addr(struct net_device *dev, unsigned long); | 90 | static void qlcnic_restore_indev_addr(struct net_device *dev, unsigned long); |
91 | static int qlcnic_start_firmware(struct qlcnic_adapter *); | 91 | static int qlcnic_start_firmware(struct qlcnic_adapter *); |
92 | 92 | ||
93 | static void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); | ||
94 | static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); | 93 | static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); |
95 | static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); | 94 | static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); |
96 | static int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); | 95 | static int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); |
@@ -1578,6 +1577,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1578 | adapter->dev_rst_time = jiffies; | 1577 | adapter->dev_rst_time = jiffies; |
1579 | revision_id = pdev->revision; | 1578 | revision_id = pdev->revision; |
1580 | adapter->ahw->revision_id = revision_id; | 1579 | adapter->ahw->revision_id = revision_id; |
1580 | adapter->mac_learn = qlcnic_mac_learn; | ||
1581 | 1581 | ||
1582 | rwlock_init(&adapter->ahw->crb_lock); | 1582 | rwlock_init(&adapter->ahw->crb_lock); |
1583 | mutex_init(&adapter->ahw->mem_lock); | 1583 | mutex_init(&adapter->ahw->mem_lock); |
@@ -1654,7 +1654,9 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1654 | break; | 1654 | break; |
1655 | } | 1655 | } |
1656 | 1656 | ||
1657 | qlcnic_alloc_lb_filters_mem(adapter); | 1657 | if (adapter->mac_learn) |
1658 | qlcnic_alloc_lb_filters_mem(adapter); | ||
1659 | |||
1658 | qlcnic_create_diag_entries(adapter); | 1660 | qlcnic_create_diag_entries(adapter); |
1659 | 1661 | ||
1660 | return 0; | 1662 | return 0; |
@@ -1850,13 +1852,12 @@ static int qlcnic_close(struct net_device *netdev) | |||
1850 | return 0; | 1852 | return 0; |
1851 | } | 1853 | } |
1852 | 1854 | ||
1853 | static void | 1855 | void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter) |
1854 | qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter) | ||
1855 | { | 1856 | { |
1856 | void *head; | 1857 | void *head; |
1857 | int i; | 1858 | int i; |
1858 | 1859 | ||
1859 | if (!qlcnic_mac_learn) | 1860 | if (adapter->fhash.fmax && adapter->fhash.fhead) |
1860 | return; | 1861 | return; |
1861 | 1862 | ||
1862 | spin_lock_init(&adapter->mac_learn_lock); | 1863 | spin_lock_init(&adapter->mac_learn_lock); |
@@ -2286,7 +2287,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2286 | if (unlikely(qlcnic_tx_pkt(adapter, first_desc, skb))) | 2287 | if (unlikely(qlcnic_tx_pkt(adapter, first_desc, skb))) |
2287 | goto unwind_buff; | 2288 | goto unwind_buff; |
2288 | 2289 | ||
2289 | if (qlcnic_mac_learn) | 2290 | if (adapter->mac_learn) |
2290 | qlcnic_send_filter(adapter, tx_ring, first_desc, skb); | 2291 | qlcnic_send_filter(adapter, tx_ring, first_desc, skb); |
2291 | 2292 | ||
2292 | qlcnic_update_cmd_producer(adapter, tx_ring); | 2293 | qlcnic_update_cmd_producer(adapter, tx_ring); |