Commit eebbbdba authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dda0e083
......@@ -280,9 +280,8 @@ struct igb_adapter {
#define IGB_FLAG_HAS_MSI (1 << 0)
#define IGB_FLAG_MSI_ENABLE (1 << 1)
#define IGB_FLAG_DCA_ENABLED (1 << 2)
#define IGB_FLAG_IN_NETPOLL (1 << 3)
#define IGB_FLAG_QUAD_PORT_A (1 << 4)
#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
#define IGB_FLAG_QUAD_PORT_A (1 << 3)
#define IGB_FLAG_NEED_CTX_IDX (1 << 4)
enum e1000_state_t {
__IGB_TESTING,
......
......@@ -4378,22 +4378,27 @@ static void igb_shutdown(struct pci_dev *pdev)
static void igb_netpoll(struct net_device *netdev)
{
struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
int i;
int work_done = 0;
if (!adapter->msix_entries) {
igb_irq_disable(adapter);
adapter->flags |= IGB_FLAG_IN_NETPOLL;
for (i = 0; i < adapter->num_tx_queues; i++)
igb_clean_tx_irq(&adapter->tx_ring[i]);
napi_schedule(&adapter->rx_ring[0].napi);
return;
}
for (i = 0; i < adapter->num_rx_queues; i++)
igb_clean_rx_irq_adv(&adapter->rx_ring[i],
&work_done,
adapter->rx_ring[i].napi.weight);
for (i = 0; i < adapter->num_tx_queues; i++) {
struct igb_ring *tx_ring = &adapter->tx_ring[i];
wr32(E1000_EIMC, tx_ring->eims_value);
igb_clean_tx_irq(tx_ring);
wr32(E1000_EIMS, tx_ring->eims_value);
}
adapter->flags &= ~IGB_FLAG_IN_NETPOLL;
igb_irq_enable(adapter);
for (i = 0; i < adapter->num_rx_queues; i++) {
struct igb_ring *rx_ring = &adapter->rx_ring[i];
wr32(E1000_EIMC, rx_ring->eims_value);
napi_schedule(&rx_ring->napi);
}
}
#endif /* CONFIG_NET_POLL_CONTROLLER */
......
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