From patchwork Mon Feb 3 11:05:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 3569321 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 63CB29F382 for ; Mon, 3 Feb 2014 13:06:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 981A5201B6 for ; Mon, 3 Feb 2014 13:06:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3C5520176 for ; Mon, 3 Feb 2014 13:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751785AbaBCNG5 (ORCPT ); Mon, 3 Feb 2014 08:06:57 -0500 Received: from mail-we0-f177.google.com ([74.125.82.177]:33104 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbaBCNG4 (ORCPT ); Mon, 3 Feb 2014 08:06:56 -0500 Received: by mail-we0-f177.google.com with SMTP id t61so2118601wes.22 for ; Mon, 03 Feb 2014 05:06:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=OUwsLmZakEryr9SPvccxwGjkVBd65JDLiAU65bAnN54=; b=jjSV7UmzuxN+TfZVH0lUk4EPicy/N4xRqXb4XL5tx9ohNkT3MVw7ubxtd9sdoa33br vd6Mh7enn8Wmun7IRZa9DANh9D9x50f9b+mYf+g4gPrGcPO3rtHAfezfC98/qdto3gGB OfIrAFDkfxUk+x5CDtW0kQViqHjnHMDONwr1qXgIYjM0Gkk70V/BSXwTWNzeWWUHUN0R BjjH/WVGqga107DXgYZq78J1vhvv6MTiWLKcNc1JSYHp4g/e62qZQuT3e6AKtXPz1+xD UDpPv2eMP3AoEUdQmoypNfMNgato+2rNdwhfqtksA4jFLGspYTMRXj3zsiVd2kRK5+Bf J0oA== X-Gm-Message-State: ALoCoQnqymnkUMCUbcARp7UhAWnYeO7+wIURyK7npEaWz/dGXxxSJ82m6wSw3pvMsfpEjWtnMHRX X-Received: by 10.194.62.243 with SMTP id b19mr1160512wjs.63.1391432815506; Mon, 03 Feb 2014 05:06:55 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id q5sm25700485wia.2.2014.02.03.05.06.54 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 03 Feb 2014 05:06:55 -0800 (PST) From: Alex Netes To: hal@mellanox.com, linux-rdma@vger.kernel.org Cc: Alex Netes Subject: [PATCH 5/5] opensm: Resend LFTs/VLArb/SL2VL MADs in case of error Date: Mon, 3 Feb 2014 13:05:16 +0200 Message-Id: <1391425516-14462-5-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1391425516-14462-1-git-send-email-alexne@mellanox.com> References: <1391425516-14462-1-git-send-email-alexne@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 There are several MADs that we only SET during the sweep (and never GET). Zero the stored block, so in case the MAD will end up with error, we will resend it during the next sweep. Signed-off-by: Alex Netes --- opensm/osm_qos.c | 13 +++++++++++++ opensm/osm_ucast_mgr.c | 7 +++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c index a301803..473e3c8 100644 --- a/opensm/osm_qos.c +++ b/opensm/osm_qos.c @@ -183,6 +183,13 @@ static ib_api_status_t vlarb_update_table_block(osm_sm_t * sm, if (!p_mad) return IB_INSUFFICIENT_MEMORY; + /* + * Zero the stored VL Arbitration block, so in case the MAD will + * end up with error, we will resend it in the next sweep. + */ + memset(&p->vl_arb[block_num], 0, + block_length * sizeof(block.vl_entry[0])); + cl_qlist_insert_tail(mad_list, &p_mad->list_item); return IB_SUCCESS; @@ -272,6 +279,12 @@ static ib_api_status_t sl2vl_update_table(osm_sm_t * sm, osm_physp_t * p, if (!p_mad) return IB_INSUFFICIENT_MEMORY; + /* + * Zero the stored SL2VL block, so in case the MAD will + * end up with error, we will resend it in the next sweep. + */ + memset(p_tbl, 0, sizeof(tbl)); + cl_qlist_insert_tail(mad_list, &p_mad->list_item); return IB_SUCCESS; } diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c index 8194307..c8a7360 100644 --- a/opensm/osm_ucast_mgr.c +++ b/opensm/osm_ucast_mgr.c @@ -1002,6 +1002,13 @@ static int set_lft_block(IN osm_switch_t *p_sw, IN osm_ucast_mgr_t *p_mgr, IB_SMP_DATA_SIZE)) return 0; + /* + * Zero the stored LFT block, so in case the MAD will end up + * with error, we will resend it in the next sweep. + */ + memset(p_sw->lft + block_id_ho * IB_SMP_DATA_SIZE, OSM_NO_PATH, + IB_SMP_DATA_SIZE); + OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "Writing FT block %u to switch 0x%" PRIx64 "\n", block_id_ho, cl_ntoh64(context.lft_context.node_guid));