From patchwork Tue Dec 29 15:05:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 70106 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBTF2VvZ028752 for ; Tue, 29 Dec 2009 15:02:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752398AbZL2PC2 (ORCPT ); Tue, 29 Dec 2009 10:02:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752397AbZL2PC2 (ORCPT ); Tue, 29 Dec 2009 10:02:28 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:57802 "EHLO mail-fx0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398AbZL2PC1 (ORCPT ); Tue, 29 Dec 2009 10:02:27 -0500 Received: by fxm25 with SMTP id 25so5298408fxm.21 for ; Tue, 29 Dec 2009 07:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=D5CUu4RzTfx2vM0MNA9JB7XzL9tGH5dwPUPUC+1WY7E=; b=pMIQxmEyi9FBqKWEu+0/pPE/MUux11vC0N7SZXwj9CIn2aEf7W5JHBwmEGJ+X4Fkxl aXDiW3M5ZntMfHmrHkO2Y2AeX91wyuOVVOOk1YHGqm2O70136XygCcEPUiC9hPskd6g0 0PRAH0hr18cjyOt4qthxxUcz0YOIJwsclJL3U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=VMdc3FqIUoYuq2mOLtXVJoLJs+3Wu1nfimZhrzBebIfeBQtRyP4Y+FOne+2qe0kTcs E5h6rxVSXVW10Se9I5oh7AIMag96NNGi0M8LcKx7FiD0EwwpcVA/pTPcZapDcxzphgE+ WedTrSYSjDQwFxToxCEMQXy3hq/PQi/NFiYbw= Received: by 10.102.14.3 with SMTP id 3mr6165702mun.43.1262098945905; Tue, 29 Dec 2009 07:02:25 -0800 (PST) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id s11sm17490476mue.19.2009.12.29.07.02.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Dec 2009 07:02:25 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 09EC411DF8; Tue, 29 Dec 2009 17:05:28 +0200 (IST) Date: Tue, 29 Dec 2009 17:05:28 +0200 From: Sasha Khapyorsky To: Hal Rosenstock Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_slvl_map_rcv.c: fix port parsing on BE machine Message-ID: <20091229150528.GV26940@me> References: <20091201194110.GA26753@comcast.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091201194110.GA26753@comcast.net> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_slvl_map_rcv.c b/opensm/opensm/osm_slvl_map_rcv.c index 4f75690..3b24a8e 100644 --- a/opensm/opensm/osm_slvl_map_rcv.c +++ b/opensm/opensm/osm_slvl_map_rcv.c @@ -105,10 +105,8 @@ void osm_slvl_rcv_process(IN void *context, IN void *p_data) /* in case of a non switch node the attr modifier should be ignored */ if (osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH) { - out_port_num = - (uint8_t) cl_ntoh32(p_smp->attr_mod & 0xFF000000); - in_port_num = - (uint8_t) cl_ntoh32((p_smp->attr_mod & 0x00FF0000) << 8); + out_port_num = cl_ntoh32(p_smp->attr_mod) & 0xff; + in_port_num = (cl_ntoh32(p_smp->attr_mod) >> 8) & 0xff; p_physp = osm_node_get_physp_ptr(p_node, out_port_num); } else { p_physp = p_port->p_physp;