[PATCH dev-4.4] net/ncsi: Enable request timer before sending command

Cédric Le Goater clg at kaod.org
Thu Aug 4 18:13:34 AEST 2016


On 08/04/2016 02:47 AM, Gavin Shan wrote:
> The response is received upon the sent command before the request's
> timer is enabled under extreme situation. The response packet won't
> be processed as the corresponding request (request packet and timer)
> isn't complete. It leads to NCSI failure - no package detected.

you can reproduce under openbmc/qemu using a slirp backend :

	-net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostname=qemu


> This fixes the issue by enabling the timer before sending the command.
> The comments about the timer has been replaced by that in upstream
> kernel.

Thanks !

C. 

> Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
> ---
> The issue exists in all branches. 4.7 has the issue at least. I
> suggest applying it to all other branches or 4.7 only.
> ---
>  net/ncsi/ncsi-cmd.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
> index b8503e1..d634a0e 100644
> --- a/net/ncsi/ncsi-cmd.c
> +++ b/net/ncsi/ncsi-cmd.c
> @@ -359,20 +359,19 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
>  		eh->h_source[i] = 0xff;
>  	}
>  
> +        /* Start the timer for the request that might not have
> +         * corresponding response. Given NCSI is an internal
> +         * connection a 1 second delay should be sufficient.
> +         */
> +	mod_timer(&nr->nr_timer, jiffies + 1 * HZ);
> +	nr->nr_timer_enabled = true;
> +
>  	/* Send NCSI packet */
>  	skb_get(nr->nr_cmd);
>  	ret = dev_queue_xmit(nr->nr_cmd);
>  	if (ret)
>  		goto out;
>  
> -	/* Start the timer for the request that might not have
> -	 * corresponding response. I'm not sure 1 second delay
> -	 * here is enough. Anyway, NCSI is internal network, so
> -	 * the responsiveness should be as fast as enough.
> -	 */
> -	nr->nr_timer_enabled = true;
> -	mod_timer(&nr->nr_timer, jiffies + 1 * HZ);
> -
>  	return 0;
>  out:
>  	ncsi_free_req(nr, false, false);
> 



More information about the openbmc mailing list