Skip to content

Commit 780484d

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbe: Use private workqueue to avoid certain possible hangs
Use a private workqueue to avoid hangs that were otherwise possible when performing stress tests, such as creating and destroying many VFS repeatedly. Signed-off-by: Mark Rustad <[email protected]> Tested-by: Darin Miller <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 83a9fb2 commit 780484d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver");
172172
MODULE_LICENSE("GPL");
173173
MODULE_VERSION(DRV_VERSION);
174174

175+
static struct workqueue_struct *ixgbe_wq;
176+
175177
static bool ixgbe_check_cfg_remove(struct ixgbe_hw *hw, struct pci_dev *pdev);
176178

177179
static int ixgbe_read_pci_cfg_word_parent(struct ixgbe_adapter *adapter,
@@ -313,7 +315,7 @@ static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter)
313315
if (!test_bit(__IXGBE_DOWN, &adapter->state) &&
314316
!test_bit(__IXGBE_REMOVING, &adapter->state) &&
315317
!test_and_set_bit(__IXGBE_SERVICE_SCHED, &adapter->state))
316-
schedule_work(&adapter->service_task);
318+
queue_work(ixgbe_wq, &adapter->service_task);
317319
}
318320

319321
static void ixgbe_remove_adapter(struct ixgbe_hw *hw)
@@ -9320,6 +9322,12 @@ static int __init ixgbe_init_module(void)
93209322
pr_info("%s - version %s\n", ixgbe_driver_string, ixgbe_driver_version);
93219323
pr_info("%s\n", ixgbe_copyright);
93229324

9325+
ixgbe_wq = create_singlethread_workqueue(ixgbe_driver_name);
9326+
if (!ixgbe_wq) {
9327+
pr_err("%s: Failed to create workqueue\n", ixgbe_driver_name);
9328+
return -ENOMEM;
9329+
}
9330+
93239331
ixgbe_dbg_init();
93249332

93259333
ret = pci_register_driver(&ixgbe_driver);
@@ -9351,6 +9359,10 @@ static void __exit ixgbe_exit_module(void)
93519359
pci_unregister_driver(&ixgbe_driver);
93529360

93539361
ixgbe_dbg_exit();
9362+
if (ixgbe_wq) {
9363+
destroy_workqueue(ixgbe_wq);
9364+
ixgbe_wq = NULL;
9365+
}
93549366
}
93559367

93569368
#ifdef CONFIG_IXGBE_DCA

0 commit comments

Comments
 (0)