From patchwork Mon Dec 17 16:55:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1888061 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1A5193FCA5 for ; Mon, 17 Dec 2012 16:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040Ab2LQQzb (ORCPT ); Mon, 17 Dec 2012 11:55:31 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:65305 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563Ab2LQQzb (ORCPT ); Mon, 17 Dec 2012 11:55:31 -0500 Received: by mail-vb0-f46.google.com with SMTP id b13so7313278vby.19 for ; Mon, 17 Dec 2012 08:55:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=6L6TAMDozZJ4SZZMp2APmjY6gWZS+uo1NTyknPcJcVI=; b=ZgWaYY6TujHxx1jJnIz/vE1QJLxkXHKyqH4GxWIxERaFbaSLTw6f3pPUs64RyVj1V3 QXPxjB3KG62Yr+bplpKqs/R3rEtaC2wYhGOnx9n3s0ZTIpWvvO2/QpCFWaeaUN3CV3ff 1R0S/toGCPXqRrF4UARRG8lVobtQzBz7fkveCs8JUj7yZXRdjcv28+IvSNtkUyP1euvp eikflyP8QheDsj74RsH2e1n5x2IMs3P2294wM8lm8xQVQiXTRc6d9XCEczUXqyx4tnMl rTQTd6ej7Jy+oLgEPaTovpFv8Dn7DvMioU7w0F05A6ygSiA131vJKAuqbTkz1DgBk+FV f5Ag== Received: by 10.220.148.205 with SMTP id q13mr24157409vcv.6.1355763330163; Mon, 17 Dec 2012 08:55:30 -0800 (PST) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id j3sm12370222vdv.0.2012.12.17.08.55.28 (version=SSLv3 cipher=OTHER); Mon, 17 Dec 2012 08:55:29 -0800 (PST) Message-ID: <50CF4E7F.6040305@dev.mellanox.co.il> Date: Mon, 17 Dec 2012 11:55:27 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] opensm/osm_sa_slvl_record.c: Fix out port for CAs and routers X-Gm-Message-State: ALoCoQnE3iU0Ns2Ah4JdGN7rTeFT6AEqeRAuS0i31EcY110V4ZRWz0KcvvgA5pJYhIcOvQeh/xRh Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Also, no need to set in port there as already 0 due to memset Signed-off-by: Hal Rosenstock --- -- 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_sa_slvl_record.c b/opensm/osm_sa_slvl_record.c index 8f6d7b8..12c87f7 100644 --- a/opensm/osm_sa_slvl_record.c +++ b/opensm/osm_sa_slvl_record.c @@ -103,8 +103,10 @@ static void sa_slvl_create(IN osm_sa_t * sa, IN const osm_physp_t * p_physp, memset(p_rec_item, 0, sizeof(*p_rec_item)); p_rec_item->rec.lid = lid; - p_rec_item->rec.out_port_num = osm_physp_get_port_num(p_physp); - p_rec_item->rec.in_port_num = in_port_idx; + if (p_physp->p_node->node_info.node_type == IB_NODE_TYPE_SWITCH) { + p_rec_item->rec.out_port_num = osm_physp_get_port_num(p_physp); + p_rec_item->rec.in_port_num = in_port_idx; + } p_rec_item->rec.slvl_tbl = *(osm_physp_get_slvl_tbl(p_physp, in_port_idx));