From fb69bea1744b8ff1e1e73870077440bb82b13abc Mon Sep 17 00:00:00 2001 From: stansmith Date: Sat, 3 May 2008 15:19:04 +0000 Subject: [PATCH] [WinVerbs] cherry picked clean compile patches from trunk for clean WDK build. git-svn-id: svn://openib.tc.cornell.edu/gen1@1119 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/winverbs/hw/mthca/Driver/SOURCES | 63 +++++++------- branches/winverbs/hw/mthca/Driver/hca.rc | 3 +- branches/winverbs/hw/mthca/Driver/hca_data.c | 84 +------------------ branches/winverbs/hw/mthca/Driver/hca_data.h | 2 - branches/winverbs/hw/mthca/Driver/hca_verbs.c | 20 +++-- branches/winverbs/hw/mthca/Driver/ib_verbs.h | 16 ++-- branches/winverbs/hw/mthca/Driver/mt_atomic.h | 2 +- branches/winverbs/hw/mthca/Driver/mt_verbs.c | 4 +- branches/winverbs/hw/mthca/Driver/mthca_cq.c | 15 ++-- branches/winverbs/hw/mthca/Driver/mthca_mr.c | 4 +- branches/winverbs/hw/mthca/Driver/mthca_qp.c | 14 ++-- branches/winverbs/hw/mthca/Driver/mthca_srq.c | 16 ++-- branches/winverbs/hw/mthca/kernel/SOURCES | 63 +++++++------- branches/winverbs/hw/mthca/kernel/hca.rc | 1 + branches/winverbs/hw/mthca/kernel/hca_data.c | 4 +- branches/winverbs/hw/mthca/kernel/mt_atomic.h | 2 +- branches/winverbs/hw/mthca/kernel/mthca_mr.c | 2 +- branches/winverbs/hw/mthca/kernel/mthca_qp.c | 2 +- branches/winverbs/hw/mthca/kernel/mthca_srq.c | 4 +- branches/winverbs/hw/mthca/user/SOURCES | 9 +- branches/winverbs/hw/mthca/user/mlnx_uvp_qp.c | 2 +- .../winverbs/hw/mthca/user/mlnx_uvp_srq.c | 2 +- 22 files changed, 128 insertions(+), 206 deletions(-) diff --git a/branches/winverbs/hw/mthca/Driver/SOURCES b/branches/winverbs/hw/mthca/Driver/SOURCES index bff6b391..5af01ec1 100644 --- a/branches/winverbs/hw/mthca/Driver/SOURCES +++ b/branches/winverbs/hw/mthca/Driver/SOURCES @@ -12,50 +12,49 @@ ENABLE_EVENT_TRACING=1 SOURCES= \ mthca_log.mc \ - mthca_log.rc \ - hca.rc \ - mthca_log.c \ - \ + hca.rc \ + mthca_log.c \ + \ ..\hca_utils.c \ ..\mt_utils.c \ - \ - hca_data.c \ + \ + hca_data.c \ hca_direct.c \ hca_driver.c \ - hca_mcast.c \ - hca_memory.c \ + hca_mcast.c \ + hca_memory.c \ hca_pci.c \ - hca_pnp.c \ - hca_verbs.c \ - \ - mt_cache.c \ - mt_device.c \ + hca_pnp.c \ + hca_verbs.c \ + \ + mt_cache.c \ + mt_device.c \ mt_l2w.c \ - mt_memory.c \ - mt_packer.c \ + mt_memory.c \ + mt_packer.c \ mt_reset_tavor.c \ - mt_ud_header.c \ - mt_uverbs.c \ - mt_verbs.c \ + mt_ud_header.c \ + mt_uverbs.c \ + mt_verbs.c \ mt_pa_cash.c \ - \ + \ mthca_allocator.c \ - mthca_av.c \ + mthca_av.c \ mthca_catas.c \ - mthca_cmd.c \ - mthca_cq.c \ - mthca_eq.c \ - mthca_mad.c \ + mthca_cmd.c \ + mthca_cq.c \ + mthca_eq.c \ + mthca_mad.c \ mthca_main.c \ - mthca_mcg.c \ - mthca_memfree.c \ - mthca_mr.c \ - mthca_pd.c \ - mthca_profile.c \ + mthca_mcg.c \ + mthca_memfree.c \ + mthca_mr.c \ + mthca_pd.c \ + mthca_profile.c \ mthca_provider.c \ - mthca_qp.c \ - mthca_srq.c \ - mthca_uar.c \ + mthca_qp.c \ + mthca_srq.c \ + mthca_uar.c \ INCLUDES=\ diff --git a/branches/winverbs/hw/mthca/Driver/hca.rc b/branches/winverbs/hw/mthca/Driver/hca.rc index dc7c415c..57411058 100644 --- a/branches/winverbs/hw/mthca/Driver/hca.rc +++ b/branches/winverbs/hw/mthca/Driver/hca.rc @@ -26,7 +26,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: hca.rc 474 2006-08-31 08:57:19Z sleybo $ + * $Id: hca.rc 1091 2008-04-30 07:01:35Z tzachid $ */ @@ -42,3 +42,4 @@ #define VER_INTERNALNAME_STR "mthca.sys" #define VER_ORIGINALFILENAME_STR "mthca.sys" #include +#include "mthca_log.rc" \ No newline at end of file diff --git a/branches/winverbs/hw/mthca/Driver/hca_data.c b/branches/winverbs/hw/mthca/Driver/hca_data.c index 97afb61d..9fbb483c 100644 --- a/branches/winverbs/hw/mthca/Driver/hca_data.c +++ b/branches/winverbs/hw/mthca/Driver/hca_data.c @@ -27,7 +27,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: hca_data.c 589 2007-02-07 13:33:49Z sleybo $ + * $Id: hca_data.c 1088 2008-04-30 03:43:49Z shefty $ */ @@ -137,7 +137,6 @@ mlnx_hcas_init( void ) ib_api_status_t mlnx_hobs_set_cb( IN mlnx_hob_t *hob_p, - IN ci_completion_cb_t comp_cb_p, IN ci_async_event_cb_t async_cb_p, IN const void* const ib_context) { @@ -162,7 +161,6 @@ mlnx_hobs_set_cb( } } - hob_p->comp_cb_p = comp_cb_p; hob_p->async_cb_p = async_cb_p; hob_p->ca_context = ib_context; // This is the context our CB forwards to IBAL HCA_PRINT(TRACE_LEVEL_INFORMATION, HCA_DBG_SHIM,("CL: hca_idx %d context 0x%p\n", (int)(hob_p - mlnx_hob_array), ib_context)); @@ -185,7 +183,6 @@ mlnx_hobs_remove( p_async_proc = hob_p->async_proc_mgr_p; hob_p->async_proc_mgr_p = NULL; - hob_p->comp_cb_p = NULL; hob_p->async_cb_p = NULL; hob_p->ca_context = NULL; hob_p->cl_device_h = NULL; @@ -330,21 +327,6 @@ mlnx_conv_hca_cap( } } -void cq_comp_handler(struct ib_cq *cq, void *context) -{ - mlnx_hob_t *hob_p = (mlnx_hob_t *)context; - struct mthca_cq *mcq =(struct mthca_cq *)cq; - HCA_ENTER(HCA_DBG_CQ); - if (hob_p && hob_p->comp_cb_p) { - HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("Invoking completion callback\n")); - (hob_p->comp_cb_p)(mcq->cq_context); - } - else { - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_CQ ,("Incorrect context. Completion callback was not invoked\n")); - } - HCA_EXIT(HCA_DBG_CQ); -} - void ca_event_handler(struct ib_event *ev, void *context) { mlnx_hob_t *hob_p = (mlnx_hob_t *)context; @@ -352,7 +334,6 @@ void ca_event_handler(struct ib_event *ev, void *context) // prepare parameters event_rec.context = (void *)hob_p->ca_context; - event_rec.trap.info.port_num = ev->element.port_num; event_rec.type = ev->event; if (event_rec.type > IB_AE_UNKNOWN) { // CL_ASSERT(0); // This shouldn't happen @@ -369,66 +350,6 @@ void ca_event_handler(struct ib_event *ev, void *context) } } -void srq_event_handler(struct ib_event *ev, void *context) -{ - mlnx_hob_t *hob_p = (mlnx_hob_t *)context; - ib_event_rec_t event_rec; - struct mthca_srq *srq_p; - - // prepare parameters - event_rec.type = ev->event; - event_rec.vendor_specific = ev->vendor_specific; - srq_p = (struct mthca_srq *)ev->element.srq; - event_rec.context = srq_p->srq_context; - - // call the user callback - if (hob_p) - (hob_p->async_cb_p)(&event_rec); - else { - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("Incorrect context. Async callback was not invoked\n")); - } -} - - -void qp_event_handler(struct ib_event *ev, void *context) -{ - mlnx_hob_t *hob_p = (mlnx_hob_t *)context; - ib_event_rec_t event_rec; - struct mthca_qp *qp_p; - - // prepare parameters - event_rec.type = ev->event; - event_rec.vendor_specific = ev->vendor_specific; - qp_p = (struct mthca_qp *)ev->element.qp; - event_rec.context = qp_p->qp_context; - - // call the user callback - if (hob_p) - (hob_p->async_cb_p)(&event_rec); - else { - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("Incorrect context. Async callback was not invoked\n")); - } -} - -void cq_event_handler(struct ib_event *ev, void *context) -{ - mlnx_hob_t *hob_p = (mlnx_hob_t *)context; - ib_event_rec_t event_rec; - struct mthca_cq *cq_p; - - // prepare parameters - event_rec.type = ev->event; - cq_p = (struct mthca_cq *)ev->element.cq; - event_rec.context = cq_p->cq_context; - - // call the user callback - if (hob_p) - (hob_p->async_cb_p)(&event_rec); - else { - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("Incorrect context. Async callback was not invoked\n")); - } -} - ib_qp_state_t mlnx_qps_to_ibal(enum ib_qp_state qps) { #define MAP_QPS(val1,val2) case val1: ib_qps = val2; break @@ -841,8 +762,7 @@ mlnx_conv_ibal_av( &ah_attr_p->grh.traffic_class, &ah_attr_p->grh.flow_label ); err = ib_find_cached_gid((struct ib_device *)ib_dev_p, (union ib_gid *)ibal_av_p->grh.src_gid.raw, &port_num, &gid_index); - if (err) { - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("ib_find_cached_gid failed %d (%#x). Using default: sgid_index = 0\n", err, err)); + if (err) { HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("ib_find_cached_gid failed %d (%#x). Using default: sgid_index = 0\n", err, err)); gid_index = 0; } else if (port_num != ah_attr_p->port_num) { diff --git a/branches/winverbs/hw/mthca/Driver/hca_data.h b/branches/winverbs/hw/mthca/Driver/hca_data.h index 4a08331f..4a24fcd4 100644 --- a/branches/winverbs/hw/mthca/Driver/hca_data.h +++ b/branches/winverbs/hw/mthca/Driver/hca_data.h @@ -171,7 +171,6 @@ typedef struct _attr_cache typedef struct _ib_ca { ENUM_MARK mark; - ci_completion_cb_t comp_cb_p; ci_async_event_cb_t async_cb_p; const void *ca_context; void *cl_device_h; @@ -275,7 +274,6 @@ mlnx_hobs_insert( ib_api_status_t mlnx_hobs_set_cb( IN mlnx_hob_t *hob_p, - IN ci_completion_cb_t comp_cb_p, IN ci_async_event_cb_t async_cb_p, IN const void* const ib_context); diff --git a/branches/winverbs/hw/mthca/Driver/hca_verbs.c b/branches/winverbs/hw/mthca/Driver/hca_verbs.c index 1972bfd2..611d0f4b 100644 --- a/branches/winverbs/hw/mthca/Driver/hca_verbs.c +++ b/branches/winverbs/hw/mthca/Driver/hca_verbs.c @@ -27,7 +27,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: hca_verbs.c 931 2008-01-31 09:20:41Z leonidk $ + * $Id: hca_verbs.c 1088 2008-04-30 03:43:49Z shefty $ */ @@ -59,7 +59,6 @@ mlnx_query_qp ( ib_api_status_t mlnx_open_ca ( IN const ib_net64_t ca_guid, // IN const char * ca_name, - IN const ci_completion_cb_t pfn_completion_cb, IN const ci_async_event_cb_t pfn_async_event_cb, IN const void*const ca_context, OUT ib_ca_handle_t *ph_ca) @@ -92,7 +91,6 @@ mlnx_open_ca ( HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_SHIM, ("context 0x%p\n", ca_context)); status = mlnx_hobs_set_cb(&p_hca->hob, - pfn_completion_cb, pfn_async_event_cb, ca_context); if (IB_SUCCESS != status) { @@ -837,6 +835,7 @@ ib_api_status_t mlnx_create_srq ( IN const ib_pd_handle_t h_pd, IN const void *srq_context, + IN ci_async_event_cb_t event_handler, IN const ib_srq_attr_t * const p_srq_attr, OUT ib_srq_handle_t *ph_srq, IN OUT ci_umv_buf_t *p_umv_buf ) @@ -867,7 +866,7 @@ mlnx_create_srq ( // prepare the parameters RtlZeroMemory(&srq_init_attr, sizeof(srq_init_attr)); - srq_init_attr.event_handler = srq_event_handler; + srq_init_attr.event_handler = event_handler; srq_init_attr.srq_context = hob_p; srq_init_attr.attr = *p_srq_attr; @@ -1004,6 +1003,7 @@ _create_qp ( IN const ib_pd_handle_t h_pd, IN const uint8_t port_num, IN const void *qp_context, + IN ci_async_event_cb_t event_handler, IN const ib_qp_create_t *p_create_attr, OUT ib_qp_attr_t *p_qp_attr, OUT ib_qp_handle_t *ph_qp, @@ -1035,7 +1035,7 @@ _create_qp ( // prepare the parameters RtlZeroMemory(&qp_init_attr, sizeof(qp_init_attr)); qp_init_attr.qp_type = p_create_attr->qp_type; - qp_init_attr.event_handler = qp_event_handler; + qp_init_attr.event_handler = event_handler; qp_init_attr.qp_context = hob_p; qp_init_attr.recv_cq = (struct ib_cq *)p_create_attr->h_rq_cq; qp_init_attr.send_cq = (struct ib_cq *)p_create_attr->h_sq_cq; @@ -1097,6 +1097,7 @@ mlnx_create_spl_qp ( IN const ib_pd_handle_t h_pd, IN const uint8_t port_num, IN const void *qp_context, + IN ci_async_event_cb_t event_handler, IN const ib_qp_create_t *p_create_attr, OUT ib_qp_attr_t *p_qp_attr, OUT ib_qp_handle_t *ph_qp ) @@ -1107,7 +1108,7 @@ mlnx_create_spl_qp ( HCA_ENTER(HCA_DBG_SHIM); status = _create_qp( h_pd, port_num, - qp_context, p_create_attr, p_qp_attr, ph_qp, NULL ); + qp_context, event_handler, p_create_attr, p_qp_attr, ph_qp, NULL ); if (status != IB_SUCCESS) { @@ -1122,6 +1123,7 @@ ib_api_status_t mlnx_create_qp ( IN const ib_pd_handle_t h_pd, IN const void *qp_context, + IN ci_async_event_cb_t event_handler, IN const ib_qp_create_t *p_create_attr, OUT ib_qp_attr_t *p_qp_attr, OUT ib_qp_handle_t *ph_qp, @@ -1138,7 +1140,7 @@ mlnx_create_qp ( HCA_ENTER(HCA_DBG_QP); status = _create_qp( h_pd, port_num, - qp_context, p_create_attr, p_qp_attr, ph_qp, p_umv_buf ); + qp_context, event_handler, p_create_attr, p_qp_attr, ph_qp, p_umv_buf ); if (status != IB_SUCCESS) { @@ -1363,6 +1365,8 @@ ib_api_status_t mlnx_create_cq ( IN const ib_ca_handle_t h_ca, IN const void *cq_context, + IN ci_async_event_cb_t event_handler, + IN ci_completion_cb_t cq_comp_handler, IN OUT uint32_t *p_size, OUT ib_cq_handle_t *ph_cq, IN OUT ci_umv_buf_t *p_umv_buf ) @@ -1405,7 +1409,7 @@ mlnx_create_cq ( // allocate cq ib_cq_p = ibv_create_cq(ib_dev, - cq_comp_handler, cq_event_handler, + cq_comp_handler, event_handler, hob_p, *p_size, p_context, p_umv_buf ); if (IS_ERR(ib_cq_p)) { err = PTR_ERR(ib_cq_p); diff --git a/branches/winverbs/hw/mthca/Driver/ib_verbs.h b/branches/winverbs/hw/mthca/Driver/ib_verbs.h index 5c24db91..9412819e 100644 --- a/branches/winverbs/hw/mthca/Driver/ib_verbs.h +++ b/branches/winverbs/hw/mthca/Driver/ib_verbs.h @@ -35,7 +35,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: ib_verbs.h 584 2007-02-07 13:12:18Z sleybo $ + * $Id: ib_verbs.h 1088 2008-04-30 03:43:49Z shefty $ */ #if !defined(IB_VERBS_H) @@ -336,7 +336,7 @@ enum ib_cq_notify { }; struct ib_srq_init_attr { - void (*event_handler)(struct ib_event *, void *); + void (*event_handler)(ib_event_rec_t *); void *srq_context; ib_srq_attr_t attr; }; @@ -355,7 +355,7 @@ enum ib_sig_type { }; struct ib_qp_init_attr { - void (*event_handler)(struct ib_event *, void *); + void (*event_handler)(ib_event_rec_t *); void *qp_context; struct ib_cq *send_cq; struct ib_cq *recv_cq; @@ -574,14 +574,14 @@ struct ib_ah { struct ib_ucontext *ucontext; }; -typedef void (*ib_comp_handler)(struct ib_cq *cq, void *cq_context); +typedef void (*ib_comp_handler)(void *cq_context); struct ib_cq { struct ib_device *device; struct ib_ucontext *ucontext; struct ib_mr *ib_mr; ib_comp_handler comp_handler; - void (*event_handler)(struct ib_event *, void *); + void (*event_handler)(ib_event_rec_t *); void * cq_context; int cqe; atomic_t usecnt; /* count number of work queues */ @@ -592,7 +592,7 @@ struct ib_srq { struct ib_pd *pd; struct ib_ucontext *ucontext; struct ib_mr *ib_mr; - void (*event_handler)(struct ib_event *, void *); + void (*event_handler)(ib_event_rec_t *); void *srq_context; atomic_t usecnt; /* count number of work queues */ }; @@ -605,7 +605,7 @@ struct ib_qp { struct ib_srq *srq; struct ib_ucontext *ucontext; struct ib_mr *ib_mr; - void (*event_handler)(struct ib_event *, void *); + void (*event_handler)(ib_event_rec_t *); void *qp_context; u32 qp_num; enum ib_qp_type_t qp_type; @@ -1083,7 +1083,7 @@ static inline int ib_post_recv(struct ib_qp *qp, */ struct ib_cq *ibv_create_cq(struct ib_device *device, ib_comp_handler comp_handler, - void (*event_handler)(struct ib_event *, void *), + void (*event_handler)(ib_event_rec_t *), void *cq_context, int cqe, struct ib_ucontext *context, ci_umv_buf_t* const p_umv_buf); diff --git a/branches/winverbs/hw/mthca/Driver/mt_atomic.h b/branches/winverbs/hw/mthca/Driver/mt_atomic.h index 4d1411e7..4976d6eb 100644 --- a/branches/winverbs/hw/mthca/Driver/mt_atomic.h +++ b/branches/winverbs/hw/mthca/Driver/mt_atomic.h @@ -15,7 +15,7 @@ static inline atomic_t atomic_read(atomic_t *pval) static inline void atomic_set(atomic_t *pval, long val) { - *pval = (atomic_t)val; + *pval = *(atomic_t *)&val; //to avoid C4197 } /** diff --git a/branches/winverbs/hw/mthca/Driver/mt_verbs.c b/branches/winverbs/hw/mthca/Driver/mt_verbs.c index 8710ba8b..f64398ad 100644 --- a/branches/winverbs/hw/mthca/Driver/mt_verbs.c +++ b/branches/winverbs/hw/mthca/Driver/mt_verbs.c @@ -35,7 +35,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: mt_verbs.c 590 2007-02-07 13:56:47Z sleybo $ + * $Id: mt_verbs.c 1088 2008-04-30 03:43:49Z shefty $ */ #include @@ -581,7 +581,7 @@ int ibv_destroy_qp(struct ib_qp *qp) struct ib_cq *ibv_create_cq(struct ib_device *device, ib_comp_handler comp_handler, - void (*event_handler)(struct ib_event *, void *), + void (*event_handler)(ib_event_rec_t *), void *cq_context, int cqe, struct ib_ucontext *context, ci_umv_buf_t* const p_umv_buf) { diff --git a/branches/winverbs/hw/mthca/Driver/mthca_cq.c b/branches/winverbs/hw/mthca/Driver/mthca_cq.c index 0b6342b9..4f6177e1 100644 --- a/branches/winverbs/hw/mthca/Driver/mthca_cq.c +++ b/branches/winverbs/hw/mthca/Driver/mthca_cq.c @@ -33,7 +33,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: mthca_cq.c 593 2007-02-15 07:39:49Z sleybo $ + * $Id: mthca_cq.c 1088 2008-04-30 03:43:49Z shefty $ */ #include @@ -237,14 +237,14 @@ void mthca_cq_completion(struct mthca_dev *dev, u32 cqn) ++cq->arm_sn; } - cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context); + cq->ibcq.comp_handler(cq->cq_context); } void mthca_cq_event(struct mthca_dev *dev, u32 cqn, enum ib_event_type event_type) { struct mthca_cq *cq; - struct ib_event event; + ib_event_rec_t event; SPIN_LOCK_PREP(lh); spin_lock(&dev->cq_table.lock, &lh); @@ -260,11 +260,10 @@ void mthca_cq_event(struct mthca_dev *dev, u32 cqn, return; } - event.device = &dev->ib_dev; - event.event = event_type; - event.element.cq = &cq->ibcq; - if (cq->ibcq.event_handler) - cq->ibcq.event_handler(&event, cq->ibcq.cq_context); + event.type = event_type; + event.context = cq->ibcq.cq_context; + event.vendor_specific = 0; + cq->ibcq.event_handler(&event); if (atomic_dec_and_test(&cq->refcount)) wake_up(&cq->wait); diff --git a/branches/winverbs/hw/mthca/Driver/mthca_mr.c b/branches/winverbs/hw/mthca/Driver/mthca_mr.c index 34ace963..7b5b1e45 100644 --- a/branches/winverbs/hw/mthca/Driver/mthca_mr.c +++ b/branches/winverbs/hw/mthca/Driver/mthca_mr.c @@ -30,7 +30,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: mthca_mr.c 744 2007-07-31 19:04:15Z leonidk $ + * $Id: mthca_mr.c 1091 2008-04-30 07:01:35Z tzachid $ */ #include "mthca_dev.h" @@ -876,7 +876,7 @@ int mthca_init_mr_table(struct mthca_dev *dev) dev->mr_table.tavor_fmr.mpt_base = ioremap(dev->mr_table.mpt_base, - (1 << i) * sizeof (struct mthca_mpt_entry), + (u32)(1 << i) * sizeof (struct mthca_mpt_entry), &dev->mr_table.tavor_fmr.mpt_base_size); if (!dev->mr_table.tavor_fmr.mpt_base) { diff --git a/branches/winverbs/hw/mthca/Driver/mthca_qp.c b/branches/winverbs/hw/mthca/Driver/mthca_qp.c index e1f7c3a3..a8c167bd 100644 --- a/branches/winverbs/hw/mthca/Driver/mthca_qp.c +++ b/branches/winverbs/hw/mthca/Driver/mthca_qp.c @@ -32,7 +32,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: mthca_qp.c 939 2008-02-10 15:25:55Z leonidk $ + * $Id: mthca_qp.c 1088 2008-04-30 03:43:49Z shefty $ */ #include @@ -391,7 +391,7 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn, enum ib_event_type event_type, u8 vendor_code) { struct mthca_qp *qp; - struct ib_event event; + ib_event_rec_t event; SPIN_LOCK_PREP(lh); spin_lock(&dev->qp_table.lock, &lh); @@ -405,14 +405,12 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn, return; } - event.device = &dev->ib_dev; - event.event = event_type; - event.element.qp = &qp->ibqp; + event.type = event_type; + event.context = qp->ibqp.qp_context; event.vendor_specific = vendor_code; HCA_PRINT(TRACE_LEVEL_WARNING,HCA_DBG_QP,("QP %06x Async event event_type 0x%x vendor_code 0x%x\n", qpn,event_type,vendor_code)); - if (qp->ibqp.event_handler) - qp->ibqp.event_handler(&event, qp->ibqp.qp_context); + qp->ibqp.event_handler(&event); if (atomic_dec_and_test(&qp->refcount)) wake_up(&qp->wait); @@ -1174,7 +1172,7 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, next->ee_nds = cl_hton32(size); for (scatter = (void *) (next + 1); - (void *) scatter < (void *) ((u8*)next + (1 << qp->rq.wqe_shift)); + (void *) scatter < (void *) ((u8*)next + (u32)(1 << qp->rq.wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } diff --git a/branches/winverbs/hw/mthca/Driver/mthca_srq.c b/branches/winverbs/hw/mthca/Driver/mthca_srq.c index 586f14f1..b869adea 100644 --- a/branches/winverbs/hw/mthca/Driver/mthca_srq.c +++ b/branches/winverbs/hw/mthca/Driver/mthca_srq.c @@ -29,7 +29,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: mthca_srq.c 576 2007-02-07 11:26:05Z sleybo $ + * $Id: mthca_srq.c 1091 2008-04-30 07:01:35Z tzachid $ */ #include "mt_l2w.h" @@ -185,7 +185,7 @@ static int mthca_alloc_srq_buf(struct mthca_dev *dev, struct mthca_pd *pd, *wqe_to_link(wqe) = i < srq->max - 1 ? i + 1 : -1; for (scatter = (struct mthca_data_seg *)(wqe + sizeof (struct mthca_next_seg)); - (void *) scatter < (void*)(wqe + (1 << srq->wqe_shift)); + (void *) scatter < (void*)(wqe + (uint32_t)(1 << srq->wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } @@ -432,7 +432,7 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn, enum ib_event_type event_type, u8 vendor_code) { struct mthca_srq *srq; - struct ib_event event; + ib_event_rec_t event; SPIN_LOCK_PREP(lh); spin_lock(&dev->srq_table.lock, &lh); @@ -449,15 +449,13 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn, if (!srq->ibsrq.event_handler) goto out; - event.device = &dev->ib_dev; - event.event = event_type; - event.element.srq = &srq->ibsrq; + event.type = event_type; + event.context = srq->ibsrq.srq_context; event.vendor_specific = vendor_code; HCA_PRINT(TRACE_LEVEL_WARNING,HCA_DBG_SRQ, ("SRQ %06x Async event event_type 0x%x vendor_code 0x%x\n", srqn,event_type,vendor_code)); - if (srq->ibsrq.event_handler) - srq->ibsrq.event_handler(&event, srq->ibsrq.srq_context); + srq->ibsrq.event_handler(&event); out: if (atomic_dec_and_test(&srq->refcount)) @@ -712,7 +710,7 @@ int mthca_max_srq_sge(struct mthca_dev *dev) * the FW max_sg value returned. */ return min( (uint32_t)dev->limits.max_sg, - ((1 << (fls(dev->limits.max_desc_sz) - 1)) - + ((uint32_t)(1 << (fls(dev->limits.max_desc_sz) - 1)) - sizeof (struct mthca_next_seg)) / sizeof (struct mthca_data_seg)); } diff --git a/branches/winverbs/hw/mthca/kernel/SOURCES b/branches/winverbs/hw/mthca/kernel/SOURCES index bff6b391..5af01ec1 100644 --- a/branches/winverbs/hw/mthca/kernel/SOURCES +++ b/branches/winverbs/hw/mthca/kernel/SOURCES @@ -12,50 +12,49 @@ ENABLE_EVENT_TRACING=1 SOURCES= \ mthca_log.mc \ - mthca_log.rc \ - hca.rc \ - mthca_log.c \ - \ + hca.rc \ + mthca_log.c \ + \ ..\hca_utils.c \ ..\mt_utils.c \ - \ - hca_data.c \ + \ + hca_data.c \ hca_direct.c \ hca_driver.c \ - hca_mcast.c \ - hca_memory.c \ + hca_mcast.c \ + hca_memory.c \ hca_pci.c \ - hca_pnp.c \ - hca_verbs.c \ - \ - mt_cache.c \ - mt_device.c \ + hca_pnp.c \ + hca_verbs.c \ + \ + mt_cache.c \ + mt_device.c \ mt_l2w.c \ - mt_memory.c \ - mt_packer.c \ + mt_memory.c \ + mt_packer.c \ mt_reset_tavor.c \ - mt_ud_header.c \ - mt_uverbs.c \ - mt_verbs.c \ + mt_ud_header.c \ + mt_uverbs.c \ + mt_verbs.c \ mt_pa_cash.c \ - \ + \ mthca_allocator.c \ - mthca_av.c \ + mthca_av.c \ mthca_catas.c \ - mthca_cmd.c \ - mthca_cq.c \ - mthca_eq.c \ - mthca_mad.c \ + mthca_cmd.c \ + mthca_cq.c \ + mthca_eq.c \ + mthca_mad.c \ mthca_main.c \ - mthca_mcg.c \ - mthca_memfree.c \ - mthca_mr.c \ - mthca_pd.c \ - mthca_profile.c \ + mthca_mcg.c \ + mthca_memfree.c \ + mthca_mr.c \ + mthca_pd.c \ + mthca_profile.c \ mthca_provider.c \ - mthca_qp.c \ - mthca_srq.c \ - mthca_uar.c \ + mthca_qp.c \ + mthca_srq.c \ + mthca_uar.c \ INCLUDES=\ diff --git a/branches/winverbs/hw/mthca/kernel/hca.rc b/branches/winverbs/hw/mthca/kernel/hca.rc index 345f4397..2780199f 100644 --- a/branches/winverbs/hw/mthca/kernel/hca.rc +++ b/branches/winverbs/hw/mthca/kernel/hca.rc @@ -42,3 +42,4 @@ #define VER_INTERNALNAME_STR "mthca.sys" #define VER_ORIGINALFILENAME_STR "mthca.sys" #include +#include "mthca_log.rc" \ No newline at end of file diff --git a/branches/winverbs/hw/mthca/kernel/hca_data.c b/branches/winverbs/hw/mthca/kernel/hca_data.c index 5baad274..ce2c2f77 100644 --- a/branches/winverbs/hw/mthca/kernel/hca_data.c +++ b/branches/winverbs/hw/mthca/kernel/hca_data.c @@ -762,9 +762,7 @@ mlnx_conv_ibal_av( &ah_attr_p->grh.traffic_class, &ah_attr_p->grh.flow_label ); err = ib_find_cached_gid((struct ib_device *)ib_dev_p, (union ib_gid *)ibal_av_p->grh.src_gid.raw, &port_num, &gid_index); - if (err) { - - HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("ib_find_cached_gid failed %d (%#x). Using default: sgid_index = 0\n", err, err)); + if (err) { HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("ib_find_cached_gid failed %d (%#x). Using default: sgid_index = 0\n", err, err)); gid_index = 0; } else if (port_num != ah_attr_p->port_num) { diff --git a/branches/winverbs/hw/mthca/kernel/mt_atomic.h b/branches/winverbs/hw/mthca/kernel/mt_atomic.h index 4d1411e7..4976d6eb 100644 --- a/branches/winverbs/hw/mthca/kernel/mt_atomic.h +++ b/branches/winverbs/hw/mthca/kernel/mt_atomic.h @@ -15,7 +15,7 @@ static inline atomic_t atomic_read(atomic_t *pval) static inline void atomic_set(atomic_t *pval, long val) { - *pval = (atomic_t)val; + *pval = *(atomic_t *)&val; //to avoid C4197 } /** diff --git a/branches/winverbs/hw/mthca/kernel/mthca_mr.c b/branches/winverbs/hw/mthca/kernel/mthca_mr.c index f76b4b0c..bfdc807e 100644 --- a/branches/winverbs/hw/mthca/kernel/mthca_mr.c +++ b/branches/winverbs/hw/mthca/kernel/mthca_mr.c @@ -876,7 +876,7 @@ int mthca_init_mr_table(struct mthca_dev *dev) dev->mr_table.tavor_fmr.mpt_base = ioremap(dev->mr_table.mpt_base, - (1 << i) * sizeof (struct mthca_mpt_entry), + (u32)(1 << i) * sizeof (struct mthca_mpt_entry), &dev->mr_table.tavor_fmr.mpt_base_size); if (!dev->mr_table.tavor_fmr.mpt_base) { diff --git a/branches/winverbs/hw/mthca/kernel/mthca_qp.c b/branches/winverbs/hw/mthca/kernel/mthca_qp.c index 5fb5ce4d..e8dd0958 100644 --- a/branches/winverbs/hw/mthca/kernel/mthca_qp.c +++ b/branches/winverbs/hw/mthca/kernel/mthca_qp.c @@ -1172,7 +1172,7 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, next->ee_nds = cl_hton32(size); for (scatter = (void *) (next + 1); - (void *) scatter < (void *) ((u8*)next + (1 << qp->rq.wqe_shift)); + (void *) scatter < (void *) ((u8*)next + (u32)(1 << qp->rq.wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } diff --git a/branches/winverbs/hw/mthca/kernel/mthca_srq.c b/branches/winverbs/hw/mthca/kernel/mthca_srq.c index 17df38d3..09c970db 100644 --- a/branches/winverbs/hw/mthca/kernel/mthca_srq.c +++ b/branches/winverbs/hw/mthca/kernel/mthca_srq.c @@ -185,7 +185,7 @@ static int mthca_alloc_srq_buf(struct mthca_dev *dev, struct mthca_pd *pd, *wqe_to_link(wqe) = i < srq->max - 1 ? i + 1 : -1; for (scatter = (struct mthca_data_seg *)(wqe + sizeof (struct mthca_next_seg)); - (void *) scatter < (void*)(wqe + (1 << srq->wqe_shift)); + (void *) scatter < (void*)(wqe + (uint32_t)(1 << srq->wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } @@ -710,7 +710,7 @@ int mthca_max_srq_sge(struct mthca_dev *dev) * the FW max_sg value returned. */ return min( (uint32_t)dev->limits.max_sg, - ((1 << (fls(dev->limits.max_desc_sz) - 1)) - + ((uint32_t)(1 << (fls(dev->limits.max_desc_sz) - 1)) - sizeof (struct mthca_next_seg)) / sizeof (struct mthca_data_seg)); } diff --git a/branches/winverbs/hw/mthca/user/SOURCES b/branches/winverbs/hw/mthca/user/SOURCES index 92f6c653..55a9619c 100644 --- a/branches/winverbs/hw/mthca/user/SOURCES +++ b/branches/winverbs/hw/mthca/user/SOURCES @@ -8,7 +8,14 @@ TARGETNAME=mthcaud TARGETPATH=$(TRUNK)\bin\user\obj$(BUILD_ALT_DIR) TARGETTYPE=DYNLINK -DLLDEF=$(O)\mlnx_uvp.def +!if $(_NT_TOOLS_VERSION) == 0x700 +# DDK +DLLDEF=$O\mlnx_uvp.def +!else +# WDK +DLLDEF=$(OBJ_PATH)\$O\mlnx_uvp.def +!endif +#USE_NTDLL=1 USE_MSVCRT=1 DLLENTRY=DllMain diff --git a/branches/winverbs/hw/mthca/user/mlnx_uvp_qp.c b/branches/winverbs/hw/mthca/user/mlnx_uvp_qp.c index f5bfe59c..f8b17256 100644 --- a/branches/winverbs/hw/mthca/user/mlnx_uvp_qp.c +++ b/branches/winverbs/hw/mthca/user/mlnx_uvp_qp.c @@ -988,7 +988,7 @@ int mthca_alloc_qp_buf(struct ibv_pd *pd, struct ibv_qp_cap *cap, next->ee_nds = sz; for (scatter = (void *) (next + 1); - (void *) scatter < (void *) ((char *)next + (1 << qp->rq.wqe_shift)); + (void *) scatter < (void *) ((char *)next + (uint32_t)(1 << qp->rq.wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } diff --git a/branches/winverbs/hw/mthca/user/mlnx_uvp_srq.c b/branches/winverbs/hw/mthca/user/mlnx_uvp_srq.c index e29bbd3c..061f2d8b 100644 --- a/branches/winverbs/hw/mthca/user/mlnx_uvp_srq.c +++ b/branches/winverbs/hw/mthca/user/mlnx_uvp_srq.c @@ -313,7 +313,7 @@ int mthca_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr, *wqe_to_link(wqe) = i < srq->max - 1 ? i + 1 : -1; for (scatter = (struct mthca_data_seg *)(wqe + sizeof (struct mthca_next_seg)); - (void *) scatter < (void*)(wqe + (1 << srq->wqe_shift)); + (void *) scatter < (void*)(wqe + (uint32_t)(1 << srq->wqe_shift)); ++scatter) scatter->lkey = cl_hton32(MTHCA_INVAL_LKEY); } -- 2.41.0