HPET timer accuracy for interrupts
Hi,
I am developing an application in RHEL 7.1/7.2 to generate interrupts at the user specified duration (Eg: 100 micro seconds) on intel board.
For this, i am using HPET timers in Intel board using the sample code(attached).
Using sample program attached we have run as ./exe 2500 1
Means for every 400 usec 1 packet shall be generated for the duration of 1 second. (2500*400usec=1 second)
Netwrok speed 1000 Mbps
Testing Methodology Steps: For 100 microseconds interrupts to be generated.
While(1)
{
UDP packet to be send to external system (RHEL OS).
Using Hpet timer generate interrupt.
}
We are timestamping the time in external system of first received udp packet and subsequent packet.
The difference between the packets is drifting gradually downwards and upwards..
For example:
1st udp packet received in external system at time 10000 usec
hpet interrupt takes 100 usec
2nd udp packet recevived in external system at time 10140 usec.
Difference is = 10140-10000 = 140usec
We have logged the values in log file by storing in buffers after completion of transmission.
We have tested for 17,83,020 packets
Results : >160 usec (2284 packets)
80 usec (10758 packets)
The delay is randomly increasing or decresing..
Can anyone help me to restrict the delay to a certain range. For 100 usec acceptable Delay range is 100+/-20 usec.
Clarification:
Is HPET timer will generate interrupts with constant delay or random delay at user space???
We have observed it is generating interrupts at random delay.
Is there anyway to acheive the delay of 100+/-20 micro seconds. Please help me to acheive above accuracy.
Thanks
Krishna Reddy
9620620953
mailtoyvkr@gmail.com
Responses