Skip to content

Commit 40a13e2

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbevf: Use a 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 780484d commit 40a13e2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static const char ixgbevf_driver_string[] =
5959
#define DRV_VERSION "2.12.1-k"
6060
const char ixgbevf_driver_version[] = DRV_VERSION;
6161
static char ixgbevf_copyright[] =
62-
"Copyright (c) 2009 - 2012 Intel Corporation.";
62+
"Copyright (c) 2009 - 2015 Intel Corporation.";
6363

6464
static const struct ixgbevf_info *ixgbevf_info_tbl[] = {
6565
[board_82599_vf] = &ixgbevf_82599_vf_info,
@@ -96,12 +96,14 @@ static int debug = -1;
9696
module_param(debug, int, 0);
9797
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
9898

99+
static struct workqueue_struct *ixgbevf_wq;
100+
99101
static void ixgbevf_service_event_schedule(struct ixgbevf_adapter *adapter)
100102
{
101103
if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
102104
!test_bit(__IXGBEVF_REMOVING, &adapter->state) &&
103105
!test_and_set_bit(__IXGBEVF_SERVICE_SCHED, &adapter->state))
104-
schedule_work(&adapter->service_task);
106+
queue_work(ixgbevf_wq, &adapter->service_task);
105107
}
106108

107109
static void ixgbevf_service_event_complete(struct ixgbevf_adapter *adapter)
@@ -4250,6 +4252,11 @@ static int __init ixgbevf_init_module(void)
42504252
ixgbevf_driver_version);
42514253

42524254
pr_info("%s\n", ixgbevf_copyright);
4255+
ixgbevf_wq = create_singlethread_workqueue(ixgbevf_driver_name);
4256+
if (!ixgbevf_wq) {
4257+
pr_err("%s: Failed to create workqueue\n", ixgbevf_driver_name);
4258+
return -ENOMEM;
4259+
}
42534260

42544261
ret = pci_register_driver(&ixgbevf_driver);
42554262
return ret;
@@ -4266,6 +4273,10 @@ module_init(ixgbevf_init_module);
42664273
static void __exit ixgbevf_exit_module(void)
42674274
{
42684275
pci_unregister_driver(&ixgbevf_driver);
4276+
if (ixgbevf_wq) {
4277+
destroy_workqueue(ixgbevf_wq);
4278+
ixgbevf_wq = NULL;
4279+
}
42694280
}
42704281

42714282
#ifdef DEBUG

0 commit comments

Comments
 (0)