fm10k: Add netconsole support
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 11 Apr 2015 02:14:31 +0000 (19:14 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 14 Apr 2015 22:08:37 +0000 (15:08 -0700)
This change adds a function called "fm10k_netpoll" that's used to define
"ndo_poll_controller" in "fm10k_netdev_ops". This is required to enable
support for "netconsole" in fm10k.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>
Acked-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k.h
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
drivers/net/ethernet/intel/fm10k/fm10k_pci.c

index 65e70016abfb315ff56e12e9d5960ae249bf5cf1..b45f7978b9e6f42ace501fcbbbb34c78a5c5b7a0 100644 (file)
@@ -457,6 +457,9 @@ void fm10k_down(struct fm10k_intfc *interface);
 void fm10k_update_stats(struct fm10k_intfc *interface);
 void fm10k_service_event_schedule(struct fm10k_intfc *interface);
 void fm10k_update_rx_drop_en(struct fm10k_intfc *interface);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+void fm10k_netpoll(struct net_device *netdev);
+#endif
 
 /* Netdev */
 struct net_device *fm10k_alloc_netdev(void);
index a7db5e20e1f7eb52cc758e4166f074206d8fb325..702d84547ba19837be244b65fb71d31ee212ef51 100644 (file)
@@ -1382,6 +1382,9 @@ static const struct net_device_ops fm10k_netdev_ops = {
        .ndo_do_ioctl           = fm10k_ioctl,
        .ndo_dfwd_add_station   = fm10k_dfwd_add_station,
        .ndo_dfwd_del_station   = fm10k_dfwd_del_station,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = fm10k_netpoll,
+#endif
        .ndo_features_check     = fm10k_features_check,
 };
 
index 6fc9965795877b83bb11af0c54ee39642c9580d3..90d6faefb8bde49ce76b118dd41e45388f391f33 100644 (file)
@@ -839,6 +839,28 @@ static irqreturn_t fm10k_msix_mbx_vf(int irq, void *data)
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/**
+ *  fm10k_netpoll - A Polling 'interrupt' handler
+ *  @netdev: network interface device structure
+ *
+ *  This is used by netconsole to send skbs without having to re-enable
+ *  interrupts. It's not called while the normal interrupt routine is executing.
+ **/
+void fm10k_netpoll(struct net_device *netdev)
+{
+       struct fm10k_intfc *interface = netdev_priv(netdev);
+       int i;
+
+       /* if interface is down do nothing */
+       if (test_bit(__FM10K_DOWN, &interface->state))
+               return;
+
+       for (i = 0; i < interface->num_q_vectors; i++)
+               fm10k_msix_clean_rings(0, interface->q_vector[i]);
+}
+
+#endif
 #define FM10K_ERR_MSG(type) case (type): error = #type; break
 static void fm10k_print_fault(struct fm10k_intfc *interface, int type,
                              struct fm10k_fault *fault)