From 26a93d225f357525e23ce708fb3cd193453ef7ac Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 3 Feb 2010 16:55:55 -0800 Subject: [PATCH] refresh --- meta | 7 +- patches/libibverbs-release | 751 +++++++++++++++++++++++++++++++++++- patches/refresh-temp | 757 ------------------------------------- 3 files changed, 752 insertions(+), 763 deletions(-) delete mode 100644 patches/refresh-temp diff --git a/meta b/meta index 2f1978d6..99f4b7bb 100644 --- a/meta +++ b/meta @@ -1,11 +1,10 @@ Version: 1 -Previous: 91a13c798392cba24f8e014df167cd0800e2b2bc -Head: f23c4746fb3048e5cfc0013b1bfb30e4e578fae9 +Previous: e869fcd6d769f0eebc62d547d0198176b6ea86a1 +Head: f31dfae054abd22d7afd822f68c0f57ee2d344c5 Applied: rm-build: 6ece22f911fcfc6fceeb779a3cb16702ab4ba386 dapl-cleanup: ad55d4913247fe33cfe9752a538c62bb760413de - libibverbs-release: 98b6ce2f8f9c0a9e78e3f1e7717dc72c39ae215e - refresh-temp: f23c4746fb3048e5cfc0013b1bfb30e4e578fae9 + libibverbs-release: f31dfae054abd22d7afd822f68c0f57ee2d344c5 Unapplied: debug-wv: 6cf14f62c78d74636413cd01aa624f2825f26b09 dapl-debug: e13c7a46d1fab529c3008c37bac955a1d7738195 diff --git a/patches/libibverbs-release b/patches/libibverbs-release index 761b4196..a7ce2f95 100644 --- a/patches/libibverbs-release +++ b/patches/libibverbs-release @@ -1,5 +1,5 @@ Bottom: 5d7a00b20748ebf64b6bc43cd8e99a5c01f6e6d2 -Top: 5d7a00b20748ebf64b6bc43cd8e99a5c01f6e6d2 +Top: b57f60cfc3fc1ea3881329f1abced3d99528a53b Author: Sean Hefty Date: 2010-02-03 16:54:57 -0800 @@ -13,4 +13,751 @@ Signed-off-by: Sean Hefty --- - +diff --git a/trunk/ulp/libibverbs/src/device.cpp b/trunk/ulp/libibverbs/src/device.cpp +index 1b66d3c..46372bc 100644 +--- a/trunk/ulp/libibverbs/src/device.cpp ++++ b/trunk/ulp/libibverbs/src/device.cpp +@@ -1,371 +1,372 @@ +-/* +- * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. +- * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. +- * +- * This software is available to you under the OpenIB.org BSD license +- * below: +- * +- * Redistribution and use in source and binary forms, with or +- * without modification, are permitted provided that the following +- * conditions are met: +- * +- * - Redistributions of source code must retain the above +- * copyright notice, this list of conditions and the following +- * disclaimer. +- * +- * - Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following +- * disclaimer in the documentation and/or other materials +- * provided with the distribution. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV +- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +- +-#include +-#include +-#include +-#include "..\..\..\etc\user\comp_channel.cpp" +- +-CRITICAL_SECTION lock; +-IWVProvider *prov; +-COMP_MANAGER comp_mgr; +-static DWORD ref; +- +-struct verbs_device +-{ +- struct ibv_device device; +- uint64_t guid; +- uint8_t phys_port_cnt; +-}; +- +-struct verbs_port +-{ +- COMP_ENTRY comp_entry; +- DWORD event_flag; +- uint8_t port_num; +-}; +- +-struct verbs_context +-{ +- struct ibv_context context; +- struct verbs_device device; +- uint8_t closing; +- struct verbs_port *port; +- verbs_port *event_port; +-}; +- +-static int ibv_acquire(void) +-{ +- HRESULT hr; +- +- EnterCriticalSection(&lock); +- if (ref++ == 0) { +- hr = WvGetObject(IID_IWVProvider, (LPVOID*) &prov); +- if (FAILED(hr)) { +- goto err1; +- } +- hr = CompManagerOpen(&comp_mgr); +- if (FAILED(hr)) { +- goto err2; +- } +- hr = CompManagerMonitor(&comp_mgr, prov->GetFileHandle(), 0); +- if (FAILED(hr)) { +- goto err3; +- } +- } +- LeaveCriticalSection(&lock); +- return 0; +- +-err3: +- CompManagerClose(&comp_mgr); +-err2: +- prov->Release(); +-err1: +- ref--; +- LeaveCriticalSection(&lock); +- return hr; +-} +- +-static void ibv_release(void) +-{ +- EnterCriticalSection(&lock); +- if (--ref == 0) { +- CompManagerClose(&comp_mgr); +- prov->Release(); +- } +- LeaveCriticalSection(&lock); +-} +- +-__declspec(dllexport) +-int ibvw_get_windata(struct ibvw_windata *windata, int version) +-{ +- int ret; +- +- if (version != IBVW_WINDATA_VERSION || ibv_acquire()) { +- return -1; +- } +- +- prov->AddRef(); +- windata->prov = prov; +- windata->comp_mgr = &comp_mgr; +- return 0; +-} +- +-__declspec(dllexport) +-void ibvw_release_windata(struct ibvw_windata *windata, int version) +-{ +- ibv_release(); +-} +- +-__declspec(dllexport) +-struct ibv_device **ibv_get_device_list(int *num) +-{ +- WV_DEVICE_ATTRIBUTES attr; +- struct verbs_device *dev_array; +- struct ibv_device **pdev_array; +- NET64 *guid; +- SIZE_T size, cnt; +- HRESULT hr; +- +- if (ibv_acquire()) { +- goto err1; +- } +- +- cnt = 0; +- size = sizeof(NET64); +- +- while ((size / sizeof(NET64)) > cnt) { +- if (cnt > 0) { +- delete guid; +- } +- +- cnt = size / sizeof(NET64); +- guid = new NET64[cnt]; +- if (guid == NULL) { +- goto err1; +- } +- +- hr = prov->QueryDeviceList(guid, &size); +- if (FAILED(hr)) { +- goto err2; +- } +- } +- +- size /= sizeof(NET64); +- dev_array = new struct verbs_device[size]; +- pdev_array = new struct ibv_device*[size + 1]; +- if (dev_array == NULL || pdev_array == NULL) { +- goto err2; +- } +- +- for (cnt = 0; cnt < size; cnt++) { +- pdev_array[cnt] = &dev_array[cnt].device; +- hr = prov->QueryDevice(guid[cnt], &attr); +- if (FAILED(hr)) { +- goto err3; +- } +- +- sprintf(dev_array[cnt].device.name, "ibv_device%d", cnt); +- dev_array[cnt].device.node_type = IBV_NODE_UNKNOWN; +- dev_array[cnt].device.transport_type = (ibv_transport_type) attr.DeviceType; +- dev_array[cnt].guid = guid[cnt]; +- dev_array[cnt].phys_port_cnt = attr.PhysPortCount; +- } +- +- pdev_array[cnt] = NULL; +- if (num != NULL) { +- *num = (int) size; +- } +- return pdev_array; +- +-err3: +- ibv_free_device_list(pdev_array); +-err2: +- delete guid; +-err1: +- return NULL; +-} +- +-__declspec(dllexport) +-void ibv_free_device_list(struct ibv_device **list) +-{ +- ibv_release(); +- delete CONTAINING_RECORD(list[0], struct verbs_device, device); +- delete list; +-} +- +-__declspec(dllexport) +-const char *ibv_get_device_name(struct ibv_device *device) +-{ +- return device->name; +-} +- +-__declspec(dllexport) +-uint64_t ibv_get_device_guid(struct ibv_device *device) +-{ +- return CONTAINING_RECORD(device, struct verbs_device, device)->guid; +-} +- +-__declspec(dllexport) +-struct ibv_context *ibv_open_device(struct ibv_device *device) +-{ +- struct verbs_device *vdev; +- struct verbs_context *vcontext; +- HRESULT hr; +- int i; +- +- vdev = CONTAINING_RECORD(device, struct verbs_device, device); +- vcontext = new struct verbs_context; +- if (vcontext == NULL) { +- return NULL; +- } +- +- ibv_acquire(); +- memcpy(&vcontext->device, vdev, sizeof(struct verbs_device)); +- vcontext->context.device = &vcontext->device.device; +- vcontext->event_port = NULL; +- vcontext->closing = 0; +- CompChannelInit(&comp_mgr, &vcontext->context.channel, INFINITE); +- +- vcontext->port = new struct verbs_port[vdev->phys_port_cnt]; +- if (vcontext->port == NULL) { +- goto err1; +- } +- +- hr = prov->OpenDevice(vdev->guid, &vcontext->context.cmd_if); +- if (FAILED(hr)) { +- goto err2; +- } +- +- for (i = 0; i < vdev->phys_port_cnt; i++) { +- vcontext->port[i].port_num = (uint8_t) i + 1; +- vcontext->port[i].event_flag = 0; +- CompEntryInit(&vcontext->context.channel, &vcontext->port[i].comp_entry); +- vcontext->port[i].comp_entry.Busy = 1; +- vcontext->context.cmd_if->Notify(vcontext->port[i].port_num, +- &vcontext->port[i].comp_entry.Overlap, +- &vcontext->port[i].event_flag); +- } +- +- return &vcontext->context; +- +-err2: +- delete vcontext->port; +-err1: +- delete vcontext; +- ibv_release(); +- return NULL; +-} +- +-__declspec(dllexport) +-int ibv_close_device(struct ibv_context *context) +-{ +- struct verbs_context *vcontext; +- int i; +- +- vcontext = CONTAINING_RECORD(context, struct verbs_context, context); +- vcontext->closing = 1; +- context->cmd_if->CancelOverlappedRequests(); +- +- for (i = 0; i < vcontext->device.phys_port_cnt; i++) { +- CompEntryCancel(&vcontext->port[i].comp_entry); +- } +- +- context->cmd_if->Release(); +- CompChannelCleanup(&vcontext->context.channel); +- ibv_release(); +- delete vcontext->port; +- delete vcontext; +- return 0; +-} +- +-static enum ibv_event_type ibv_get_port_event_state(struct verbs_context *vcontext) +-{ +- WV_PORT_ATTRIBUTES attr; +- HRESULT hr; +- +- hr = vcontext->context.cmd_if->QueryPort(vcontext->event_port->port_num, &attr); +- if (FAILED(hr)) { +- return IBV_EVENT_PORT_ERR; +- } +- +- return (attr.State == WvPortActive) ? +- IBV_EVENT_PORT_ACTIVE : IBV_EVENT_PORT_ERR; +-} +- +-static int ibv_report_port_event(struct verbs_context *vcontext, +- struct ibv_async_event *event) +-{ +- struct verbs_port *port; +- int ret = 0; +- +- port = vcontext->event_port; +- event->element.port_num = port->port_num; +- +- if (port->event_flag & WV_EVENT_ERROR) { +- event->event_type = IBV_EVENT_DEVICE_FATAL; +- port->event_flag = 0; +- } else if (port->event_flag & WV_EVENT_STATE) { +- event->event_type = ibv_get_port_event_state(vcontext); +- port->event_flag = 0; +- } else if (port->event_flag & WV_EVENT_MANAGEMENT) { +- event->event_type = IBV_EVENT_SM_CHANGE; +- port->event_flag = 0; +- } else if (port->event_flag & WV_EVENT_LINK_ADDRESS) { +- event->event_type = IBV_EVENT_LID_CHANGE; +- port->event_flag &= ~WV_EVENT_LINK_ADDRESS; +- } else if (port->event_flag & WV_EVENT_PARTITION) { +- event->event_type = IBV_EVENT_PKEY_CHANGE; +- port->event_flag &= ~WV_EVENT_PARTITION; +- } else { +- port->event_flag = 0; +- ret = -1; +- } +- +- if (port->event_flag == 0 && !vcontext->closing) { +- port->comp_entry.Busy = 1; +- vcontext->context.cmd_if->Notify(vcontext->event_port->port_num, +- &port->comp_entry.Overlap, +- &port->event_flag); +- vcontext->event_port = NULL; +- } +- return ret; +-} +- +-__declspec(dllexport) +-int ibv_get_async_event(struct ibv_context *context, +- struct ibv_async_event *event) +-{ +- struct verbs_context *vcontext; +- COMP_ENTRY *entry; +- int ret; +- +- vcontext = CONTAINING_RECORD(context, struct verbs_context, context); +- if (vcontext->event_port) { +- if (ibv_report_port_event(vcontext, event) == 0) { +- return 0; +- } +- } +- +- ret = CompChannelPoll(&context->channel, &entry); +- if (!ret) { +- vcontext->event_port = CONTAINING_RECORD(entry, struct verbs_port, comp_entry); +- ret = ibv_report_port_event(vcontext, event); +- } +- +- return ret; +-} +- +-__declspec(dllexport) +-void ibv_ack_async_event(struct ibv_async_event *event) +-{ +- // Only device/port level events are currently supported +- // nothing to do here at the moment +-} ++/* ++ * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. ++ * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. ++ * ++ * This software is available to you under the OpenIB.org BSD license ++ * below: ++ * ++ * Redistribution and use in source and binary forms, with or ++ * without modification, are permitted provided that the following ++ * conditions are met: ++ * ++ * - Redistributions of source code must retain the above ++ * copyright notice, this list of conditions and the following ++ * disclaimer. ++ * ++ * - Redistributions in binary form must reproduce the above ++ * copyright notice, this list of conditions and the following ++ * disclaimer in the documentation and/or other materials ++ * provided with the distribution. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ */ ++ ++#include ++#include ++#include ++#include "..\..\..\etc\user\comp_channel.cpp" ++ ++CRITICAL_SECTION lock; ++IWVProvider *prov; ++COMP_MANAGER comp_mgr; ++static DWORD ref; ++ ++struct verbs_device ++{ ++ struct ibv_device device; ++ uint64_t guid; ++ uint8_t phys_port_cnt; ++}; ++ ++struct verbs_port ++{ ++ COMP_ENTRY comp_entry; ++ DWORD event_flag; ++ uint8_t port_num; ++}; ++ ++struct verbs_context ++{ ++ struct ibv_context context; ++ struct verbs_device device; ++ uint8_t closing; ++ struct verbs_port *port; ++ verbs_port *event_port; ++}; ++ ++static int ibv_acquire(void) ++{ ++ HRESULT hr; ++ ++ EnterCriticalSection(&lock); ++ if (ref++ == 0) { ++ hr = WvGetObject(IID_IWVProvider, (LPVOID*) &prov); ++ if (FAILED(hr)) { ++ goto err1; ++ } ++ hr = CompManagerOpen(&comp_mgr); ++ if (FAILED(hr)) { ++ goto err2; ++ } ++ hr = CompManagerMonitor(&comp_mgr, prov->GetFileHandle(), 0); ++ if (FAILED(hr)) { ++ goto err3; ++ } ++ } ++ LeaveCriticalSection(&lock); ++ return 0; ++ ++err3: ++ CompManagerClose(&comp_mgr); ++err2: ++ prov->Release(); ++err1: ++ ref--; ++ LeaveCriticalSection(&lock); ++ return hr; ++} ++ ++static void ibv_release(void) ++{ ++ EnterCriticalSection(&lock); ++ if (--ref == 0) { ++ CompManagerClose(&comp_mgr); ++ prov->Release(); ++ } ++ LeaveCriticalSection(&lock); ++} ++ ++__declspec(dllexport) ++int ibvw_get_windata(struct ibvw_windata *windata, int version) ++{ ++ int ret; ++ ++ if (version != IBVW_WINDATA_VERSION || ibv_acquire()) { ++ return -1; ++ } ++ ++ prov->AddRef(); ++ windata->prov = prov; ++ windata->comp_mgr = &comp_mgr; ++ return 0; ++} ++ ++__declspec(dllexport) ++void ibvw_release_windata(struct ibvw_windata *windata, int version) ++{ ++ prov->Release(); ++ ibv_release(); ++} ++ ++__declspec(dllexport) ++struct ibv_device **ibv_get_device_list(int *num) ++{ ++ WV_DEVICE_ATTRIBUTES attr; ++ struct verbs_device *dev_array; ++ struct ibv_device **pdev_array; ++ NET64 *guid; ++ SIZE_T size, cnt; ++ HRESULT hr; ++ ++ if (ibv_acquire()) { ++ goto err1; ++ } ++ ++ cnt = 0; ++ size = sizeof(NET64); ++ ++ while ((size / sizeof(NET64)) > cnt) { ++ if (cnt > 0) { ++ delete guid; ++ } ++ ++ cnt = size / sizeof(NET64); ++ guid = new NET64[cnt]; ++ if (guid == NULL) { ++ goto err1; ++ } ++ ++ hr = prov->QueryDeviceList(guid, &size); ++ if (FAILED(hr)) { ++ goto err2; ++ } ++ } ++ ++ size /= sizeof(NET64); ++ dev_array = new struct verbs_device[size]; ++ pdev_array = new struct ibv_device*[size + 1]; ++ if (dev_array == NULL || pdev_array == NULL) { ++ goto err2; ++ } ++ ++ for (cnt = 0; cnt < size; cnt++) { ++ pdev_array[cnt] = &dev_array[cnt].device; ++ hr = prov->QueryDevice(guid[cnt], &attr); ++ if (FAILED(hr)) { ++ goto err3; ++ } ++ ++ sprintf(dev_array[cnt].device.name, "ibv_device%d", cnt); ++ dev_array[cnt].device.node_type = IBV_NODE_UNKNOWN; ++ dev_array[cnt].device.transport_type = (ibv_transport_type) attr.DeviceType; ++ dev_array[cnt].guid = guid[cnt]; ++ dev_array[cnt].phys_port_cnt = attr.PhysPortCount; ++ } ++ ++ pdev_array[cnt] = NULL; ++ if (num != NULL) { ++ *num = (int) size; ++ } ++ return pdev_array; ++ ++err3: ++ ibv_free_device_list(pdev_array); ++err2: ++ delete guid; ++err1: ++ return NULL; ++} ++ ++__declspec(dllexport) ++void ibv_free_device_list(struct ibv_device **list) ++{ ++ ibv_release(); ++ delete CONTAINING_RECORD(list[0], struct verbs_device, device); ++ delete list; ++} ++ ++__declspec(dllexport) ++const char *ibv_get_device_name(struct ibv_device *device) ++{ ++ return device->name; ++} ++ ++__declspec(dllexport) ++uint64_t ibv_get_device_guid(struct ibv_device *device) ++{ ++ return CONTAINING_RECORD(device, struct verbs_device, device)->guid; ++} ++ ++__declspec(dllexport) ++struct ibv_context *ibv_open_device(struct ibv_device *device) ++{ ++ struct verbs_device *vdev; ++ struct verbs_context *vcontext; ++ HRESULT hr; ++ int i; ++ ++ vdev = CONTAINING_RECORD(device, struct verbs_device, device); ++ vcontext = new struct verbs_context; ++ if (vcontext == NULL) { ++ return NULL; ++ } ++ ++ ibv_acquire(); ++ memcpy(&vcontext->device, vdev, sizeof(struct verbs_device)); ++ vcontext->context.device = &vcontext->device.device; ++ vcontext->event_port = NULL; ++ vcontext->closing = 0; ++ CompChannelInit(&comp_mgr, &vcontext->context.channel, INFINITE); ++ ++ vcontext->port = new struct verbs_port[vdev->phys_port_cnt]; ++ if (vcontext->port == NULL) { ++ goto err1; ++ } ++ ++ hr = prov->OpenDevice(vdev->guid, &vcontext->context.cmd_if); ++ if (FAILED(hr)) { ++ goto err2; ++ } ++ ++ for (i = 0; i < vdev->phys_port_cnt; i++) { ++ vcontext->port[i].port_num = (uint8_t) i + 1; ++ vcontext->port[i].event_flag = 0; ++ CompEntryInit(&vcontext->context.channel, &vcontext->port[i].comp_entry); ++ vcontext->port[i].comp_entry.Busy = 1; ++ vcontext->context.cmd_if->Notify(vcontext->port[i].port_num, ++ &vcontext->port[i].comp_entry.Overlap, ++ &vcontext->port[i].event_flag); ++ } ++ ++ return &vcontext->context; ++ ++err2: ++ delete vcontext->port; ++err1: ++ delete vcontext; ++ ibv_release(); ++ return NULL; ++} ++ ++__declspec(dllexport) ++int ibv_close_device(struct ibv_context *context) ++{ ++ struct verbs_context *vcontext; ++ int i; ++ ++ vcontext = CONTAINING_RECORD(context, struct verbs_context, context); ++ vcontext->closing = 1; ++ context->cmd_if->CancelOverlappedRequests(); ++ ++ for (i = 0; i < vcontext->device.phys_port_cnt; i++) { ++ CompEntryCancel(&vcontext->port[i].comp_entry); ++ } ++ ++ context->cmd_if->Release(); ++ CompChannelCleanup(&vcontext->context.channel); ++ ibv_release(); ++ delete vcontext->port; ++ delete vcontext; ++ return 0; ++} ++ ++static enum ibv_event_type ibv_get_port_event_state(struct verbs_context *vcontext) ++{ ++ WV_PORT_ATTRIBUTES attr; ++ HRESULT hr; ++ ++ hr = vcontext->context.cmd_if->QueryPort(vcontext->event_port->port_num, &attr); ++ if (FAILED(hr)) { ++ return IBV_EVENT_PORT_ERR; ++ } ++ ++ return (attr.State == WvPortActive) ? ++ IBV_EVENT_PORT_ACTIVE : IBV_EVENT_PORT_ERR; ++} ++ ++static int ibv_report_port_event(struct verbs_context *vcontext, ++ struct ibv_async_event *event) ++{ ++ struct verbs_port *port; ++ int ret = 0; ++ ++ port = vcontext->event_port; ++ event->element.port_num = port->port_num; ++ ++ if (port->event_flag & WV_EVENT_ERROR) { ++ event->event_type = IBV_EVENT_DEVICE_FATAL; ++ port->event_flag = 0; ++ } else if (port->event_flag & WV_EVENT_STATE) { ++ event->event_type = ibv_get_port_event_state(vcontext); ++ port->event_flag = 0; ++ } else if (port->event_flag & WV_EVENT_MANAGEMENT) { ++ event->event_type = IBV_EVENT_SM_CHANGE; ++ port->event_flag = 0; ++ } else if (port->event_flag & WV_EVENT_LINK_ADDRESS) { ++ event->event_type = IBV_EVENT_LID_CHANGE; ++ port->event_flag &= ~WV_EVENT_LINK_ADDRESS; ++ } else if (port->event_flag & WV_EVENT_PARTITION) { ++ event->event_type = IBV_EVENT_PKEY_CHANGE; ++ port->event_flag &= ~WV_EVENT_PARTITION; ++ } else { ++ port->event_flag = 0; ++ ret = -1; ++ } ++ ++ if (port->event_flag == 0 && !vcontext->closing) { ++ port->comp_entry.Busy = 1; ++ vcontext->context.cmd_if->Notify(vcontext->event_port->port_num, ++ &port->comp_entry.Overlap, ++ &port->event_flag); ++ vcontext->event_port = NULL; ++ } ++ return ret; ++} ++ ++__declspec(dllexport) ++int ibv_get_async_event(struct ibv_context *context, ++ struct ibv_async_event *event) ++{ ++ struct verbs_context *vcontext; ++ COMP_ENTRY *entry; ++ int ret; ++ ++ vcontext = CONTAINING_RECORD(context, struct verbs_context, context); ++ if (vcontext->event_port) { ++ if (ibv_report_port_event(vcontext, event) == 0) { ++ return 0; ++ } ++ } ++ ++ ret = CompChannelPoll(&context->channel, &entry); ++ if (!ret) { ++ vcontext->event_port = CONTAINING_RECORD(entry, struct verbs_port, comp_entry); ++ ret = ibv_report_port_event(vcontext, event); ++ } ++ ++ return ret; ++} ++ ++__declspec(dllexport) ++void ibv_ack_async_event(struct ibv_async_event *event) ++{ ++ // Only device/port level events are currently supported ++ // nothing to do here at the moment ++} diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index 8f41ddb0..00000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,757 +0,0 @@ -Bottom: 5d7a00b20748ebf64b6bc43cd8e99a5c01f6e6d2 -Top: b57f60cfc3fc1ea3881329f1abced3d99528a53b -Author: Sean Hefty -Date: 2010-02-03 16:55:51 -0800 - -Refresh of libibverbs-release - ---- - -diff --git a/trunk/ulp/libibverbs/src/device.cpp b/trunk/ulp/libibverbs/src/device.cpp -index 1b66d3c..46372bc 100644 ---- a/trunk/ulp/libibverbs/src/device.cpp -+++ b/trunk/ulp/libibverbs/src/device.cpp -@@ -1,371 +1,372 @@ --/* -- * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. -- * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. -- * -- * This software is available to you under the OpenIB.org BSD license -- * below: -- * -- * Redistribution and use in source and binary forms, with or -- * without modification, are permitted provided that the following -- * conditions are met: -- * -- * - Redistributions of source code must retain the above -- * copyright notice, this list of conditions and the following -- * disclaimer. -- * -- * - Redistributions in binary form must reproduce the above -- * copyright notice, this list of conditions and the following -- * disclaimer in the documentation and/or other materials -- * provided with the distribution. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV -- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ -- --#include --#include --#include --#include "..\..\..\etc\user\comp_channel.cpp" -- --CRITICAL_SECTION lock; --IWVProvider *prov; --COMP_MANAGER comp_mgr; --static DWORD ref; -- --struct verbs_device --{ -- struct ibv_device device; -- uint64_t guid; -- uint8_t phys_port_cnt; --}; -- --struct verbs_port --{ -- COMP_ENTRY comp_entry; -- DWORD event_flag; -- uint8_t port_num; --}; -- --struct verbs_context --{ -- struct ibv_context context; -- struct verbs_device device; -- uint8_t closing; -- struct verbs_port *port; -- verbs_port *event_port; --}; -- --static int ibv_acquire(void) --{ -- HRESULT hr; -- -- EnterCriticalSection(&lock); -- if (ref++ == 0) { -- hr = WvGetObject(IID_IWVProvider, (LPVOID*) &prov); -- if (FAILED(hr)) { -- goto err1; -- } -- hr = CompManagerOpen(&comp_mgr); -- if (FAILED(hr)) { -- goto err2; -- } -- hr = CompManagerMonitor(&comp_mgr, prov->GetFileHandle(), 0); -- if (FAILED(hr)) { -- goto err3; -- } -- } -- LeaveCriticalSection(&lock); -- return 0; -- --err3: -- CompManagerClose(&comp_mgr); --err2: -- prov->Release(); --err1: -- ref--; -- LeaveCriticalSection(&lock); -- return hr; --} -- --static void ibv_release(void) --{ -- EnterCriticalSection(&lock); -- if (--ref == 0) { -- CompManagerClose(&comp_mgr); -- prov->Release(); -- } -- LeaveCriticalSection(&lock); --} -- --__declspec(dllexport) --int ibvw_get_windata(struct ibvw_windata *windata, int version) --{ -- int ret; -- -- if (version != IBVW_WINDATA_VERSION || ibv_acquire()) { -- return -1; -- } -- -- prov->AddRef(); -- windata->prov = prov; -- windata->comp_mgr = &comp_mgr; -- return 0; --} -- --__declspec(dllexport) --void ibvw_release_windata(struct ibvw_windata *windata, int version) --{ -- ibv_release(); --} -- --__declspec(dllexport) --struct ibv_device **ibv_get_device_list(int *num) --{ -- WV_DEVICE_ATTRIBUTES attr; -- struct verbs_device *dev_array; -- struct ibv_device **pdev_array; -- NET64 *guid; -- SIZE_T size, cnt; -- HRESULT hr; -- -- if (ibv_acquire()) { -- goto err1; -- } -- -- cnt = 0; -- size = sizeof(NET64); -- -- while ((size / sizeof(NET64)) > cnt) { -- if (cnt > 0) { -- delete guid; -- } -- -- cnt = size / sizeof(NET64); -- guid = new NET64[cnt]; -- if (guid == NULL) { -- goto err1; -- } -- -- hr = prov->QueryDeviceList(guid, &size); -- if (FAILED(hr)) { -- goto err2; -- } -- } -- -- size /= sizeof(NET64); -- dev_array = new struct verbs_device[size]; -- pdev_array = new struct ibv_device*[size + 1]; -- if (dev_array == NULL || pdev_array == NULL) { -- goto err2; -- } -- -- for (cnt = 0; cnt < size; cnt++) { -- pdev_array[cnt] = &dev_array[cnt].device; -- hr = prov->QueryDevice(guid[cnt], &attr); -- if (FAILED(hr)) { -- goto err3; -- } -- -- sprintf(dev_array[cnt].device.name, "ibv_device%d", cnt); -- dev_array[cnt].device.node_type = IBV_NODE_UNKNOWN; -- dev_array[cnt].device.transport_type = (ibv_transport_type) attr.DeviceType; -- dev_array[cnt].guid = guid[cnt]; -- dev_array[cnt].phys_port_cnt = attr.PhysPortCount; -- } -- -- pdev_array[cnt] = NULL; -- if (num != NULL) { -- *num = (int) size; -- } -- return pdev_array; -- --err3: -- ibv_free_device_list(pdev_array); --err2: -- delete guid; --err1: -- return NULL; --} -- --__declspec(dllexport) --void ibv_free_device_list(struct ibv_device **list) --{ -- ibv_release(); -- delete CONTAINING_RECORD(list[0], struct verbs_device, device); -- delete list; --} -- --__declspec(dllexport) --const char *ibv_get_device_name(struct ibv_device *device) --{ -- return device->name; --} -- --__declspec(dllexport) --uint64_t ibv_get_device_guid(struct ibv_device *device) --{ -- return CONTAINING_RECORD(device, struct verbs_device, device)->guid; --} -- --__declspec(dllexport) --struct ibv_context *ibv_open_device(struct ibv_device *device) --{ -- struct verbs_device *vdev; -- struct verbs_context *vcontext; -- HRESULT hr; -- int i; -- -- vdev = CONTAINING_RECORD(device, struct verbs_device, device); -- vcontext = new struct verbs_context; -- if (vcontext == NULL) { -- return NULL; -- } -- -- ibv_acquire(); -- memcpy(&vcontext->device, vdev, sizeof(struct verbs_device)); -- vcontext->context.device = &vcontext->device.device; -- vcontext->event_port = NULL; -- vcontext->closing = 0; -- CompChannelInit(&comp_mgr, &vcontext->context.channel, INFINITE); -- -- vcontext->port = new struct verbs_port[vdev->phys_port_cnt]; -- if (vcontext->port == NULL) { -- goto err1; -- } -- -- hr = prov->OpenDevice(vdev->guid, &vcontext->context.cmd_if); -- if (FAILED(hr)) { -- goto err2; -- } -- -- for (i = 0; i < vdev->phys_port_cnt; i++) { -- vcontext->port[i].port_num = (uint8_t) i + 1; -- vcontext->port[i].event_flag = 0; -- CompEntryInit(&vcontext->context.channel, &vcontext->port[i].comp_entry); -- vcontext->port[i].comp_entry.Busy = 1; -- vcontext->context.cmd_if->Notify(vcontext->port[i].port_num, -- &vcontext->port[i].comp_entry.Overlap, -- &vcontext->port[i].event_flag); -- } -- -- return &vcontext->context; -- --err2: -- delete vcontext->port; --err1: -- delete vcontext; -- ibv_release(); -- return NULL; --} -- --__declspec(dllexport) --int ibv_close_device(struct ibv_context *context) --{ -- struct verbs_context *vcontext; -- int i; -- -- vcontext = CONTAINING_RECORD(context, struct verbs_context, context); -- vcontext->closing = 1; -- context->cmd_if->CancelOverlappedRequests(); -- -- for (i = 0; i < vcontext->device.phys_port_cnt; i++) { -- CompEntryCancel(&vcontext->port[i].comp_entry); -- } -- -- context->cmd_if->Release(); -- CompChannelCleanup(&vcontext->context.channel); -- ibv_release(); -- delete vcontext->port; -- delete vcontext; -- return 0; --} -- --static enum ibv_event_type ibv_get_port_event_state(struct verbs_context *vcontext) --{ -- WV_PORT_ATTRIBUTES attr; -- HRESULT hr; -- -- hr = vcontext->context.cmd_if->QueryPort(vcontext->event_port->port_num, &attr); -- if (FAILED(hr)) { -- return IBV_EVENT_PORT_ERR; -- } -- -- return (attr.State == WvPortActive) ? -- IBV_EVENT_PORT_ACTIVE : IBV_EVENT_PORT_ERR; --} -- --static int ibv_report_port_event(struct verbs_context *vcontext, -- struct ibv_async_event *event) --{ -- struct verbs_port *port; -- int ret = 0; -- -- port = vcontext->event_port; -- event->element.port_num = port->port_num; -- -- if (port->event_flag & WV_EVENT_ERROR) { -- event->event_type = IBV_EVENT_DEVICE_FATAL; -- port->event_flag = 0; -- } else if (port->event_flag & WV_EVENT_STATE) { -- event->event_type = ibv_get_port_event_state(vcontext); -- port->event_flag = 0; -- } else if (port->event_flag & WV_EVENT_MANAGEMENT) { -- event->event_type = IBV_EVENT_SM_CHANGE; -- port->event_flag = 0; -- } else if (port->event_flag & WV_EVENT_LINK_ADDRESS) { -- event->event_type = IBV_EVENT_LID_CHANGE; -- port->event_flag &= ~WV_EVENT_LINK_ADDRESS; -- } else if (port->event_flag & WV_EVENT_PARTITION) { -- event->event_type = IBV_EVENT_PKEY_CHANGE; -- port->event_flag &= ~WV_EVENT_PARTITION; -- } else { -- port->event_flag = 0; -- ret = -1; -- } -- -- if (port->event_flag == 0 && !vcontext->closing) { -- port->comp_entry.Busy = 1; -- vcontext->context.cmd_if->Notify(vcontext->event_port->port_num, -- &port->comp_entry.Overlap, -- &port->event_flag); -- vcontext->event_port = NULL; -- } -- return ret; --} -- --__declspec(dllexport) --int ibv_get_async_event(struct ibv_context *context, -- struct ibv_async_event *event) --{ -- struct verbs_context *vcontext; -- COMP_ENTRY *entry; -- int ret; -- -- vcontext = CONTAINING_RECORD(context, struct verbs_context, context); -- if (vcontext->event_port) { -- if (ibv_report_port_event(vcontext, event) == 0) { -- return 0; -- } -- } -- -- ret = CompChannelPoll(&context->channel, &entry); -- if (!ret) { -- vcontext->event_port = CONTAINING_RECORD(entry, struct verbs_port, comp_entry); -- ret = ibv_report_port_event(vcontext, event); -- } -- -- return ret; --} -- --__declspec(dllexport) --void ibv_ack_async_event(struct ibv_async_event *event) --{ -- // Only device/port level events are currently supported -- // nothing to do here at the moment --} -+/* -+ * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. -+ * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. -+ * -+ * This software is available to you under the OpenIB.org BSD license -+ * below: -+ * -+ * Redistribution and use in source and binary forms, with or -+ * without modification, are permitted provided that the following -+ * conditions are met: -+ * -+ * - Redistributions of source code must retain the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer. -+ * -+ * - Redistributions in binary form must reproduce the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer in the documentation and/or other materials -+ * provided with the distribution. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. -+ */ -+ -+#include -+#include -+#include -+#include "..\..\..\etc\user\comp_channel.cpp" -+ -+CRITICAL_SECTION lock; -+IWVProvider *prov; -+COMP_MANAGER comp_mgr; -+static DWORD ref; -+ -+struct verbs_device -+{ -+ struct ibv_device device; -+ uint64_t guid; -+ uint8_t phys_port_cnt; -+}; -+ -+struct verbs_port -+{ -+ COMP_ENTRY comp_entry; -+ DWORD event_flag; -+ uint8_t port_num; -+}; -+ -+struct verbs_context -+{ -+ struct ibv_context context; -+ struct verbs_device device; -+ uint8_t closing; -+ struct verbs_port *port; -+ verbs_port *event_port; -+}; -+ -+static int ibv_acquire(void) -+{ -+ HRESULT hr; -+ -+ EnterCriticalSection(&lock); -+ if (ref++ == 0) { -+ hr = WvGetObject(IID_IWVProvider, (LPVOID*) &prov); -+ if (FAILED(hr)) { -+ goto err1; -+ } -+ hr = CompManagerOpen(&comp_mgr); -+ if (FAILED(hr)) { -+ goto err2; -+ } -+ hr = CompManagerMonitor(&comp_mgr, prov->GetFileHandle(), 0); -+ if (FAILED(hr)) { -+ goto err3; -+ } -+ } -+ LeaveCriticalSection(&lock); -+ return 0; -+ -+err3: -+ CompManagerClose(&comp_mgr); -+err2: -+ prov->Release(); -+err1: -+ ref--; -+ LeaveCriticalSection(&lock); -+ return hr; -+} -+ -+static void ibv_release(void) -+{ -+ EnterCriticalSection(&lock); -+ if (--ref == 0) { -+ CompManagerClose(&comp_mgr); -+ prov->Release(); -+ } -+ LeaveCriticalSection(&lock); -+} -+ -+__declspec(dllexport) -+int ibvw_get_windata(struct ibvw_windata *windata, int version) -+{ -+ int ret; -+ -+ if (version != IBVW_WINDATA_VERSION || ibv_acquire()) { -+ return -1; -+ } -+ -+ prov->AddRef(); -+ windata->prov = prov; -+ windata->comp_mgr = &comp_mgr; -+ return 0; -+} -+ -+__declspec(dllexport) -+void ibvw_release_windata(struct ibvw_windata *windata, int version) -+{ -+ prov->Release(); -+ ibv_release(); -+} -+ -+__declspec(dllexport) -+struct ibv_device **ibv_get_device_list(int *num) -+{ -+ WV_DEVICE_ATTRIBUTES attr; -+ struct verbs_device *dev_array; -+ struct ibv_device **pdev_array; -+ NET64 *guid; -+ SIZE_T size, cnt; -+ HRESULT hr; -+ -+ if (ibv_acquire()) { -+ goto err1; -+ } -+ -+ cnt = 0; -+ size = sizeof(NET64); -+ -+ while ((size / sizeof(NET64)) > cnt) { -+ if (cnt > 0) { -+ delete guid; -+ } -+ -+ cnt = size / sizeof(NET64); -+ guid = new NET64[cnt]; -+ if (guid == NULL) { -+ goto err1; -+ } -+ -+ hr = prov->QueryDeviceList(guid, &size); -+ if (FAILED(hr)) { -+ goto err2; -+ } -+ } -+ -+ size /= sizeof(NET64); -+ dev_array = new struct verbs_device[size]; -+ pdev_array = new struct ibv_device*[size + 1]; -+ if (dev_array == NULL || pdev_array == NULL) { -+ goto err2; -+ } -+ -+ for (cnt = 0; cnt < size; cnt++) { -+ pdev_array[cnt] = &dev_array[cnt].device; -+ hr = prov->QueryDevice(guid[cnt], &attr); -+ if (FAILED(hr)) { -+ goto err3; -+ } -+ -+ sprintf(dev_array[cnt].device.name, "ibv_device%d", cnt); -+ dev_array[cnt].device.node_type = IBV_NODE_UNKNOWN; -+ dev_array[cnt].device.transport_type = (ibv_transport_type) attr.DeviceType; -+ dev_array[cnt].guid = guid[cnt]; -+ dev_array[cnt].phys_port_cnt = attr.PhysPortCount; -+ } -+ -+ pdev_array[cnt] = NULL; -+ if (num != NULL) { -+ *num = (int) size; -+ } -+ return pdev_array; -+ -+err3: -+ ibv_free_device_list(pdev_array); -+err2: -+ delete guid; -+err1: -+ return NULL; -+} -+ -+__declspec(dllexport) -+void ibv_free_device_list(struct ibv_device **list) -+{ -+ ibv_release(); -+ delete CONTAINING_RECORD(list[0], struct verbs_device, device); -+ delete list; -+} -+ -+__declspec(dllexport) -+const char *ibv_get_device_name(struct ibv_device *device) -+{ -+ return device->name; -+} -+ -+__declspec(dllexport) -+uint64_t ibv_get_device_guid(struct ibv_device *device) -+{ -+ return CONTAINING_RECORD(device, struct verbs_device, device)->guid; -+} -+ -+__declspec(dllexport) -+struct ibv_context *ibv_open_device(struct ibv_device *device) -+{ -+ struct verbs_device *vdev; -+ struct verbs_context *vcontext; -+ HRESULT hr; -+ int i; -+ -+ vdev = CONTAINING_RECORD(device, struct verbs_device, device); -+ vcontext = new struct verbs_context; -+ if (vcontext == NULL) { -+ return NULL; -+ } -+ -+ ibv_acquire(); -+ memcpy(&vcontext->device, vdev, sizeof(struct verbs_device)); -+ vcontext->context.device = &vcontext->device.device; -+ vcontext->event_port = NULL; -+ vcontext->closing = 0; -+ CompChannelInit(&comp_mgr, &vcontext->context.channel, INFINITE); -+ -+ vcontext->port = new struct verbs_port[vdev->phys_port_cnt]; -+ if (vcontext->port == NULL) { -+ goto err1; -+ } -+ -+ hr = prov->OpenDevice(vdev->guid, &vcontext->context.cmd_if); -+ if (FAILED(hr)) { -+ goto err2; -+ } -+ -+ for (i = 0; i < vdev->phys_port_cnt; i++) { -+ vcontext->port[i].port_num = (uint8_t) i + 1; -+ vcontext->port[i].event_flag = 0; -+ CompEntryInit(&vcontext->context.channel, &vcontext->port[i].comp_entry); -+ vcontext->port[i].comp_entry.Busy = 1; -+ vcontext->context.cmd_if->Notify(vcontext->port[i].port_num, -+ &vcontext->port[i].comp_entry.Overlap, -+ &vcontext->port[i].event_flag); -+ } -+ -+ return &vcontext->context; -+ -+err2: -+ delete vcontext->port; -+err1: -+ delete vcontext; -+ ibv_release(); -+ return NULL; -+} -+ -+__declspec(dllexport) -+int ibv_close_device(struct ibv_context *context) -+{ -+ struct verbs_context *vcontext; -+ int i; -+ -+ vcontext = CONTAINING_RECORD(context, struct verbs_context, context); -+ vcontext->closing = 1; -+ context->cmd_if->CancelOverlappedRequests(); -+ -+ for (i = 0; i < vcontext->device.phys_port_cnt; i++) { -+ CompEntryCancel(&vcontext->port[i].comp_entry); -+ } -+ -+ context->cmd_if->Release(); -+ CompChannelCleanup(&vcontext->context.channel); -+ ibv_release(); -+ delete vcontext->port; -+ delete vcontext; -+ return 0; -+} -+ -+static enum ibv_event_type ibv_get_port_event_state(struct verbs_context *vcontext) -+{ -+ WV_PORT_ATTRIBUTES attr; -+ HRESULT hr; -+ -+ hr = vcontext->context.cmd_if->QueryPort(vcontext->event_port->port_num, &attr); -+ if (FAILED(hr)) { -+ return IBV_EVENT_PORT_ERR; -+ } -+ -+ return (attr.State == WvPortActive) ? -+ IBV_EVENT_PORT_ACTIVE : IBV_EVENT_PORT_ERR; -+} -+ -+static int ibv_report_port_event(struct verbs_context *vcontext, -+ struct ibv_async_event *event) -+{ -+ struct verbs_port *port; -+ int ret = 0; -+ -+ port = vcontext->event_port; -+ event->element.port_num = port->port_num; -+ -+ if (port->event_flag & WV_EVENT_ERROR) { -+ event->event_type = IBV_EVENT_DEVICE_FATAL; -+ port->event_flag = 0; -+ } else if (port->event_flag & WV_EVENT_STATE) { -+ event->event_type = ibv_get_port_event_state(vcontext); -+ port->event_flag = 0; -+ } else if (port->event_flag & WV_EVENT_MANAGEMENT) { -+ event->event_type = IBV_EVENT_SM_CHANGE; -+ port->event_flag = 0; -+ } else if (port->event_flag & WV_EVENT_LINK_ADDRESS) { -+ event->event_type = IBV_EVENT_LID_CHANGE; -+ port->event_flag &= ~WV_EVENT_LINK_ADDRESS; -+ } else if (port->event_flag & WV_EVENT_PARTITION) { -+ event->event_type = IBV_EVENT_PKEY_CHANGE; -+ port->event_flag &= ~WV_EVENT_PARTITION; -+ } else { -+ port->event_flag = 0; -+ ret = -1; -+ } -+ -+ if (port->event_flag == 0 && !vcontext->closing) { -+ port->comp_entry.Busy = 1; -+ vcontext->context.cmd_if->Notify(vcontext->event_port->port_num, -+ &port->comp_entry.Overlap, -+ &port->event_flag); -+ vcontext->event_port = NULL; -+ } -+ return ret; -+} -+ -+__declspec(dllexport) -+int ibv_get_async_event(struct ibv_context *context, -+ struct ibv_async_event *event) -+{ -+ struct verbs_context *vcontext; -+ COMP_ENTRY *entry; -+ int ret; -+ -+ vcontext = CONTAINING_RECORD(context, struct verbs_context, context); -+ if (vcontext->event_port) { -+ if (ibv_report_port_event(vcontext, event) == 0) { -+ return 0; -+ } -+ } -+ -+ ret = CompChannelPoll(&context->channel, &entry); -+ if (!ret) { -+ vcontext->event_port = CONTAINING_RECORD(entry, struct verbs_port, comp_entry); -+ ret = ibv_report_port_event(vcontext, event); -+ } -+ -+ return ret; -+} -+ -+__declspec(dllexport) -+void ibv_ack_async_event(struct ibv_async_event *event) -+{ -+ // Only device/port level events are currently supported -+ // nothing to do here at the moment -+} -- 2.46.0