aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2014-09-20 19:49:25 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-09-23 06:59:17 -0400
commitb7d8514c2320138be24b04e81a83afe1fa23d3c1 (patch)
tree57491ef7d8568b1b822b8bfcde31d1178eca8e06 /drivers/net
parente27ef599abc559dfc9b40910071cb6f27277e243 (diff)
fm10k: Add service task to handle delayed events
This patch adds support for the service task. The service task takes care of all processes that cannot be done in interrupt context such as resets, stats updates, TC prio updates, and checking for hung or detached devices. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k.h25
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_pci.c435
2 files changed, 460 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index c641f41a7aba..26a30baa1990 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -239,8 +239,21 @@ struct fm10k_intfc {
239 /* TX */ 239 /* TX */
240 struct fm10k_ring *tx_ring[MAX_QUEUES] ____cacheline_aligned_in_smp; 240 struct fm10k_ring *tx_ring[MAX_QUEUES] ____cacheline_aligned_in_smp;
241 241
242 u64 restart_queue;
243 u64 tx_busy;
244 u64 tx_csum_errors;
245 u64 alloc_failed;
246 u64 rx_csum_errors;
247 u64 rx_errors;
248
249 u64 tx_bytes_nic;
250 u64 tx_packets_nic;
251 u64 rx_bytes_nic;
252 u64 rx_packets_nic;
253 u64 rx_drops_nic;
242 u64 rx_overrun_pf; 254 u64 rx_overrun_pf;
243 u64 rx_overrun_vf; 255 u64 rx_overrun_vf;
256 u32 tx_timeout_count;
244 257
245 /* RX */ 258 /* RX */
246 struct fm10k_ring *rx_ring[MAX_QUEUES]; 259 struct fm10k_ring *rx_ring[MAX_QUEUES];
@@ -257,6 +270,13 @@ struct fm10k_intfc {
257 u16 msg_enable; 270 u16 msg_enable;
258 u16 tx_ring_count; 271 u16 tx_ring_count;
259 u16 rx_ring_count; 272 u16 rx_ring_count;
273 struct timer_list service_timer;
274 struct work_struct service_task;
275 unsigned long next_stats_update;
276 unsigned long next_tx_hang_check;
277 unsigned long last_reset;
278 unsigned long link_down_event;
279 bool host_ready;
260 280
261 u32 reta[FM10K_RETA_SIZE]; 281 u32 reta[FM10K_RETA_SIZE];
262 u32 rssrk[FM10K_RSSRK_SIZE]; 282 u32 rssrk[FM10K_RSSRK_SIZE];
@@ -280,6 +300,8 @@ struct fm10k_intfc {
280enum fm10k_state_t { 300enum fm10k_state_t {
281 __FM10K_RESETTING, 301 __FM10K_RESETTING,
282 __FM10K_DOWN, 302 __FM10K_DOWN,
303 __FM10K_SERVICE_SCHED,
304 __FM10K_SERVICE_DISABLE,
283 __FM10K_MBX_LOCK, 305 __FM10K_MBX_LOCK,
284 __FM10K_LINK_DOWN, 306 __FM10K_LINK_DOWN,
285}; 307};
@@ -379,6 +401,9 @@ int fm10k_register_pci_driver(void);
379void fm10k_unregister_pci_driver(void); 401void fm10k_unregister_pci_driver(void);
380void fm10k_up(struct fm10k_intfc *interface); 402void fm10k_up(struct fm10k_intfc *interface);
381void fm10k_down(struct fm10k_intfc *interface); 403void fm10k_down(struct fm10k_intfc *interface);
404void fm10k_update_stats(struct fm10k_intfc *interface);
405void fm10k_service_event_schedule(struct fm10k_intfc *interface);
406void fm10k_update_rx_drop_en(struct fm10k_intfc *interface);
382 407
383/* Netdev */ 408/* Netdev */
384struct net_device *fm10k_alloc_netdev(void); 409struct net_device *fm10k_alloc_netdev(void);
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 5a28298a19f8..33d6f47a1bf1 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -87,6 +87,404 @@ static int fm10k_hw_ready(struct fm10k_intfc *interface)
87 return FM10K_REMOVED(hw->hw_addr) ? -ENODEV : 0; 87 return FM10K_REMOVED(hw->hw_addr) ? -ENODEV : 0;
88} 88}
89 89
90void fm10k_service_event_schedule(struct fm10k_intfc *interface)
91{
92 if (!test_bit(__FM10K_SERVICE_DISABLE, &interface->state) &&
93 !test_and_set_bit(__FM10K_SERVICE_SCHED, &interface->state))
94 schedule_work(&interface->service_task);
95}
96
97static void fm10k_service_event_complete(struct fm10k_intfc *interface)
98{
99 BUG_ON(!test_bit(__FM10K_SERVICE_SCHED, &interface->state));
100
101 /* flush memory to make sure state is correct before next watchog */
102 smp_mb__before_atomic();
103 clear_bit(__FM10K_SERVICE_SCHED, &interface->state);
104}
105
106/**
107 * fm10k_service_timer - Timer Call-back
108 * @data: pointer to interface cast into an unsigned long
109 **/
110static void fm10k_service_timer(unsigned long data)
111{
112 struct fm10k_intfc *interface = (struct fm10k_intfc *)data;
113
114 /* Reset the timer */
115 mod_timer(&interface->service_timer, (HZ * 2) + jiffies);
116
117 fm10k_service_event_schedule(interface);
118}
119
120static void fm10k_detach_subtask(struct fm10k_intfc *interface)
121{
122 struct net_device *netdev = interface->netdev;
123
124 /* do nothing if device is still present or hw_addr is set */
125 if (netif_device_present(netdev) || interface->hw.hw_addr)
126 return;
127
128 rtnl_lock();
129
130 if (netif_running(netdev))
131 dev_close(netdev);
132
133 rtnl_unlock();
134}
135
136static void fm10k_reinit(struct fm10k_intfc *interface)
137{
138 struct net_device *netdev = interface->netdev;
139 struct fm10k_hw *hw = &interface->hw;
140 int err;
141
142 WARN_ON(in_interrupt());
143
144 /* put off any impending NetWatchDogTimeout */
145 netdev->trans_start = jiffies;
146
147 while (test_and_set_bit(__FM10K_RESETTING, &interface->state))
148 usleep_range(1000, 2000);
149
150 rtnl_lock();
151
152 if (netif_running(netdev))
153 fm10k_close(netdev);
154
155 fm10k_mbx_free_irq(interface);
156
157 /* delay any future reset requests */
158 interface->last_reset = jiffies + (10 * HZ);
159
160 /* reset and initialize the hardware so it is in a known state */
161 err = hw->mac.ops.reset_hw(hw) ? : hw->mac.ops.init_hw(hw);
162 if (err)
163 dev_err(&interface->pdev->dev, "init_hw failed: %d\n", err);
164
165 /* reassociate interrupts */
166 fm10k_mbx_request_irq(interface);
167
168 if (netif_running(netdev))
169 fm10k_open(netdev);
170
171 rtnl_unlock();
172
173 clear_bit(__FM10K_RESETTING, &interface->state);
174}
175
176static void fm10k_reset_subtask(struct fm10k_intfc *interface)
177{
178 if (!(interface->flags & FM10K_FLAG_RESET_REQUESTED))
179 return;
180
181 interface->flags &= ~FM10K_FLAG_RESET_REQUESTED;
182
183 netdev_err(interface->netdev, "Reset interface\n");
184 interface->tx_timeout_count++;
185
186 fm10k_reinit(interface);
187}
188
189/**
190 * fm10k_configure_swpri_map - Configure Receive SWPRI to PC mapping
191 * @interface: board private structure
192 *
193 * Configure the SWPRI to PC mapping for the port.
194 **/
195static void fm10k_configure_swpri_map(struct fm10k_intfc *interface)
196{
197 struct net_device *netdev = interface->netdev;
198 struct fm10k_hw *hw = &interface->hw;
199 int i;
200
201 /* clear flag indicating update is needed */
202 interface->flags &= ~FM10K_FLAG_SWPRI_CONFIG;
203
204 /* these registers are only available on the PF */
205 if (hw->mac.type != fm10k_mac_pf)
206 return;
207
208 /* configure SWPRI to PC map */
209 for (i = 0; i < FM10K_SWPRI_MAX; i++)
210 fm10k_write_reg(hw, FM10K_SWPRI_MAP(i),
211 netdev_get_prio_tc_map(netdev, i));
212}
213
214/**
215 * fm10k_watchdog_update_host_state - Update the link status based on host.
216 * @interface: board private structure
217 **/
218static void fm10k_watchdog_update_host_state(struct fm10k_intfc *interface)
219{
220 struct fm10k_hw *hw = &interface->hw;
221 s32 err;
222
223 if (test_bit(__FM10K_LINK_DOWN, &interface->state)) {
224 interface->host_ready = false;
225 if (time_is_after_jiffies(interface->link_down_event))
226 return;
227 clear_bit(__FM10K_LINK_DOWN, &interface->state);
228 }
229
230 if (interface->flags & FM10K_FLAG_SWPRI_CONFIG) {
231 if (rtnl_trylock()) {
232 fm10k_configure_swpri_map(interface);
233 rtnl_unlock();
234 }
235 }
236
237 /* lock the mailbox for transmit and receive */
238 fm10k_mbx_lock(interface);
239
240 err = hw->mac.ops.get_host_state(hw, &interface->host_ready);
241 if (err && time_is_before_jiffies(interface->last_reset))
242 interface->flags |= FM10K_FLAG_RESET_REQUESTED;
243
244 /* free the lock */
245 fm10k_mbx_unlock(interface);
246}
247
248/**
249 * fm10k_mbx_subtask - Process upstream and downstream mailboxes
250 * @interface: board private structure
251 *
252 * This function will process both the upstream and downstream mailboxes.
253 * It is necessary for us to hold the rtnl_lock while doing this as the
254 * mailbox accesses are protected by this lock.
255 **/
256static void fm10k_mbx_subtask(struct fm10k_intfc *interface)
257{
258 /* process upstream mailbox and update device state */
259 fm10k_watchdog_update_host_state(interface);
260}
261
262/**
263 * fm10k_watchdog_host_is_ready - Update netdev status based on host ready
264 * @interface: board private structure
265 **/
266static void fm10k_watchdog_host_is_ready(struct fm10k_intfc *interface)
267{
268 struct net_device *netdev = interface->netdev;
269
270 /* only continue if link state is currently down */
271 if (netif_carrier_ok(netdev))
272 return;
273
274 netif_info(interface, drv, netdev, "NIC Link is up\n");
275
276 netif_carrier_on(netdev);
277 netif_tx_wake_all_queues(netdev);
278}
279
280/**
281 * fm10k_watchdog_host_not_ready - Update netdev status based on host not ready
282 * @interface: board private structure
283 **/
284static void fm10k_watchdog_host_not_ready(struct fm10k_intfc *interface)
285{
286 struct net_device *netdev = interface->netdev;
287
288 /* only continue if link state is currently up */
289 if (!netif_carrier_ok(netdev))
290 return;
291
292 netif_info(interface, drv, netdev, "NIC Link is down\n");
293
294 netif_carrier_off(netdev);
295 netif_tx_stop_all_queues(netdev);
296}
297
298/**
299 * fm10k_update_stats - Update the board statistics counters.
300 * @interface: board private structure
301 **/
302void fm10k_update_stats(struct fm10k_intfc *interface)
303{
304 struct net_device_stats *net_stats = &interface->netdev->stats;
305 struct fm10k_hw *hw = &interface->hw;
306 u64 rx_errors = 0, rx_csum_errors = 0, tx_csum_errors = 0;
307 u64 restart_queue = 0, tx_busy = 0, alloc_failed = 0;
308 u64 rx_bytes_nic = 0, rx_pkts_nic = 0, rx_drops_nic = 0;
309 u64 tx_bytes_nic = 0, tx_pkts_nic = 0;
310 u64 bytes, pkts;
311 int i;
312
313 /* do not allow stats update via service task for next second */
314 interface->next_stats_update = jiffies + HZ;
315
316 /* gather some stats to the interface struct that are per queue */
317 for (bytes = 0, pkts = 0, i = 0; i < interface->num_tx_queues; i++) {
318 struct fm10k_ring *tx_ring = interface->tx_ring[i];
319
320 restart_queue += tx_ring->tx_stats.restart_queue;
321 tx_busy += tx_ring->tx_stats.tx_busy;
322 tx_csum_errors += tx_ring->tx_stats.csum_err;
323 bytes += tx_ring->stats.bytes;
324 pkts += tx_ring->stats.packets;
325 }
326
327 interface->restart_queue = restart_queue;
328 interface->tx_busy = tx_busy;
329 net_stats->tx_bytes = bytes;
330 net_stats->tx_packets = pkts;
331 interface->tx_csum_errors = tx_csum_errors;
332 /* gather some stats to the interface struct that are per queue */
333 for (bytes = 0, pkts = 0, i = 0; i < interface->num_rx_queues; i++) {
334 struct fm10k_ring *rx_ring = interface->rx_ring[i];
335
336 bytes += rx_ring->stats.bytes;
337 pkts += rx_ring->stats.packets;
338 alloc_failed += rx_ring->rx_stats.alloc_failed;
339 rx_csum_errors += rx_ring->rx_stats.csum_err;
340 rx_errors += rx_ring->rx_stats.errors;
341 }
342
343 net_stats->rx_bytes = bytes;
344 net_stats->rx_packets = pkts;
345 interface->alloc_failed = alloc_failed;
346 interface->rx_csum_errors = rx_csum_errors;
347 interface->rx_errors = rx_errors;
348
349 hw->mac.ops.update_hw_stats(hw, &interface->stats);
350
351 for (i = 0; i < FM10K_MAX_QUEUES_PF; i++) {
352 struct fm10k_hw_stats_q *q = &interface->stats.q[i];
353
354 tx_bytes_nic += q->tx_bytes.count;
355 tx_pkts_nic += q->tx_packets.count;
356 rx_bytes_nic += q->rx_bytes.count;
357 rx_pkts_nic += q->rx_packets.count;
358 rx_drops_nic += q->rx_drops.count;
359 }
360
361 interface->tx_bytes_nic = tx_bytes_nic;
362 interface->tx_packets_nic = tx_pkts_nic;
363 interface->rx_bytes_nic = rx_bytes_nic;
364 interface->rx_packets_nic = rx_pkts_nic;
365 interface->rx_drops_nic = rx_drops_nic;
366
367 /* Fill out the OS statistics structure */
368 net_stats->rx_errors = interface->stats.xec.count;
369 net_stats->rx_dropped = interface->stats.nodesc_drop.count;
370}
371
372/**
373 * fm10k_watchdog_flush_tx - flush queues on host not ready
374 * @interface - pointer to the device interface structure
375 **/
376static void fm10k_watchdog_flush_tx(struct fm10k_intfc *interface)
377{
378 int some_tx_pending = 0;
379 int i;
380
381 /* nothing to do if carrier is up */
382 if (netif_carrier_ok(interface->netdev))
383 return;
384
385 for (i = 0; i < interface->num_tx_queues; i++) {
386 struct fm10k_ring *tx_ring = interface->tx_ring[i];
387
388 if (tx_ring->next_to_use != tx_ring->next_to_clean) {
389 some_tx_pending = 1;
390 break;
391 }
392 }
393
394 /* We've lost link, so the controller stops DMA, but we've got
395 * queued Tx work that's never going to get done, so reset
396 * controller to flush Tx.
397 */
398 if (some_tx_pending)
399 interface->flags |= FM10K_FLAG_RESET_REQUESTED;
400}
401
402/**
403 * fm10k_watchdog_subtask - check and bring link up
404 * @interface - pointer to the device interface structure
405 **/
406static void fm10k_watchdog_subtask(struct fm10k_intfc *interface)
407{
408 /* if interface is down do nothing */
409 if (test_bit(__FM10K_DOWN, &interface->state) ||
410 test_bit(__FM10K_RESETTING, &interface->state))
411 return;
412
413 if (interface->host_ready)
414 fm10k_watchdog_host_is_ready(interface);
415 else
416 fm10k_watchdog_host_not_ready(interface);
417
418 /* update stats only once every second */
419 if (time_is_before_jiffies(interface->next_stats_update))
420 fm10k_update_stats(interface);
421
422 /* flush any uncompleted work */
423 fm10k_watchdog_flush_tx(interface);
424}
425
426/**
427 * fm10k_check_hang_subtask - check for hung queues and dropped interrupts
428 * @interface - pointer to the device interface structure
429 *
430 * This function serves two purposes. First it strobes the interrupt lines
431 * in order to make certain interrupts are occurring. Secondly it sets the
432 * bits needed to check for TX hangs. As a result we should immediately
433 * determine if a hang has occurred.
434 */
435static void fm10k_check_hang_subtask(struct fm10k_intfc *interface)
436{
437 int i;
438
439 /* If we're down or resetting, just bail */
440 if (test_bit(__FM10K_DOWN, &interface->state) ||
441 test_bit(__FM10K_RESETTING, &interface->state))
442 return;
443
444 /* rate limit tx hang checks to only once every 2 seconds */
445 if (time_is_after_eq_jiffies(interface->next_tx_hang_check))
446 return;
447 interface->next_tx_hang_check = jiffies + (2 * HZ);
448
449 if (netif_carrier_ok(interface->netdev)) {
450 /* Force detection of hung controller */
451 for (i = 0; i < interface->num_tx_queues; i++)
452 set_check_for_tx_hang(interface->tx_ring[i]);
453
454 /* Rearm all in-use q_vectors for immediate firing */
455 for (i = 0; i < interface->num_q_vectors; i++) {
456 struct fm10k_q_vector *qv = interface->q_vector[i];
457
458 if (!qv->tx.count && !qv->rx.count)
459 continue;
460 writel(FM10K_ITR_ENABLE | FM10K_ITR_PENDING2, qv->itr);
461 }
462 }
463}
464
465/**
466 * fm10k_service_task - manages and runs subtasks
467 * @work: pointer to work_struct containing our data
468 **/
469static void fm10k_service_task(struct work_struct *work)
470{
471 struct fm10k_intfc *interface;
472
473 interface = container_of(work, struct fm10k_intfc, service_task);
474
475 /* tasks always capable of running, but must be rtnl protected */
476 fm10k_mbx_subtask(interface);
477 fm10k_detach_subtask(interface);
478 fm10k_reset_subtask(interface);
479
480 /* tasks only run when interface is up */
481 fm10k_watchdog_subtask(interface);
482 fm10k_check_hang_subtask(interface);
483
484 /* release lock on service events to allow scheduling next event */
485 fm10k_service_event_complete(interface);
486}
487
90static void fm10k_napi_enable_all(struct fm10k_intfc *interface) 488static void fm10k_napi_enable_all(struct fm10k_intfc *interface)
91{ 489{
92 struct fm10k_q_vector *q_vector; 490 struct fm10k_q_vector *q_vector;
@@ -257,6 +655,20 @@ static irqreturn_t fm10k_msix_mbx_pf(int irq, void *data)
257 fm10k_mbx_unlock(interface); 655 fm10k_mbx_unlock(interface);
258 } 656 }
259 657
658 /* if switch toggled state we should reset GLORTs */
659 if (eicr & FM10K_EICR_SWITCHNOTREADY) {
660 /* force link down for at least 4 seconds */
661 interface->link_down_event = jiffies + (4 * HZ);
662 set_bit(__FM10K_LINK_DOWN, &interface->state);
663
664 /* reset dglort_map back to no config */
665 hw->mac.dglort_map = FM10K_DGLORTMAP_NONE;
666 }
667
668 /* we should validate host state after interrupt event */
669 hw->mac.get_host_state = 1;
670 fm10k_service_event_schedule(interface);
671
260 /* re-enable mailbox interrupt and indicate 20us delay */ 672 /* re-enable mailbox interrupt and indicate 20us delay */
261 fm10k_write_reg(hw, FM10K_ITR(FM10K_MBX_VECTOR), 673 fm10k_write_reg(hw, FM10K_ITR(FM10K_MBX_VECTOR),
262 FM10K_ITR_ENABLE | FM10K_MBX_INT_DELAY); 674 FM10K_ITR_ENABLE | FM10K_MBX_INT_DELAY);
@@ -572,6 +984,9 @@ void fm10k_up(struct fm10k_intfc *interface)
572 984
573 /* enable transmits */ 985 /* enable transmits */
574 netif_tx_start_all_queues(interface->netdev); 986 netif_tx_start_all_queues(interface->netdev);
987
988 /* kick off the service timer */
989 mod_timer(&interface->service_timer, jiffies);
575} 990}
576 991
577static void fm10k_napi_disable_all(struct fm10k_intfc *interface) 992static void fm10k_napi_disable_all(struct fm10k_intfc *interface)
@@ -609,6 +1024,11 @@ void fm10k_down(struct fm10k_intfc *interface)
609 /* disable polling routines */ 1024 /* disable polling routines */
610 fm10k_napi_disable_all(interface); 1025 fm10k_napi_disable_all(interface);
611 1026
1027 del_timer_sync(&interface->service_timer);
1028
1029 /* capture stats one last time before stopping interface */
1030 fm10k_update_stats(interface);
1031
612 /* Disable DMA engine for Tx/Rx */ 1032 /* Disable DMA engine for Tx/Rx */
613 hw->mac.ops.stop_hw(hw); 1033 hw->mac.ops.stop_hw(hw);
614} 1034}
@@ -670,6 +1090,9 @@ static int fm10k_sw_init(struct fm10k_intfc *interface,
670 netdev->vlan_features |= NETIF_F_HIGHDMA; 1090 netdev->vlan_features |= NETIF_F_HIGHDMA;
671 } 1091 }
672 1092
1093 /* delay any future reset requests */
1094 interface->last_reset = jiffies + (10 * HZ);
1095
673 /* reset and initialize the hardware so it is in a known state */ 1096 /* reset and initialize the hardware so it is in a known state */
674 err = hw->mac.ops.reset_hw(hw) ? : hw->mac.ops.init_hw(hw); 1097 err = hw->mac.ops.reset_hw(hw) ? : hw->mac.ops.init_hw(hw);
675 if (err) { 1098 if (err) {
@@ -707,6 +1130,12 @@ static int fm10k_sw_init(struct fm10k_intfc *interface,
707 netdev->hw_features &= ~NETIF_F_GSO_UDP_TUNNEL; 1130 netdev->hw_features &= ~NETIF_F_GSO_UDP_TUNNEL;
708 } 1131 }
709 1132
1133 /* Initialize service timer and service task */
1134 set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
1135 setup_timer(&interface->service_timer, &fm10k_service_timer,
1136 (unsigned long)interface);
1137 INIT_WORK(&interface->service_task, fm10k_service_task);
1138
710 /* set default ring sizes */ 1139 /* set default ring sizes */
711 interface->tx_ring_count = FM10K_DEFAULT_TXD; 1140 interface->tx_ring_count = FM10K_DEFAULT_TXD;
712 interface->rx_ring_count = FM10K_DEFAULT_RXD; 1141 interface->rx_ring_count = FM10K_DEFAULT_RXD;
@@ -871,6 +1300,9 @@ static int fm10k_probe(struct pci_dev *pdev,
871 /* print warning for non-optimal configurations */ 1300 /* print warning for non-optimal configurations */
872 fm10k_slot_warn(interface); 1301 fm10k_slot_warn(interface);
873 1302
1303 /* clear the service task disable bit to allow service task to start */
1304 clear_bit(__FM10K_SERVICE_DISABLE, &interface->state);
1305
874 return 0; 1306 return 0;
875 1307
876err_register: 1308err_register:
@@ -904,6 +1336,9 @@ static void fm10k_remove(struct pci_dev *pdev)
904 struct fm10k_intfc *interface = pci_get_drvdata(pdev); 1336 struct fm10k_intfc *interface = pci_get_drvdata(pdev);
905 struct net_device *netdev = interface->netdev; 1337 struct net_device *netdev = interface->netdev;
906 1338
1339 set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
1340 cancel_work_sync(&interface->service_task);
1341
907 /* free netdev, this may bounce the interrupts due to setup_tc */ 1342 /* free netdev, this may bounce the interrupts due to setup_tc */
908 if (netdev->reg_state == NETREG_REGISTERED) 1343 if (netdev->reg_state == NETREG_REGISTERED)
909 unregister_netdev(netdev); 1344 unregister_netdev(netdev);