Processor affinity when using the Wdf

I would like to use processor affinity for my device driver.

When not using the framework this can be done using the function IoConnectInterrupt

When using the framework it seems that I should be using the function WdfInterruptSetPolicy but this function doesn’t work on windows 2003 server.

Is there any work around that will allow me to use the framework and still set the processor affinity (on windows server 2003). Can I still use IoConnectInterrupt?

Thanks
Tzachi

In what function are you calling SetPolicy? Implement EvtDevicePrepareHardware and put a breakpoint on it. When it hits, run !wdflogdump on your driver and you will see an entry that looks like this

“Is MSI? %d, MSI-ID %d, AffinityPolicy %!WDF_INTERRUPT_POLICY!, Priority %!WDF_INTERRUPT_PRIORITY!, Affinity 0x%x, Irql 0x%x, Vector 0x%x”,

Which will tell you what the affinity is going to be. We pick this from the translated resource descriptor during start device. You could alter this by implementing EvtDeviceFilterAddResourceRequirements and altering the affinity in the io resource requirements list before start.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@mellanox.co.il
Sent: Monday, November 05, 2007 9:11 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Processor affinity when using the Wdf

I would like to use processor affinity for my device driver.

When not using the framework this can be done using the function IoConnectInterrupt

When using the framework it seems that I should be using the function WdfInterruptSetPolicy but this function doesn’t work on windows 2003 server.

Is there any work around that will allow me to use the framework and still set the processor affinity (on windows server 2003). Can I still use IoConnectInterrupt?

Thanks
Tzachi


NTDEV is sponsored by OSR

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

xxxxx@mellanox.co.il wrote:

I would like to use processor affinity for my device driver.

When not using the framework this can be done using the function IoConnectInterrupt

When using the framework it seems that I should be using the function WdfInterruptSetPolicy but this function doesn’t work on windows 2003 server.

Is there any work around that will allow me to use the framework and still set the processor affinity (on windows server 2003). Can I still use IoConnectInterrupt?

Why do you need processor affinity?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Why do you need processor affinity?

Well, I have made some experiments with a dual socket dual core AMD machine and found out that when my test runs on 2 processors BW is 20% better than when it runs on the other two. So I want to make sure it always runs on the best processor.