Commit aec1e845 authored by Amit Kumar Salecha's avatar Amit Kumar Salecha Committed by David S. Miller

qlcnic: vlan lro support

LRO + GRO + vlan rx accleration support, performance increases
around 20% and cpu utilization reduces around 70% on vlan interface.
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5718d3b4
...@@ -107,7 +107,7 @@ static irqreturn_t qlcnic_msi_intr(int irq, void *data); ...@@ -107,7 +107,7 @@ static irqreturn_t qlcnic_msi_intr(int irq, void *data);
static irqreturn_t qlcnic_msix_intr(int irq, void *data); static irqreturn_t qlcnic_msix_intr(int irq, void *data);
static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev); static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev);
static void qlcnic_config_indev_addr(struct net_device *dev, unsigned long); static void qlcnic_restore_indev_addr(struct net_device *dev, unsigned long);
static int qlcnic_start_firmware(struct qlcnic_adapter *); static int qlcnic_start_firmware(struct qlcnic_adapter *);
static void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); static void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter);
...@@ -1759,7 +1759,7 @@ qlcnic_resume(struct pci_dev *pdev) ...@@ -1759,7 +1759,7 @@ qlcnic_resume(struct pci_dev *pdev)
if (err) if (err)
goto done; goto done;
qlcnic_config_indev_addr(netdev, NETDEV_UP); qlcnic_restore_indev_addr(netdev, NETDEV_UP);
} }
done: done:
netif_device_attach(netdev); netif_device_attach(netdev);
...@@ -2958,7 +2958,7 @@ qlcnic_attach_work(struct work_struct *work) ...@@ -2958,7 +2958,7 @@ qlcnic_attach_work(struct work_struct *work)
if (qlcnic_up(adapter, netdev)) if (qlcnic_up(adapter, netdev))
goto done; goto done;
qlcnic_config_indev_addr(netdev, NETDEV_UP); qlcnic_restore_indev_addr(netdev, NETDEV_UP);
} }
done: done:
...@@ -3120,7 +3120,7 @@ static int qlcnic_attach_func(struct pci_dev *pdev) ...@@ -3120,7 +3120,7 @@ static int qlcnic_attach_func(struct pci_dev *pdev)
if (err) if (err)
goto done; goto done;
qlcnic_config_indev_addr(netdev, NETDEV_UP); qlcnic_restore_indev_addr(netdev, NETDEV_UP);
} }
done: done:
netif_device_attach(netdev); netif_device_attach(netdev);
...@@ -4035,10 +4035,10 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) ...@@ -4035,10 +4035,10 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
#define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops) #define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops)
static void static void
qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) qlcnic_config_indev_addr(struct qlcnic_adapter *adapter,
struct net_device *dev, unsigned long event)
{ {
struct in_device *indev; struct in_device *indev;
struct qlcnic_adapter *adapter = netdev_priv(dev);
indev = in_dev_get(dev); indev = in_dev_get(dev);
if (!indev) if (!indev)
...@@ -4062,6 +4062,27 @@ qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) ...@@ -4062,6 +4062,27 @@ qlcnic_config_indev_addr(struct net_device *dev, unsigned long event)
in_dev_put(indev); in_dev_put(indev);
} }
static void
qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct net_device *dev;
u16 vid;
qlcnic_config_indev_addr(adapter, netdev, event);
if (!adapter->vlgrp)
return;
for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
dev = vlan_group_get_device(adapter->vlgrp, vid);
if (!dev)
continue;
qlcnic_config_indev_addr(adapter, dev, event);
}
}
static int qlcnic_netdev_event(struct notifier_block *this, static int qlcnic_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr) unsigned long event, void *ptr)
{ {
...@@ -4088,7 +4109,7 @@ static int qlcnic_netdev_event(struct notifier_block *this, ...@@ -4088,7 +4109,7 @@ static int qlcnic_netdev_event(struct notifier_block *this,
if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
goto done; goto done;
qlcnic_config_indev_addr(dev, event); qlcnic_config_indev_addr(adapter, dev, event);
done: done:
return NOTIFY_DONE; return NOTIFY_DONE;
} }
...@@ -4105,7 +4126,7 @@ qlcnic_inetaddr_event(struct notifier_block *this, ...@@ -4105,7 +4126,7 @@ qlcnic_inetaddr_event(struct notifier_block *this,
dev = ifa->ifa_dev ? ifa->ifa_dev->dev : NULL; dev = ifa->ifa_dev ? ifa->ifa_dev->dev : NULL;
recheck: recheck:
if (dev == NULL || !netif_running(dev)) if (dev == NULL)
goto done; goto done;
if (dev->priv_flags & IFF_802_1Q_VLAN) { if (dev->priv_flags & IFF_802_1Q_VLAN) {
...@@ -4148,7 +4169,7 @@ static struct notifier_block qlcnic_inetaddr_cb = { ...@@ -4148,7 +4169,7 @@ static struct notifier_block qlcnic_inetaddr_cb = {
}; };
#else #else
static void static void
qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) qlcnic_restore_indev_addr(struct net_device *dev, unsigned long event)
{ } { }
#endif #endif
static struct pci_error_handlers qlcnic_err_handler = { static struct pci_error_handlers qlcnic_err_handler = {
......
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