From patchwork Fri Nov 15 12:15:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Line Holen X-Patchwork-Id: 3188031 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8AFDD9F39E for ; Fri, 15 Nov 2013 12:16:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD69120884 for ; Fri, 15 Nov 2013 12:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A0DB20820 for ; Fri, 15 Nov 2013 12:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145Ab3KOMP4 (ORCPT ); Fri, 15 Nov 2013 07:15:56 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:43741 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192Ab3KOMP4 convert rfc822-to-8bit (ORCPT ); Fri, 15 Nov 2013 07:15:56 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rAFCFq2a002977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Nov 2013 12:15:53 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAFCFpSj010666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Nov 2013 12:15:52 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAFCFp0X000374; Fri, 15 Nov 2013 12:15:51 GMT MIME-Version: 1.0 Message-ID: <3b0cb098-1e00-417d-8a5b-0aa766926867@default> Date: Fri, 15 Nov 2013 04:15:51 -0800 (PST) From: Line Holen To: Hal Cc: Linux-Rdma Subject: [PATCH] osm_sm_state_mgr.c Fix handling of polling retry number X-Mailer: Zimbra on Oracle Beehive Content-Disposition: inline X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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++; + /* Send a SubnGet(SMInfo) request to the remote sm (depends on our state) */ sm_state_mgr_send_master_sm_info_req(sm);