From patchwork Wed Sep 30 23:11:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 50785 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8UNBK9h014550 for ; Wed, 30 Sep 2009 23:11:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754410AbZI3XLP (ORCPT ); Wed, 30 Sep 2009 19:11:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754585AbZI3XLP (ORCPT ); Wed, 30 Sep 2009 19:11:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:62489 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754410AbZI3XLP (ORCPT ); Wed, 30 Sep 2009 19:11:15 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 30 Sep 2009 15:58:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,482,1249282800"; d="scan'208";a="498636733" Received: from mshefty-mobl2.amr.corp.intel.com (HELO msheftyMOBL2) ([10.24.91.232]) by fmsmga002.fm.intel.com with ESMTP; 30 Sep 2009 16:03:16 -0700 From: "Sean Hefty" To: "linux-rdma" , "Davis, Arlin R" Subject: [PATCH 1/4] dapl/openib_scm: update windows support to use 'fd' abstraction Date: Wed, 30 Sep 2009 16:11:19 -0700 Message-ID: MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcpCI1FOzr31gWWuRKua65YShGUa7w== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/dapl/openib_scm/device.c b/dapl/openib_scm/device.c index bb72279..a327390 100644 --- a/dapl/openib_scm/device.c +++ b/dapl/openib_scm/device.c @@ -70,18 +70,16 @@ void dapli_ib_thread_destroy(void); #include "..\..\..\..\..\etc\user\comp_channel.cpp" #include -struct ibvw_windata windata; +static COMP_SET ufds; static int dapls_os_init(void) { - return ibvw_get_windata(&windata, IBVW_WINDATA_VERSION); + return CompSetInit(&ufds); } static void dapls_os_release(void) { - if (windata.comp_mgr) - ibvw_release_windata(&windata, IBVW_WINDATA_VERSION); - windata.comp_mgr = NULL; + CompSetCleanup(&ufds); } static int dapls_config_verbs(struct ibv_context *verbs) @@ -98,7 +96,7 @@ static int dapls_config_comp_channel(struct ibv_comp_channel *channel) static int dapls_thread_signal(void) { - CompManagerCancel(windata.comp_mgr); + CompSetCancel(&ufds); return 0; } #else // _WIN64 || WIN32 @@ -584,7 +582,6 @@ void dapli_thread(void *arg) { struct _ib_hca_transport *hca; struct _ib_hca_transport *uhca[8]; - COMP_CHANNEL *channel; int ret, idx, cnt; dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " ib_thread(%d,0x%x): ENTER: \n", @@ -595,11 +592,14 @@ void dapli_thread(void *arg) g_ib_thread_state == IB_THREAD_RUN; dapl_os_lock(&g_hca_lock)) { + CompSetZero(&ufds); idx = 0; hca = dapl_llist_is_empty(&g_hca_list) ? NULL : dapl_llist_peek_head(&g_hca_list); while (hca) { + CompSetAdd(&hca->ib_ctx->channel, &ufds); + CompSetAdd(&hca->ib_cq->comp_channel, &ufds); uhca[idx++] = hca; hca = dapl_llist_next_entry(&g_hca_list, (DAPL_LLIST_ENTRY *) @@ -608,7 +608,7 @@ void dapli_thread(void *arg) cnt = idx; dapl_os_unlock(&g_hca_lock); - ret = CompManagerPoll(windata.comp_mgr, INFINITE, &channel); + ret = CompSetPoll(&ufds, INFINITE); dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " ib_thread(%d) poll_event 0x%x\n",