From patchwork Thu Aug 11 00:42:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 1055462 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7B0gcE8017017 for ; Thu, 11 Aug 2011 00:42:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755541Ab1HKAmd (ORCPT ); Wed, 10 Aug 2011 20:42:33 -0400 Received: from mga03.intel.com ([143.182.124.21]:50932 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755533Ab1HKAmb convert rfc822-to-8bit (ORCPT ); Wed, 10 Aug 2011 20:42:31 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 10 Aug 2011 17:42:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,353,1309762800"; d="scan'208";a="37259092" Received: from azsmsx601.amr.corp.intel.com ([10.2.121.193]) by azsmga001.ch.intel.com with ESMTP; 10 Aug 2011 17:42:24 -0700 Received: from fmsmsx105.amr.corp.intel.com (10.19.9.36) by azsmsx601.amr.corp.intel.com (10.2.121.193) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 10 Aug 2011 17:42:24 -0700 Received: from fmsmsx151.amr.corp.intel.com ([169.254.6.155]) by FMSMSX105.amr.corp.intel.com ([169.254.5.97]) with mapi id 14.01.0323.003; Wed, 10 Aug 2011 17:42:23 -0700 From: "Davis, Arlin R" To: linux-rdma , "ofw@lists.openfabrics.org" , "ewg@lists.openfabrics.org" Subject: [PATCH 9/10] DAPL v2.0: common: add new dapls_evd_post_event_ext call for extended events Thread-Topic: [PATCH 9/10] DAPL v2.0: common: add new dapls_evd_post_event_ext call for extended events Thread-Index: AcxXv4idyaGeZq5aRTSU/phAo1Lm1w== Date: Thu, 11 Aug 2011 00:42:23 +0000 Message-ID: <54347E5A035A054EAE9D05927FB467F916E42B72@FMSMSX151.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Aug 2011 00:42:38 +0000 (UTC) Add prototype and code to post extended events on dispatcher and include collective definitions to dat_event_str function. Signed-off-by: Arlin Davis --- dapl/common/dapl_evd_util.c | 61 ++++++++++++++++++++++++++++++++++++++++++- dapl/common/dapl_evd_util.h | 7 +++++ 2 files changed, 67 insertions(+), 1 deletions(-) diff --git a/dapl/common/dapl_evd_util.c b/dapl/common/dapl_evd_util.c index 2a45400..9171415 100644 --- a/dapl/common/dapl_evd_util.c +++ b/dapl/common/dapl_evd_util.c @@ -91,7 +91,7 @@ char *dapl_event_str(IN DAT_EVENT_NUMBER event_num) {"DAT_SOFTWARE_EVENT", DAT_SOFTWARE_EVENT}, #ifdef DAT_EXTENSIONS {"DAT_EXTENSION_EVENT", DAT_EXTENSION_EVENT}, - {"DAT_IB_EXTENSION_RANGE_BASE", DAT_IB_EXTENSION_RANGE_BASE}, + {"DAT_IB_DTO_EVENT", DAT_IB_EXTENSION_RANGE_BASE}, {"DAT_IB_UD_CONNECTION_REQUEST_EVENT", DAT_IB_EXTENSION_RANGE_BASE + 1}, {"DAT_IB_UD_CONNECTION_EVENT_ESTABLISHED", @@ -100,6 +100,8 @@ char *dapl_event_str(IN DAT_EVENT_NUMBER event_num) DAT_IB_EXTENSION_RANGE_BASE + 3}, {"DAT_IB_UD_CONNECTION_ERROR_EVENT", DAT_IB_EXTENSION_RANGE_BASE + 4}, + {"DAT_IB_COLLECTIVE_EVENT", + DAT_IB_EXTENSION_RANGE_BASE + 5}, {"DAT_IW_EXTENSION_RANGE_BASE", DAT_IW_EXTENSION_RANGE_BASE}, #endif /* DAT_EXTENSIONS */ {NULL, 0}, @@ -837,6 +839,63 @@ err: } #ifdef DAT_EXTENSIONS + +/* + * dapls_evd_post_event_ext + * + * Post a extended event type. Not used by all providers + * + * Input: + * evd_ptr + * event_number + * data + * data_ext + * + * Output: + * none + * + * Returns: + * DAT_SUCCESS + * + */ +DAT_RETURN +dapls_evd_post_event_ext(IN DAPL_EVD * evd_ptr, + IN DAT_EVENT_NUMBER event_number, + IN DAT_EVENT_DATA * data, + IN DAT_UINT64 * data_ext) +{ + DAT_EVENT *event_ptr; + + dapl_os_lock(&evd_ptr->header.lock); + event_ptr = dapli_evd_get_and_init_event(evd_ptr, event_number); + /* + * Note event lock may be held on successful return + * to be released by dapli_evd_post_event(), if provider side locking + * is needed. + */ + + if (event_ptr == NULL) { + dapl_os_unlock(&evd_ptr->header.lock); + return DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, + DAT_RESOURCE_MEMORY); + } + + /* copy event and extended data */ + if (data) + event_ptr->event_data = *data; + else + dapl_os_memzero(&event_ptr->event_data, + sizeof(event_ptr->event_data)); + + dapl_os_memcpy( (void*)event_ptr->event_extension_data, + (void *)data_ext, + sizeof(event_ptr->event_extension_data)); + + dapli_evd_post_event(evd_ptr, event_ptr); + dapl_os_unlock(&evd_ptr->header.lock); + return DAT_SUCCESS; +} + DAT_RETURN dapls_evd_do_post_cr_event_ext(IN DAPL_EVD * evd_ptr, IN DAT_EVENT_NUMBER event_number, diff --git a/dapl/common/dapl_evd_util.h b/dapl/common/dapl_evd_util.h index 65472d7..3d6dbeb 100644 --- a/dapl/common/dapl_evd_util.h +++ b/dapl/common/dapl_evd_util.h @@ -111,6 +111,13 @@ dapls_evd_post_generic_event ( #ifdef DAT_EXTENSIONS DAT_RETURN +dapls_evd_post_event_ext( + IN DAPL_EVD *evd_ptr, + IN DAT_EVENT_NUMBER event_number, + IN DAT_EVENT_DATA *data, + IN DAT_UINT64 *data_ext); + +DAT_RETURN dapls_evd_post_cr_event_ext ( IN DAPL_SP *sp_ptr, IN DAT_EVENT_NUMBER event_number,