So let’s assume you are able to connect an HPET timer to your ISR, then
what. You can’t send a network packet with WSK from the ISR, you will need
to queue a DPC and send from there, and the numbers Peter just gave don’t
suggest there will be a high probability over a longer time period of the
DPC always running within a short limited latency. DPC’s can run for “a
while”, like for example you get a blob of network receive packets, which
will be processed in a DPC, with some constraint on the number of packets
processed. There were features added to limit the amount of processing on
received packets, as it was degrading multimedia playback latency.
So, unless you are prepared to take over the NIC hardware, so you can put
packets on it’s send ring from your ISR, I’m not sure HPET interrupts will
help you accomplish your low jitter UDP packets. For an embedded use, you
could dedicate a specific NIC to your use, and send from an ISR. Some NICs
have their own timers, so you might pick a NIC with a timer, attach to the
NICs interrupt, and send your UDP packet from your code written to control
that NIC. I believe source code for a Realtek NIC is available in open
source repositories.
It seems like the core of your problem is you need to run code in a DPC
(DISPATCH_LEVEL), with limited timing latency, which will not be possible.
Other DPCs will not necessarily live by your latency constraints, and as
DPCs are not preemptable, you have to wait for the completion of any
running DPC, even if you queue your DPC at the head of the DPC queue. I
suppose a potentially useful OS feature would be a way for a driver to
declare it owns DPC/ISR processing for a specific core, such that that
driver will never have to share the DPC queue. Anytime you start getting
into processor affinity control, you start getting complexity from how
power should be managed. Say there was a way to own a core, does that core
always run at maximum frequency, which is clearly bad for power
conservation?
Out of curiosity, can you send network packets from an ISR on Linux?
For a specific system, with specific hardware, you might successfully
adjust the system to not have DPC delays longer than you require, but on
an arbitrary system, the DPC latency will be whatever it is. You might be
better off using a $35 embedded controller, that can dedicate all it’s
resources just to sending out your UDP packet on schedule.
Jan
On 2/4/15, 7:19 PM, “xxxxx@Freyberger.de”
wrote:
>Hi,
>
>thanks for the interesting discussion on this thread.
>
>- what’s my goal: for (LAN) streaming purposes I want to send UDP pakets
>with the lowest possible jitter but without additional hardware. The low
>jitter is needed for hardware devices, which receive such streams but
>which provide only a very small receiving jitter buffer of a few
>milliseconds.
>
>- at the moment I’m sending my pakets in a high priority kernel thread at
>passive level using WSK. But sometimes this thread is blocked by DPCs. So
>for my experience the majority of PCs out there normally behaves quite
>good and doesn’t show DPCs > 1 millisec … for a certain amount of time.
>But only very few PCs show DPCs < 1 millisec for 24/7 usage.
>
>- I’ve already tried the new HighResTimer introduced in W8.1 and
>ExQueryTimerResolution also reported 500 usecs as minimum timer
>resolution on all machines so far. But finally the timer callback
>interval was never below 0.97 msecs and the max values were about 1.8
>msecs.
>
>- So I decided to give HPET a chance. So far, on all the machines where
>I’ve tested my driver, there was not a single timer of all the HPET
>timers activated. I’d be interested in situations when windows actually
>activates one of these timers. The main count probably is used for
>QueryPerformanceCounter if you’ve set the platformclock, but I’m not
>planning to manipulate the main count. And before utilizing one of the
>timers, I can check, whether it’s already active to avoid troubles.
>
>Best regards,
>Johannes
>
>—
>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