Subject: Re: [PATCH net-next 1/2] i40e: Add helper for VF inited state check with timeout

From: Jakub Kicinski <[email-masked]>
Date: Wed, 12 Jul 2023 10:31:36 -0700

On Wed, 12 Jul 2023 15:18:29 +0200 Ivan Vecera wrote:
> > This error is not accurate in the edge case, when VF state changed to
> > be INIT during msleep() while i was 14.
> > 
> > Thanks  
> 
> Would you like to add an extra check after the cycle or just increase 
> limit from 15 to 16 (there will be an extra msleep)...

15 or 16 is of lesser importance, the bigger irritant is that the last
sleep is no pointless. I'd move the condition check into the middle of
the loop:

for (i = 0;; i++) {
	if (test())
		return GOOD;

	if (i >= 15)
		return BAD;

	take_a_nap();
}