[Intel-wired-lan] [PATCH net v3] iavf: Do not modify queue number when removing iavf driver

Jedrzej Jagielski jedrzej.jagielski at intel.com
Wed Jun 8 09:53:37 UTC 2022


From: Grzegorz Szczurek <grzegorzx.szczurek at intel.com>

If VF has configured tc qdisc with number of queues less than original
set and then the driver went in removing process, tc resources are also
releasing. Attempt of modify real num tx/rx in this state is causing
call trace, because kernel is trying to release uninitialized queues

Fix it by not modifying the number of queues when removing a driver

Call Trace:
  net_rx_queue_update_kobjects+0x10c/0x160
  netdev_unregister_kobject+0x4b/0x80
  rollback_registered_many+0x27b/0x550
  rollback_registered+0x56/0x90
  unregister_netdevice_queue+0x73/0xb0
  unregister_netdev+0x18/0x20
  iavf_remove+0x421/0x440 [iavf]
  pci_device_remove+0x3b/0xc0
  device_release_driver_internal+0x18c/0x250
  driver_detach+0x39/0x6d
  bus_remove_driver+0x77/0xc9
  pci_unregister_driver+0x2d/0xb0
  iavf_exit_module+0xc/0xb9a [iavf]
  __x64_sys_delete_module+0x139/0x270
  do_syscall_64+0x5b/0x1b0
  entry_SYSCALL_64_after_hwframe+0x65/0xca
 RIP: 0033:0x7f6e29645a8b
 Code: 73 01 c3 48 8b 0d fd 03 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f
       1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01
       f0 ff ff 73 01 c3 48 8b 0d cd 03 2c 00 f7 d8 64 89 01 48
 RSP: 002b:00007ffccf5b8098 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
 RAX: ffffffffffffffda RBX: 000055b5545f6c40 RCX: 00007f6e29645a8b
 RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055b5545f6ca8
 RBP: 000055b5545f6ca8 R08: 00007ffccf5b7041 R09: 0000000000000000
 R10: 00007f6e296b7f60 R11: 0000000000000206 R12: 0000000000000000
 R13: 0000000000000000 R14: 000055b5545f6ca8 R15: 00007ffccf5b9490

Fixes: d5b33d024496 ("i40evf: add ndo_setup_tc callback to i40evf")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek at intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski at intel.com>
---
v2: split patch series into 2 seperate patches; check the exact bit - do
not use the helper function
v3: correct email addresses
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index f3ecb3bca33d..81a2666acdde 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3471,6 +3471,9 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)
 		}
 	}
 exit:
+	if (test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section))
+		return 0;
+
 	return ret;
 }
 
-- 
2.27.0



More information about the Intel-wired-lan mailing list