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
F105867640: D46062.id141231.diff
Sat, Dec 21, 8:00 PM
Unknown Object (File)
Wed, Dec 11, 4:38 PM
Unknown Object (File)
Mon, Nov 25, 7:27 PM
Unknown Object (File)
Nov 20 2024, 9:06 AM
Unknown Object (File)
Oct 30 2024, 5:29 PM
Unknown Object (File)
Oct 16 2024, 12:26 AM
Unknown Object (File)
Sep 13 2024, 2:32 AM
Unknown Object (File)
Sep 11 2024, 3:56 PM

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 60062
Build 56946: 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
6339

Can this line be removed entirely?

6401

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
6401

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.Mon, Nov 25, 5:49 PM
This revision is now accepted and ready to land.Mon, Nov 25, 7:08 PM
sys/net/iflib.c
5292

Prefix name with if_

6401

Does this need cleanup of the taskqueue?

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

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?

6401

Do you mean something more elaborate than taskqueue_free in iflib_device_deregister?