From patchwork Tue Oct 13 13:25:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Domke X-Patchwork-Id: 7385511 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 132CCBEEA4 for ; Tue, 13 Oct 2015 13:39:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 419EE20805 for ; Tue, 13 Oct 2015 13:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E21D920800 for ; Tue, 13 Oct 2015 13:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932114AbbJMNjj (ORCPT ); Tue, 13 Oct 2015 09:39:39 -0400 Received: from mailout1.zih.tu-dresden.de ([141.30.67.72]:34420 "EHLO mailout1.zih.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932293AbbJMNjg (ORCPT ); Tue, 13 Oct 2015 09:39:36 -0400 X-Greylist: delayed 957 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Oct 2015 09:39:36 EDT Received: from mail.zih.tu-dresden.de ([141.76.14.4]) by mailout1.zih.tu-dresden.de with esmtp (Exim 4.63) (envelope-from ) id 1ZlzYH-00032l-N2; Tue, 13 Oct 2015 15:23:37 +0200 Received: from [141.76.90.124] (helo=legion.inf.tu-dresden.de) by server-40.mailclusterdns.zih.tu-dresden.de with esmtpsa (TLSv1.2:AES128-SHA:128) (envelope-from ) id 1ZlzYH-0003w5-C3; Tue, 13 Oct 2015 15:23:37 +0200 From: Jens Domke To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock Subject: [PATCH] OpenSM: LFT update breaks if IB_SMP_DATA_SIZE changes Date: Tue, 13 Oct 2015 15:25:50 +0200 Message-Id: <1444742750-23875-1-git-send-email-jens.domke@tu-dresden.de> X-Mailer: git-send-email 1.9.1 X-TUD-Virus-Scanned: mailout1.zih.tu-dresden.de 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, T_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 This is only a precautionary patch for a theoretical bug which would arise if someone redefines IB_SMP_DATA_SIZE to a values !=64. ucast_mgr_pipeline_fwd_tbl() calculates the max. number of blocks to update using 64 explicitly, while set_lft_block() uses IB_SMP_DATA_SIZE. If IB_SMP_DATA_SIZE != 64 then switches would receive too few or too many blocks. Signed-off-by: Jens Domke --- opensm/osm_ucast_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c index 7ccaa77..893a70b 100644 --- a/opensm/osm_ucast_mgr.c +++ b/opensm/osm_ucast_mgr.c @@ -1036,7 +1036,7 @@ static void ucast_mgr_pipeline_fwd_tbl(osm_ucast_mgr_t * p_mgr) { cl_qmap_t *tbl; cl_map_item_t *item; - unsigned i, max_block = p_mgr->max_lid / 64 + 1; + unsigned i, max_block = p_mgr->max_lid / IB_SMP_DATA_SIZE + 1; tbl = &p_mgr->p_subn->sw_guid_tbl; for (i = 0; i < max_block; i++)