From patchwork Fri May 21 17:23:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Smith, Stan" X-Patchwork-Id: 101532 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4LHNT8T003008 for ; Fri, 21 May 2010 17:23:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934330Ab0EURX2 (ORCPT ); Fri, 21 May 2010 13:23:28 -0400 Received: from mga03.intel.com ([143.182.124.21]:44531 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934303Ab0EURX1 convert rfc822-to-8bit (ORCPT ); Fri, 21 May 2010 13:23:27 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 21 May 2010 10:23:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,279,1272870000"; d="scan'208";a="279931050" Received: from orsmsx602.amr.corp.intel.com ([10.22.226.211]) by azsmga001.ch.intel.com with ESMTP; 21 May 2010 10:23:25 -0700 Received: from orsmsx501.amr.corp.intel.com ([10.22.226.209]) by orsmsx602.amr.corp.intel.com ([10.22.226.211]) with mapi; Fri, 21 May 2010 10:23:26 -0700 From: "Smith, Stan" To: Sasha Khapyorsky CC: "linux-rdma@vger.kernel.org" Date: Fri, 21 May 2010 10:23:26 -0700 Subject: [PATCH] osmtest - use helper function Thread-Topic: [PATCH] osmtest - use helper function Thread-Index: Acr5ClJuIg/ViMHsRYigKXqCnkU+PA== Message-ID: <3F6F638B8D880340AB536D29CD4C1E192562EBBB95@orsmsx501.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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.3 (demeter.kernel.org [140.211.167.41]); Fri, 21 May 2010 17:23:29 +0000 (UTC) diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c index 50f94db..5d9c54c 100644 --- a/opensm/osmtest/osmtest.c +++ b/opensm/osmtest/osmtest.c @@ -719,7 +719,7 @@ osmtest_get_node_rec(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.comp_mask = IB_NR_COMPMASK_NODEGUID; user.attr_id = IB_MAD_ATTR_NODE_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -793,7 +793,7 @@ osmtest_get_node_rec_by_lid(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.comp_mask = IB_NR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_NODE_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -1057,7 +1057,7 @@ osmtest_get_port_rec(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.comp_mask = IB_PIR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_PORTINFO_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4171,7 +4171,7 @@ osmtest_get_link_rec_by_lid(IN osmtest_t * const p_osmt, if (to_lid) user.comp_mask |= IB_LR_COMPMASK_TO_LID; user.attr_id = IB_MAD_ATTR_LINK_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4249,7 +4249,7 @@ osmtest_get_guidinfo_rec_by_lid(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.comp_mask = IB_GIR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_GUIDINFO_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4328,7 +4328,7 @@ osmtest_get_pkeytbl_rec_by_lid(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.comp_mask = IB_PKEY_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_PKEY_TBL_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4407,7 +4407,7 @@ osmtest_get_sw_info_rec_by_lid(IN osmtest_t * const p_osmt, if (lid) user.comp_mask = IB_SWIR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_SWITCH_INFO_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4486,7 +4486,7 @@ osmtest_get_lft_rec_by_lid(IN osmtest_t * const p_osmt, if (lid) user.comp_mask = IB_LFTR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_LFT_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4565,7 +4565,7 @@ osmtest_get_mft_rec_by_lid(IN osmtest_t * const p_osmt, if (lid) user.comp_mask = IB_MFTR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_MFT_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED; @@ -4637,7 +4637,7 @@ osmtest_sminfo_record_request(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.attr_id = IB_MAD_ATTR_SMINFO_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); p_sm_info_opt = p_options; if (p_sm_info_opt->sm_guid != 0) { record.sm_info.guid = p_sm_info_opt->sm_guid; @@ -4737,7 +4737,7 @@ osmtest_informinfo_request(IN osmtest_t * const p_osmt, p_context->p_osmt = p_osmt; user.attr_id = attr_id; if (attr_id == IB_MAD_ATTR_INFORM_INFO_RECORD) { - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); p_inform_info_rec_opt = p_options; if (p_inform_info_rec_opt->subscriber_gid.unicast.prefix != 0 && p_inform_info_rec_opt->subscriber_gid.unicast. @@ -4751,7 +4751,7 @@ osmtest_informinfo_request(IN osmtest_t * const p_osmt, user.comp_mask |= IB_IIR_COMPMASK_ENUM; user.p_attr = &record; } else { - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(rec) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record))); /* comp mask bits below are for InformInfoRecord rather than InformInfo */ /* as currently no comp mask bits defined for InformInfo!!! */ user.comp_mask = IB_IIR_COMPMASK_SUBSCRIBE; @@ -4900,7 +4900,7 @@ osmtest_validate_single_node_rec_lid(IN osmtest_t * const p_osmt, context.p_osmt = p_osmt; user.comp_mask = IB_NR_COMPMASK_LID; user.attr_id = IB_MAD_ATTR_NODE_RECORD; - user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3)); + user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record)); user.p_attr = &record; req.query_type = OSMV_QUERY_USER_DEFINED;