aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2014-11-07 20:39:56 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-11-20 17:48:24 -0500
commit688ff32db2f7e7074df4eb6871afa65dee41c98f (patch)
treeef46a0b1c96d6009891f7226054875d574b7b178 /drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
parent6622402a72580afee68e961e37020894dedbecb6 (diff)
ixgbevf: add netpoll support
This patch adds ixgbevf_netpoll() a callback for .ndo_poll_controller to allow for the VF interface to be used with netconsole. CC: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 70a2b8fe40ba..755f71f07ae1 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -344,10 +344,8 @@ static void ixgbevf_rx_skb(struct ixgbevf_q_vector *q_vector,
344 return; 344 return;
345 } 345 }
346#endif /* CONFIG_NET_RX_BUSY_POLL */ 346#endif /* CONFIG_NET_RX_BUSY_POLL */
347 if (!(q_vector->adapter->flags & IXGBE_FLAG_IN_NETPOLL)) 347
348 napi_gro_receive(&q_vector->napi, skb); 348 napi_gro_receive(&q_vector->napi, skb);
349 else
350 netif_rx(skb);
351} 349}
352 350
353/* ixgbevf_rx_checksum - indicate in skb if hw indicated a good cksum 351/* ixgbevf_rx_checksum - indicate in skb if hw indicated a good cksum
@@ -919,12 +917,10 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
919 else 917 else
920 per_ring_budget = budget; 918 per_ring_budget = budget;
921 919
922 adapter->flags |= IXGBE_FLAG_IN_NETPOLL;
923 ixgbevf_for_each_ring(ring, q_vector->rx) 920 ixgbevf_for_each_ring(ring, q_vector->rx)
924 clean_complete &= (ixgbevf_clean_rx_irq(q_vector, ring, 921 clean_complete &= (ixgbevf_clean_rx_irq(q_vector, ring,
925 per_ring_budget) 922 per_ring_budget)
926 < per_ring_budget); 923 < per_ring_budget);
927 adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL;
928 924
929#ifdef CONFIG_NET_RX_BUSY_POLL 925#ifdef CONFIG_NET_RX_BUSY_POLL
930 ixgbevf_qv_unlock_napi(q_vector); 926 ixgbevf_qv_unlock_napi(q_vector);
@@ -3553,6 +3549,24 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
3553 return 0; 3549 return 0;
3554} 3550}
3555 3551
3552#ifdef CONFIG_NET_POLL_CONTROLLER
3553/* Polling 'interrupt' - used by things like netconsole to send skbs
3554 * without having to re-enable interrupts. It's not called while
3555 * the interrupt routine is executing.
3556 */
3557static void ixgbevf_netpoll(struct net_device *netdev)
3558{
3559 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
3560 int i;
3561
3562 /* if interface is down do nothing */
3563 if (test_bit(__IXGBEVF_DOWN, &adapter->state))
3564 return;
3565 for (i = 0; i < adapter->num_rx_queues; i++)
3566 ixgbevf_msix_clean_rings(0, adapter->q_vector[i]);
3567}
3568#endif /* CONFIG_NET_POLL_CONTROLLER */
3569
3556static int ixgbevf_suspend(struct pci_dev *pdev, pm_message_t state) 3570static int ixgbevf_suspend(struct pci_dev *pdev, pm_message_t state)
3557{ 3571{
3558 struct net_device *netdev = pci_get_drvdata(pdev); 3572 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -3689,6 +3703,9 @@ static const struct net_device_ops ixgbevf_netdev_ops = {
3689#ifdef CONFIG_NET_RX_BUSY_POLL 3703#ifdef CONFIG_NET_RX_BUSY_POLL
3690 .ndo_busy_poll = ixgbevf_busy_poll_recv, 3704 .ndo_busy_poll = ixgbevf_busy_poll_recv,
3691#endif 3705#endif
3706#ifdef CONFIG_NET_POLL_CONTROLLER
3707 .ndo_poll_controller = ixgbevf_netpoll,
3708#endif
3692}; 3709};
3693 3710
3694static void ixgbevf_assign_netdev_ops(struct net_device *dev) 3711static void ixgbevf_assign_netdev_ops(struct net_device *dev)