diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-03-09 04:50:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-10 08:10:03 -0400 |
commit | becf46a012db667c562bbbe589c14e100b62e5a4 (patch) | |
tree | 1f6946aac18946fe2df637da385ac1020f755f76 /drivers/net/netxen/netxen_nic_main.c | |
parent | 9f5bc7f1908665d7cf379f698c7bdc53bc10da85 (diff) |
netxen: cleanup superfluous multi-context code
MAX_RCV_CTX was set to 1, there's only rx context per
PCI function.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 2953a83bc856..3b4d923f947d 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -790,7 +790,7 @@ netxen_nic_attach(struct netxen_adapter *adapter) | |||
790 | { | 790 | { |
791 | struct net_device *netdev = adapter->netdev; | 791 | struct net_device *netdev = adapter->netdev; |
792 | struct pci_dev *pdev = adapter->pdev; | 792 | struct pci_dev *pdev = adapter->pdev; |
793 | int err, ctx, ring; | 793 | int err, ring; |
794 | 794 | ||
795 | err = netxen_init_firmware(adapter); | 795 | err = netxen_init_firmware(adapter); |
796 | if (err != 0) { | 796 | if (err != 0) { |
@@ -829,10 +829,8 @@ netxen_nic_attach(struct netxen_adapter *adapter) | |||
829 | netxen_nic_update_cmd_consumer(adapter, 0); | 829 | netxen_nic_update_cmd_consumer(adapter, 0); |
830 | } | 830 | } |
831 | 831 | ||
832 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 832 | for (ring = 0; ring < adapter->max_rds_rings; ring++) |
833 | for (ring = 0; ring < adapter->max_rds_rings; ring++) | 833 | netxen_post_rx_buffers(adapter, ring); |
834 | netxen_post_rx_buffers(adapter, ctx, ring); | ||
835 | } | ||
836 | 834 | ||
837 | err = netxen_nic_request_irq(adapter); | 835 | err = netxen_nic_request_irq(adapter); |
838 | if (err) { | 836 | if (err) { |
@@ -1640,30 +1638,14 @@ static irqreturn_t netxen_msix_intr(int irq, void *data) | |||
1640 | 1638 | ||
1641 | static int netxen_nic_poll(struct napi_struct *napi, int budget) | 1639 | static int netxen_nic_poll(struct napi_struct *napi, int budget) |
1642 | { | 1640 | { |
1643 | struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi); | 1641 | struct netxen_adapter *adapter = |
1642 | container_of(napi, struct netxen_adapter, napi); | ||
1644 | int tx_complete; | 1643 | int tx_complete; |
1645 | int ctx; | ||
1646 | int work_done; | 1644 | int work_done; |
1647 | 1645 | ||
1648 | tx_complete = netxen_process_cmd_ring(adapter); | 1646 | tx_complete = netxen_process_cmd_ring(adapter); |
1649 | 1647 | ||
1650 | work_done = 0; | 1648 | work_done = netxen_process_rcv_ring(adapter, budget); |
1651 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | ||
1652 | /* | ||
1653 | * Fairness issue. This will give undue weight to the | ||
1654 | * receive context 0. | ||
1655 | */ | ||
1656 | |||
1657 | /* | ||
1658 | * To avoid starvation, we give each of our receivers, | ||
1659 | * a fraction of the quota. Sometimes, it might happen that we | ||
1660 | * have enough quota to process every packet, but since all the | ||
1661 | * packets are on one context, it gets only half of the quota, | ||
1662 | * and ends up not processing it. | ||
1663 | */ | ||
1664 | work_done += netxen_process_rcv_ring(adapter, ctx, | ||
1665 | budget / MAX_RCV_CTX); | ||
1666 | } | ||
1667 | 1649 | ||
1668 | if ((work_done < budget) && tx_complete) { | 1650 | if ((work_done < budget) && tx_complete) { |
1669 | napi_complete(&adapter->napi); | 1651 | napi_complete(&adapter->napi); |