[MTHCA] feature: enable working with MAP_FMR on DISPATCH level
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 4 Sep 2006 06:20:51 +0000 (06:20 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 4 Sep 2006 06:20:51 +0000 (06:20 +0000)
bugfix: return rkey in network order for map_phys_fmr verb
Arbel: call rearm on all EQ's each time.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@479 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/hca_memory.c
hw/mthca/kernel/mthca_dev.h
hw/mthca/kernel/mthca_eq.c

index 5b9e196..2e65fbe 100644 (file)
@@ -396,13 +396,6 @@ mlnx_map_phys_fmr (
 \r
        HCA_ENTER(HCA_DBG_MEMORY);\r
 \r
-       // sanity checks\r
-       if( !cl_is_blockable() ) {\r
-                       status = IB_UNSUPPORTED;\r
-                       goto err_unsupported;\r
-       } \r
-\r
-       \r
        // mapping      \r
        err = ibv_map_phys_fmr(ib_fmr, (u64*)page_list, list_len, (uint64_t)(ULONG_PTR)vaddr);\r
        if (err) {\r
@@ -415,12 +408,11 @@ mlnx_map_phys_fmr (
        // return the results\r
        *p_vaddr = vaddr;\r
        *p_lkey = ib_fmr->lkey;\r
-       *p_rkey = ib_fmr->rkey;\r
+       *p_rkey = cl_hton32( ib_fmr->rkey );\r
        \r
        status = IB_SUCCESS;\r
        \r
 err_dealloc_fmr:\r
-err_unsupported:\r
        HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
                ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
        return status;\r
index 4d437b5..7762cfc 100644 (file)
@@ -280,6 +280,7 @@ struct mthca_dev {
        struct ib_device  ib_dev;
        hca_dev_ext_t *ext;
        uplink_info_t uplink_info;
+       volatile long    dpc_lock;
 
        int              hca_type;
        unsigned long    mthca_flags;
index 52ae5b6..db51afc 100644 (file)
@@ -410,7 +410,7 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq)
 
                set_eqe_hw(eqe);
                ++eq->cons_index;
-               eqes_found = 1;
+               eqes_found += 1;
                ++set_ci;
 
                /*
@@ -545,7 +545,12 @@ static BOOLEAN mthca_arbel_interrupt(
        for (i = 0; i < MTHCA_NUM_EQ; ++i) {
                if (next_eqe_sw( &dev->eq_table.eq[i]) ) {
                        work = 1;
+                       while(InterlockedCompareExchange(&dev->dpc_lock, 1, 0));
+                       
                        KeInsertQueueDpc(&dev->eq_table.eq[i].dpc, NULL, NULL);
+                       InterlockedCompareExchange(&dev->dpc_lock, 0, 1);
+               } else {
+                       arbel_eq_req_not(dev, dev->eq_table.eq[i].eqn_mask);
                }
        }
 
@@ -974,6 +979,7 @@ int mthca_init_eq_table(struct mthca_dev *dev)
                        dev->eq_table.eq[i].have_irq = 1;
                        /* init DPC stuff something like that */
                        spin_lock_init( &dev->eq_table.eq[i].lock );    
+                       dev->dpc_lock = 0;
                        KeInitializeDpc(
                                &dev->eq_table.eq[i].dpc,
                                mthca_is_memfree(dev) ?