Jeffrey Tippet has his facts straight nearly all the time he opens his mouth. (That’s most of the reason that I read his posts here – to learn from him.) In this case, though, he’s wrong on one tiny and mostly inconsequential point. The NIC never programs the APIC. The NIC programs its interrupt generation logic (which is usually done through MSI-X but doesn’t have to be) so that the interrupt is sent to the local APIC of the processor associated with the queue in the NIC. This association is managed by TCP/IP and NDIS, and delivered (I think - this is a case where Jeffrey will probably correct me) as part of the RSS hashing mechanism. The data programmed into the NIC will generally target exactly one local APIC, thus specifying the exact target processor.
- Jake Oshins
(former interrupt guy)
Windows Kernel Team
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jeffrey Tippet
Sent: Wednesday, December 4, 2013 1:59 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] NdisGetCurrentProcessorCpuUsage doesn’t change
[Peter] Somebody probably needs to file a bug against the doc page for this function
Done.
[Pavel] So how does Windows or NDIS help to distribute load without RSS?
RSS is the mechanism by which NDIS distributes load. So without RSS, NDIS does not distribute load. (NDIS may still use RST to make the play well with other tasks running on the same CPU, but RST fundamentally doesn’t move traffic across CPUs). Higher levels of the stack may still distribute load across processors, e.g., http.sys has a set of worker threads affinitized to certain CPUs.
[Pavel] Or with RSS, does it consider kind of work going on the CPU?
RSS doesn’t use this API – nothing in the OS actually uses this API
RSS changes with each OS version, and in its current version, actually has several algorithms (“profiles”) to choose from. So I hate to specific exactly how it works, because it depends on several factors. In general, I don’t believe that RSS takes usermode activity into consideration when load-balancing; it’s mostly meant to balance one TCP stream against another TCP stream.
@Maxim: Once RSS is enabled over a NIC that supports MSI-X, the NIC uses hints from RSS to program the APIC and determine which processors to interrupt. Generally NICs don’t implement their own load distribution algorithms; they just follow the instructions of RSS (or VMQ, which is similar).
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer