MFC after: 1 week
Sponsored by: NVIDIA Networking
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
What is the purpose of the restart loop?
Did you observed fdiv overflow on real hardware?
The purpose of the loop is to make the timeout large enough that the timer will generate an interrupt from what I see. The problem is that fdiv may be initialized to zero.
You mean, the t->next value?
Perhaps add a comment (assuming the code reading is right).
The problem is that fdiv may be initialized to zero.
Then shouldn't the workaround applied to the initial computation of fdiv above the loop? Otherwise you just replace one infinite loop condition by another, AFAIS.
et_start() should guarantee that this code receive first and/or period big enough for meaningful fdiv. Do you expect this code to loop enough times for overflow the fdiv turning it zero?
If periodic == 0 and first == 0, which I see can happen, then fdiv is set to t->div which is zero. Do you see?
I wonder if then the loop can happen?
It should not happen thanks to et_start(), unless eventtimer report zero et_min_period.