Page MenuHomeFreeBSD

iflib(4): Replace admin taskqueue group with per-interface taskqueues
Needs ReviewPublic

Authored by krzysztof.galazka_intel.com on Jul 22 2024, 4:26 PM.
Tags
None
Referenced Files
F107745145: D46062.diff
Fri, Jan 17, 10:31 PM
Unknown Object (File)
Thu, Jan 16, 3:28 PM
Unknown Object (File)
Thu, Jan 16, 3:17 PM
Unknown Object (File)
Thu, Jan 16, 3:17 PM
Unknown Object (File)
Thu, Jan 16, 3:17 PM
Unknown Object (File)
Thu, Jan 16, 3:14 PM
Unknown Object (File)
Tue, Jan 14, 8:08 AM
Unknown Object (File)
Tue, Jan 14, 2:33 AM

Details

Summary

Using one taskqueue group with single thread to execute all admin
tasks may lead to unexpected timeouts when long running task (e.g.
handling a reset after FW update) for one interface prevents
tasks from other interfaces being executed. Taskqueue group API
doesn't let to dynamically add threads, and pre-allocating thread
for each CPU as it's done for traffic queues would be a waste
of resources on systems with small number of interfaces. Replace
global taskqueue group for admin tasks with taskqueue allocated
for each interface to allow independent execution.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 60987
Build 57871: arc lint + arc unit

Event Timeline

Rebased on top of master.
Free taskqueue after releasing interrupts per jhb comment on Github.

jhb added a subscriber: jhb.

This looks ok to me, though I'm not intimately familiar with all of iflib.

This revision is now accepted and ready to land.Oct 21 2024, 3:52 PM
kbowling added a subscriber: kbowling.

Seems reasonable to me. If there is any work that depends or interacts with these changes it would be nice to see them linked/referenced so we can look at that too but I can't foresee any problems.

sys/net/iflib.c
6342

Can this line be removed entirely?

6404–6405

Can you explain how this works? Looks like we used to have vflr_task but this will not be needed anymore with the per interface task which I suppose could do the same work?

Seems reasonable to me. If there is any work that depends or interacts with these changes it would be nice to see them linked/referenced so we can look at that too but I can't foresee any problems.

There is no dependent work.

sys/net/iflib.c
6404–6405

Uh, I'm sorry, I don't know what I was thinking. I changed iflib_iov_intr_deferred to enqueue a task to admin taskqueue but this task is never initialized. I need to fix that. Thanks for pointing this out.

Add forgotten task init for IFLIB_INTR_IOV soft irq type.

This revision now requires review to proceed.Nov 25 2024, 5:49 PM
This revision is now accepted and ready to land.Nov 25 2024, 7:08 PM
sys/net/iflib.c
5295

Prefix name with if_

6404–6405

Does this need cleanup of the taskqueue?

This revision now requires review to proceed.Dec 6 2024, 7:59 PM
sys/net/iflib.c
6342

gtask is used below:

info->ifi_task = gtask;

but I guess I can add initialization to NULL in the declaration instead. Is that what you mean?

6404–6405

Do you mean something more elaborate than taskqueue_free in iflib_device_deregister?

@kbowling Do you want me to make any additional changes in this patch?