All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Line Holen <line.holen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Hal <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Linux-Rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] osm_sm_state_mgr.c Fix handling of polling retry number
Date: Wed, 27 Nov 2013 07:16:47 -0500	[thread overview]
Message-ID: <5295E2AF.2050909@dev.mellanox.co.il> (raw)
In-Reply-To: <3b0cb098-1e00-417d-8a5b-0aa766926867@default>

On 11/15/2013 7:15 AM, Line Holen wrote:
> The retry counter is now only updated if a packet is actually sent.
> (But as before the initial request is also counted.)
> 
> Prior to this change the actual maximum number of packets sent were
> polling retry number minus one.
> 
> Signed-off-by: Line Holen <line.holen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> ---
> 
> diff --git a/opensm/osm_sm_state_mgr.c b/opensm/osm_sm_state_mgr.c
> index 596ad8f..6eff9ee 100644
> --- a/opensm/osm_sm_state_mgr.c
> +++ b/opensm/osm_sm_state_mgr.c
> @@ -197,16 +197,14 @@ void osm_sm_state_mgr_polling_callback(IN void *context)
>  	}
>  
>  	/*
> -	 * Incr the retry number.
> -	 * If it reached the max_retry_number in the subnet opt - call
> +	 * If retry number reached the max_retry_number in the subnet opt - call
>  	 * osm_sm_state_mgr_process with signal OSM_SM_SIGNAL_POLLING_TIMEOUT
>  	 */
> -	sm->retry_number++;
>  	OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, "SM State %d (%s), Retry number:%d\n",
>  		sm->p_subn->sm_state,  osm_get_sm_mgr_state_str(sm->p_subn->sm_state),
>  		sm->retry_number);
>  
> -	if (sm->retry_number >= sm->p_subn->opt.polling_retry_number) {
> +	if (sm->retry_number > sm->p_subn->opt.polling_retry_number) {
>  		OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
>  			"Reached polling_retry_number value in retry_number. "
>  			"Go to DISCOVERY state\n");
> @@ -214,6 +212,9 @@ void osm_sm_state_mgr_polling_callback(IN void *context)
>  		goto Exit;
>  	}
>  
> +	/* Increment the retry number */
> +	sm->retry_number++;

Would it be better to increment retry number if
sm_state_mgr_send_master_sm_info_req call just below this succeeds ?

-- Hal

> +
>  	/* Send a SubnGet(SMInfo) request to the remote sm (depends on our state) */
>  	sm_state_mgr_send_master_sm_info_req(sm);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-11-27 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 12:15 [PATCH] osm_sm_state_mgr.c Fix handling of polling retry number Line Holen
2013-11-27 12:16 ` Hal Rosenstock [this message]
     [not found]   ` <5295E2AF.2050909-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2013-11-27 14:42     ` Line Holen
     [not found]       ` <529604BB.4010001-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-12-03 13:17         ` [PATCH] osm_sm_state_mgr.c: " Hal Rosenstock
     [not found]           ` <529DD9F5.2050902-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2013-12-03 14:18             ` Line Holen
     [not found]               ` <529DE851.3010802-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-12-03 14:30                 ` Hal Rosenstock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5295E2AF.2050909@dev.mellanox.co.il \
    --to=hal-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=line.holen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.