From patchwork Wed Aug 17 18:40:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1074792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7HIeLpM013434 for ; Wed, 17 Aug 2011 18:40:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753195Ab1HQSkR (ORCPT ); Wed, 17 Aug 2011 14:40:17 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:62910 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819Ab1HQSkQ (ORCPT ); Wed, 17 Aug 2011 14:40:16 -0400 Received: by vws1 with SMTP id 1so905883vws.19 for ; Wed, 17 Aug 2011 11:40:15 -0700 (PDT) Received: by 10.220.162.212 with SMTP id w20mr359983vcx.188.1313606415345; Wed, 17 Aug 2011 11:40:15 -0700 (PDT) Received: from [192.168.1.104] (c-71-192-10-85.hsd1.ma.comcast.net [71.192.10.85]) by mx.google.com with ESMTPS id gl1sm899538vcb.42.2011.08.17.11.40.14 (version=SSLv3 cipher=OTHER); Wed, 17 Aug 2011 11:40:14 -0700 (PDT) Message-ID: <4E4C0B0D.9010608@dev.mellanox.co.il> Date: Wed, 17 Aug 2011 14:40:13 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH 3/3] opensm/osm_sa_portinfo_record.c: Add SA PortInfoRecord support for CapabilityMask2 matching Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 17 Aug 2011 18:40:21 +0000 (UTC) Signed-off-by: Hal Rosenstock --- opensm/osm_sa_portinfo_record.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/opensm/osm_sa_portinfo_record.c b/opensm/osm_sa_portinfo_record.c index 6a2a520..5aa599a 100644 --- a/opensm/osm_sa_portinfo_record.c +++ b/opensm/osm_sa_portinfo_record.c @@ -402,6 +402,21 @@ static void sa_pir_check_physp(IN osm_sa_t * sa, IN const osm_physp_t * p_physp, ib_port_info_get_overrun_err_thd(p_pi)) goto Exit; } + + /* IBTA 1.2 errata provides support for bitwise compare if the bit 31 + of the attribute modifier of the Get/GetTable is set */ + if (comp_mask & IB_PIR_COMPMASK_CAPMASK2) { + if (p_ctxt->is_enhanced_comp_mask) { + if ((cl_ntoh16(p_comp_pi->capability_mask2) & + cl_ntoh16(p_pi->capability_mask2)) != + cl_ntoh16(p_comp_pi->capability_mask2)) + goto Exit; + } else { + if (cl_ntoh16(p_comp_pi->capability_mask2) != + cl_ntoh16(p_pi->capability_mask2)) + goto Exit; + } + } if (osm_node_get_type(p_physp->p_node) == IB_NODE_TYPE_SWITCH) { p_physp0 = osm_node_get_physp_ptr(p_physp->p_node, 0); cap_mask = p_physp0->port_info.capability_mask;