aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-02-06 18:19:29 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-07 05:43:09 -0500
commiteebbbdba5eb44406061e4dff130257b654773d3f (patch)
treeec8d2464ca663f92ea37af967be146be774dff06 /drivers/net/igb
parentdda0e0834c839c0e4b1717cbe9c22c35ca935809 (diff)
igb: cleanup igb_netpoll to be more friendly with napi & GRO
This patch cleans up igb_netpoll so that it is more friendly with both the current napi and newly introduced GRO features. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb.h5
-rw-r--r--drivers/net/igb/igb_main.c37
2 files changed, 23 insertions, 19 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 88fdfe4961d8..0519ae408af9 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -280,9 +280,8 @@ struct igb_adapter {
280#define IGB_FLAG_HAS_MSI (1 << 0) 280#define IGB_FLAG_HAS_MSI (1 << 0)
281#define IGB_FLAG_MSI_ENABLE (1 << 1) 281#define IGB_FLAG_MSI_ENABLE (1 << 1)
282#define IGB_FLAG_DCA_ENABLED (1 << 2) 282#define IGB_FLAG_DCA_ENABLED (1 << 2)
283#define IGB_FLAG_IN_NETPOLL (1 << 3) 283#define IGB_FLAG_QUAD_PORT_A (1 << 3)
284#define IGB_FLAG_QUAD_PORT_A (1 << 4) 284#define IGB_FLAG_NEED_CTX_IDX (1 << 4)
285#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
286 285
287enum e1000_state_t { 286enum e1000_state_t {
288 __IGB_TESTING, 287 __IGB_TESTING,
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index c05ca3461f60..3bf560f0fde9 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -404,7 +404,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
404 /* Turn on MSI-X capability first, or our settings 404 /* Turn on MSI-X capability first, or our settings
405 * won't stick. And it will take days to debug. */ 405 * won't stick. And it will take days to debug. */
406 wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE | 406 wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
407 E1000_GPIE_PBA | E1000_GPIE_EIAME | 407 E1000_GPIE_PBA | E1000_GPIE_EIAME |
408 E1000_GPIE_NSICR); 408 E1000_GPIE_NSICR);
409 409
410 for (i = 0; i < adapter->num_tx_queues; i++) { 410 for (i = 0; i < adapter->num_tx_queues; i++) {
@@ -1629,7 +1629,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
1629 for (i = 0; i < IGB_MAX_TX_QUEUES; i++) { 1629 for (i = 0; i < IGB_MAX_TX_QUEUES; i++) {
1630 r_idx = i % adapter->num_tx_queues; 1630 r_idx = i % adapter->num_tx_queues;
1631 adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx]; 1631 adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx];
1632 } 1632 }
1633 return err; 1633 return err;
1634} 1634}
1635 1635
@@ -3298,7 +3298,7 @@ static irqreturn_t igb_msix_other(int irq, void *data)
3298 /* guard against interrupt when we're going down */ 3298 /* guard against interrupt when we're going down */
3299 if (!test_bit(__IGB_DOWN, &adapter->state)) 3299 if (!test_bit(__IGB_DOWN, &adapter->state))
3300 mod_timer(&adapter->watchdog_timer, jiffies + 1); 3300 mod_timer(&adapter->watchdog_timer, jiffies + 1);
3301 3301
3302no_link_interrupt: 3302no_link_interrupt:
3303 wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC); 3303 wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC);
3304 wr32(E1000_EIMS, adapter->eims_other); 3304 wr32(E1000_EIMS, adapter->eims_other);
@@ -3751,7 +3751,7 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
3751 3751
3752/** 3752/**
3753 * igb_receive_skb - helper function to handle rx indications 3753 * igb_receive_skb - helper function to handle rx indications
3754 * @ring: pointer to receive ring receving this packet 3754 * @ring: pointer to receive ring receving this packet
3755 * @status: descriptor status field as written by hardware 3755 * @status: descriptor status field as written by hardware
3756 * @vlan: descriptor vlan field as written by hardware (no le/be conversion) 3756 * @vlan: descriptor vlan field as written by hardware (no le/be conversion)
3757 * @skb: pointer to sk_buff to be indicated to stack 3757 * @skb: pointer to sk_buff to be indicated to stack
@@ -4378,22 +4378,27 @@ static void igb_shutdown(struct pci_dev *pdev)
4378static void igb_netpoll(struct net_device *netdev) 4378static void igb_netpoll(struct net_device *netdev)
4379{ 4379{
4380 struct igb_adapter *adapter = netdev_priv(netdev); 4380 struct igb_adapter *adapter = netdev_priv(netdev);
4381 struct e1000_hw *hw = &adapter->hw;
4381 int i; 4382 int i;
4382 int work_done = 0;
4383 4383
4384 igb_irq_disable(adapter); 4384 if (!adapter->msix_entries) {
4385 adapter->flags |= IGB_FLAG_IN_NETPOLL; 4385 igb_irq_disable(adapter);
4386 4386 napi_schedule(&adapter->rx_ring[0].napi);
4387 for (i = 0; i < adapter->num_tx_queues; i++) 4387 return;
4388 igb_clean_tx_irq(&adapter->tx_ring[i]); 4388 }
4389 4389
4390 for (i = 0; i < adapter->num_rx_queues; i++) 4390 for (i = 0; i < adapter->num_tx_queues; i++) {
4391 igb_clean_rx_irq_adv(&adapter->rx_ring[i], 4391 struct igb_ring *tx_ring = &adapter->tx_ring[i];
4392 &work_done, 4392 wr32(E1000_EIMC, tx_ring->eims_value);
4393 adapter->rx_ring[i].napi.weight); 4393 igb_clean_tx_irq(tx_ring);
4394 wr32(E1000_EIMS, tx_ring->eims_value);
4395 }
4394 4396
4395 adapter->flags &= ~IGB_FLAG_IN_NETPOLL; 4397 for (i = 0; i < adapter->num_rx_queues; i++) {
4396 igb_irq_enable(adapter); 4398 struct igb_ring *rx_ring = &adapter->rx_ring[i];
4399 wr32(E1000_EIMC, rx_ring->eims_value);
4400 napi_schedule(&rx_ring->napi);
4401 }
4397} 4402}
4398#endif /* CONFIG_NET_POLL_CONTROLLER */ 4403#endif /* CONFIG_NET_POLL_CONTROLLER */
4399 4404