[ofw] patch: Remove livefish support from mthca

Tzachi Dar tzachid at mellanox.co.il
Tue Aug 31 02:02:11 PDT 2010


--- hw/mthca/kernel/hca_data.h             Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/hca_data.h          Mon Jun 28 10:52:26 2010
@@ -28,7 +28,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: hca_data.h 1630 2008-10-05 19:29:40Z leonidk $
+ * $Id: hca_data.h 5526 2010-02-03 10:10:56Z leonid $
  */

 #ifndef __HCA_DATA_H__
@@ -239,7 +239,6 @@
 void
 setup_ci_interface(
                IN                           const     ib_net64_t                                                                          ca_guid,
-              IN                           const     int                                                                                                           is_livefish,
                                OUT                                       ci_interface_t                                                    *p_interface );

 void
@@ -324,10 +323,6 @@

 void
 mlnx_memory_if(
-              IN           OUT                                       ci_interface_t                                                    *p_interface );
-
-void
-mlnx_memory_if_livefish(
                IN           OUT                                       ci_interface_t                                                    *p_interface );

 void
--- hw/mthca/kernel/hca_memory.c      Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/hca_memory.c   Mon Jun 28 10:52:26 2010
@@ -28,7 +28,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: hca_memory.c 2019 2009-03-09 08:36:31Z leonidk $
+ * $Id: hca_memory.c 5526 2010-02-03 10:10:56Z leonid $
  */


@@ -136,17 +136,6 @@

                HCA_ENTER(HCA_DBG_MEMORY);

-              if (mthca_is_livefish(to_mdev(ib_pd_p->device))) {
-                              mr_p = kzalloc(sizeof *mr_p, GFP_KERNEL);
-                              if (!mr_p) {
-                                              status = IB_INSUFFICIENT_MEMORY;
-                                              goto err_mem;
-                              }
-                              mr_p->device = ib_pd_p->device;
-                              mr_p->pd = ib_pd_p;
-                              goto done;
-              }
-
                // sanity checks
                if( !cl_is_blockable() ) {
                                status = IB_UNSUPPORTED;
@@ -181,7 +170,6 @@
                }

                // results
-done:
                if (ph_mr)           *ph_mr = (ib_mr_handle_t)mr_p;
                *p_lkey = mr_p->lkey;
                *p_rkey = cl_hton32( mr_p->rkey );
@@ -191,7 +179,6 @@
 err_reg_phys_mr:
 err_invalid_parm:
 err_unsupported:
-err_mem:
                if (status != IB_SUCCESS)
                {
                                HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,
@@ -288,15 +275,9 @@
 {
                ib_api_status_t                status;
                int err;
-              struct ib_mr *ib_mr = (struct ib_mr *)h_mr;

                HCA_ENTER(HCA_DBG_SHIM);

-              if (mthca_is_livefish(to_mdev(ib_mr->device))) {
-                              kfree(ib_mr);
-                              goto done;
-              }
-
                // sanity checks
                if( !cl_is_blockable() ) {
                                                status = IB_UNSUPPORTED;
@@ -312,7 +293,6 @@
                                goto err_dereg_mr;
                }

-done:
                status = IB_SUCCESS;

 err_dereg_mr:
@@ -589,13 +569,4 @@
                p_interface->query_mw = mlnx_query_mw;
                p_interface->destroy_mw = mlnx_destroy_mw;
 }
-
-void
-mlnx_memory_if_livefish(
-              IN           OUT                                       ci_interface_t                                                    *p_interface )
-{
-              p_interface->register_pmr = mlnx_register_pmr;
-              p_interface->deregister_mr = mlnx_deregister_mr;
-}
-

--- hw/mthca/kernel/hca_pnp.c               Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/hca_pnp.c            Mon Jun 28 10:52:26 2010
@@ -238,9 +238,7 @@
                                return NULL;
                }

-              setup_ci_interface( p_ext->hca.guid,
-                              !!mthca_is_livefish(p_ext->hca.mdev),
-                              pIfc );
+             setup_ci_interface( p_ext->hca.guid, pIfc );

                pIfc->p_hca_obj = &p_ext->hca.hob;
                pIfc->vend_id = (uint32_t)p_ext->hcaConfig.VendorID;
@@ -276,10 +274,6 @@

                HCA_ENTER( HCA_DBG_PNP );

-              // there will be no resources for "livefish" (PCI memory controller mode)
-              if (!pHcaResList || !pHostResList)
-                              goto done;
-
                p_ext = (hca_dev_ext_t*)p_dev_obj->DeviceExtension;

                // store the bus number for reset of Tavor
@@ -304,16 +298,16 @@
                                if( pHcaRes->Type == CmResourceTypeInterrupt )
                                {
                                                p_ext->interruptInfo = *pHostRes;
-            if ( g_processor_affinity == 0xFFFFFFFF )
+                                             if ( g_processor_affinity == 0xFFFFFFFF )
                                                {
-                                                              /*
+                                                             /*
                                                                 * Calculate the mask of the last processor
                                                                 */
                                                                KAFFINITY                           n_active_processors_bitmask;
                                                                uint32_t                               last_processor_mask = 0 , tmp_processor_mask = 1;

                                                                n_active_processors_bitmask = KeQueryActiveProcessors();
-                while ( tmp_processor_mask & n_active_processors_bitmask )
+                                                             while ( tmp_processor_mask & n_active_processors_bitmask )
                                                                {
                                                                                                last_processor_mask = tmp_processor_mask;
                                                                                                tmp_processor_mask = tmp_processor_mask << 1;
@@ -383,7 +377,6 @@
                                status = STATUS_UNSUCCESSFUL;
                }

-done:
                HCA_EXIT( HCA_DBG_PNP );
                return status;
 }
@@ -413,14 +406,6 @@
 }


-static int mthca_get_livefish_info(struct mthca_dev *mdev, __be64 *node_guid, u32 *hw_id)
-{
-              *node_guid = cl_hton64((uint64_t)(ULONG_PTR)mdev);
-              mdev->ib_dev.node_guid = *node_guid;
-              *hw_id = 0;
-              return 0;
-}
-
 static NTSTATUS
 hca_start(
                IN                                                           DEVICE_OBJECT* const                 p_dev_obj,
@@ -432,6 +417,7 @@
                IO_STACK_LOCATION    *pIoStack;
                POWER_STATE                                  powerState;
                DEVICE_DESCRIPTION   devDesc;
+             int                                                                           err;

                HCA_ENTER( HCA_DBG_PNP );

@@ -504,21 +490,13 @@
                                return status;
                }

-              /*leo: get node GUID */
-              {
-                              int err;
-                              if (mthca_is_livefish(p_ext->hca.mdev))
-                                              err = mthca_get_livefish_info( p_ext->hca.mdev, &p_ext->hca.guid, &p_ext->hca.hw_ver );
-                              else
-                                              err = mthca_get_dev_info( p_ext->hca.mdev, &p_ext->hca.guid, &p_ext->hca.hw_ver );
-
-                              if (err) {
-
-                                              //TODO: no cleanup on error
-                                              HCA_PRINT( TRACE_LEVEL_ERROR,HCA_DBG_PNP,
-                                                              ("can't get guid - mthca_query_port()"));
-                                              return STATUS_INSUFFICIENT_RESOURCES;
-                              }
+             err = mthca_get_dev_info( p_ext->hca.mdev, &p_ext->hca.guid, &p_ext->hca.hw_ver );
+             if (err) {
+
+                             //TODO: no cleanup on error
+                             HCA_PRINT( TRACE_LEVEL_ERROR,HCA_DBG_PNP,
+                                             ("can't get guid - mthca_query_port()"));
+                             return STATUS_INSUFFICIENT_RESOURCES;
                }

                /* queue HCA  */
@@ -549,8 +527,7 @@
                                                DRV_VERSION, DRV_RELDATE
                                                ));
                                HCA_PRINT_EV(TRACE_LEVEL_INFORMATION ,HCA_DBG_LOW ,
-                                              ("Flags %s%s%s%s%s%s%s\n",
-                                              (mdev->mthca_flags & MTHCA_FLAG_LIVEFISH) ? "Flash Recovery Mode:" : "",
+                                             ("Flags %s%s%s%s%s%s\n",
                                                (mdev->mthca_flags & MTHCA_FLAG_MEMFREE) ? "MemFree:" : "",
                                                (mdev->mthca_flags & MTHCA_FLAG_NO_LAM) ? "NoLam:" : "",
                                                (mdev->mthca_flags & MTHCA_FLAG_FMR) ? "Fmr:" : "",
--- hw/mthca/kernel/hca_verbs.c            Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/hca_verbs.c         Mon Jun 28 10:52:26 2010
@@ -28,7 +28,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: hca_verbs.c 2166 2009-05-12 13:24:37Z leonidk $
+ * $Id: hca_verbs.c 5526 2010-02-03 10:10:56Z leonid $
  */


@@ -85,24 +85,20 @@

                ib_dev = &p_hca->mdev->ib_dev;

-              if (mthca_is_livefish(p_hca->mdev))
-                              goto done;
-
                HCA_PRINT(TRACE_LEVEL_INFORMATION  ,HCA_DBG_SHIM,
                                ("context 0x%p\n", ca_context));
                if (pfn_async_event_cb) {
-                              status = mlnx_hobs_set_cb(&p_hca->hob,
-                                              pfn_async_event_cb,
-                                              ca_context);
-                              if (IB_SUCCESS != status) {
-                                              goto err_set_cb;
-                              }
+             status = mlnx_hobs_set_cb(&p_hca->hob,
+                             pfn_async_event_cb,
+                             ca_context);
+             if (IB_SUCCESS != status) {
+                             goto err_set_cb;
+             }
                }

                //TODO: do we need something for kernel users ?

                // Return pointer to HOB object
-done:
                if (ph_ca) *ph_ca = &p_hca->hob;
                status =  IB_SUCCESS;

@@ -417,17 +413,9 @@
 mlnx_close_ca (
                IN                                                           ib_ca_handle_t                                                                h_ca)
 {
-              mlnx_hob_t                                       *hob_p = (mlnx_hob_t *)h_ca;
                HCA_ENTER(HCA_DBG_SHIM);
-
-              if (mthca_is_livefish(MDEV_FROM_HOB( hob_p )))
-                              goto done;
-
                mlnx_hobs_remove(h_ca);
-
-done:
                HCA_EXIT(HCA_DBG_SHIM);
-
                return IB_SUCCESS;
 }

@@ -541,10 +529,7 @@
                mlnx_hob_t                                       *hob_p = (mlnx_hob_t *)h_ca;
                hca_dev_ext_t *ext_p = EXT_FROM_HOB( hob_p );

-              if (mthca_is_livefish(to_mdev(p_ucontext->device)))
-                              goto done;
                unmap_crspace_for_all(p_ucontext);
-done:
                cl_spinlock_acquire( &ext_p->uctx_lock );
                cl_qlist_remove_item( &ext_p->uctx_list, &p_ucontext->list_item );
                cl_atomic_dec(&ext_p->usecnt);
@@ -931,7 +916,7 @@
                ib_api_status_t                status = IB_SUCCESS;
                struct ib_srq *ib_srq = (struct ib_srq *)h_srq;
                UNUSED_PARAM(p_umv_buf);
-
+
                HCA_ENTER(HCA_DBG_SRQ);

                err = ibv_modify_srq(ib_srq, (void*)p_srq_attr, srq_attr_mask);
@@ -1649,7 +1634,6 @@
 void
 setup_ci_interface(
                IN                           const     ib_net64_t                                                                          ca_guid,
-              IN                           const     int                                                                                                           is_livefish,
                IN           OUT                                       ci_interface_t                                                    *p_interface )
 {
                cl_memclr(p_interface, sizeof(*p_interface));
@@ -1667,6 +1651,7 @@

                /* The real interface. */
                p_interface->open_ca = mlnx_open_ca;
+             p_interface->modify_ca = mlnx_modify_ca;
                p_interface->query_ca = mlnx_query_ca;
                p_interface->close_ca = mlnx_close_ca;
                p_interface->um_open_ca = mlnx_um_open;
@@ -1678,41 +1663,34 @@
                p_interface->deallocate_pd = mlnx_deallocate_pd;
                p_interface->vendor_call = fw_access_ctrl;

-              if (is_livefish) {
-                              mlnx_memory_if_livefish(p_interface);
-              }
-              else {
-                              p_interface->modify_ca = mlnx_modify_ca;
-
-                              p_interface->create_av = mlnx_create_av;
-                              p_interface->query_av = mlnx_query_av;
-                              p_interface->modify_av = mlnx_modify_av;
-                              p_interface->destroy_av = mlnx_destroy_av;
-
-                              p_interface->create_srq = mlnx_create_srq;
-                              p_interface->modify_srq = mlnx_modify_srq;
-                              p_interface->query_srq = mlnx_query_srq;
-                              p_interface->destroy_srq = mlnx_destroy_srq;
-
-                              p_interface->create_qp = mlnx_create_qp;
-                              p_interface->create_spl_qp = mlnx_create_spl_qp;
-                              p_interface->modify_qp = mlnx_modify_qp;
-                              p_interface->ndi_modify_qp = mlnx_ndi_modify_qp;
-                              p_interface->query_qp = mlnx_query_qp;
-                              p_interface->destroy_qp = mlnx_destroy_qp;
-
-                              p_interface->create_cq = mlnx_create_cq;
-                              p_interface->resize_cq = mlnx_resize_cq;
-                              p_interface->query_cq = mlnx_query_cq;
-                              p_interface->destroy_cq = mlnx_destroy_cq;
-
-                              p_interface->local_mad = mlnx_local_mad;
-
-
-                              mlnx_memory_if(p_interface);
-                              mlnx_direct_if(p_interface);
-                              mlnx_mcast_if(p_interface);
-              }
+             p_interface->create_av = mlnx_create_av;
+             p_interface->query_av = mlnx_query_av;
+             p_interface->modify_av = mlnx_modify_av;
+             p_interface->destroy_av = mlnx_destroy_av;
+
+             p_interface->create_srq = mlnx_create_srq;
+             p_interface->modify_srq = mlnx_modify_srq;
+             p_interface->query_srq = mlnx_query_srq;
+             p_interface->destroy_srq = mlnx_destroy_srq;
+
+             p_interface->create_qp = mlnx_create_qp;
+             p_interface->create_spl_qp = mlnx_create_spl_qp;
+             p_interface->modify_qp = mlnx_modify_qp;
+             p_interface->ndi_modify_qp = mlnx_ndi_modify_qp;
+             p_interface->query_qp = mlnx_query_qp;
+             p_interface->destroy_qp = mlnx_destroy_qp;
+
+             p_interface->create_cq = mlnx_create_cq;
+             p_interface->resize_cq = mlnx_resize_cq;
+             p_interface->query_cq = mlnx_query_cq;
+             p_interface->destroy_cq = mlnx_destroy_cq;
+
+             p_interface->local_mad = mlnx_local_mad;
+
+
+             mlnx_memory_if(p_interface);
+             mlnx_direct_if(p_interface);
+             mlnx_mcast_if(p_interface);

                return;
 }
--- hw/mthca/kernel/mt_memory.h      Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mt_memory.h   Mon Jun 28 10:52:26 2010
@@ -52,13 +52,13 @@
                MT_ASSERT( KeGetCurrentIrql() <= DISPATCH_LEVEL );
                switch (gfp_mask) {
                                case GFP_ATOMIC:
-                                              ptr = ExAllocatePoolWithTag( NonPagedPool, bsize, MT_TAG_ATOMIC );
+                                             ptr = ExAllocatePoolWithTagSafeEx( NonPagedPool, bsize, MT_TAG_ATOMIC );
                                                break;
                                case GFP_KERNEL:
-                                              ptr = ExAllocatePoolWithTag( NonPagedPool, bsize, MT_TAG_KERNEL );
+                                             ptr = ExAllocatePoolWithTagSafeEx( NonPagedPool, bsize, MT_TAG_KERNEL );
                                                break;
                                case GFP_HIGHUSER:
-                                              ptr = ExAllocatePoolWithTag( NonPagedPool, bsize, MT_TAG_HIGH );
+                                             ptr = ExAllocatePoolWithTagSafeEx( NonPagedPool, bsize, MT_TAG_HIGH );
                                                break;
                                default:
                                                cl_dbg_out("kmalloc: unsupported flag %d\n", gfp_mask);
--- hw/mthca/kernel/mt_verbs.c             Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mt_verbs.c          Mon Jun 28 10:52:26 2010
@@ -33,7 +33,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: mt_verbs.c 1435 2008-07-23 20:09:45Z shefty $
+ * $Id: mt_verbs.c 5526 2010-02-03 10:10:56Z leonid $
  */

 #include <ib_verbs.h>
@@ -123,9 +123,6 @@

 int ibv_dealloc_pd(struct ib_pd *pd)
 {
-              if (mthca_is_livefish(to_mdev(pd->device)))
-                              goto done;
-
                // we need first to release list of AV MRs to decrease pd->usecnt
                if (pd->ucontext) {
                                struct ib_mr *ib_mr, *tmp;
@@ -141,7 +138,6 @@
                                return -EBUSY;
                }

-done:
                HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("PD%d use cnt %d, pd_handle %p, ctx %p \n",
                                ((struct mthca_pd*)pd)->pd_num, pd->usecnt, pd, pd->ucontext));
                // direct call is a must, because "lifefish" devices doesn't fill driver i/f table
--- hw/mthca/kernel/mthca.inx                Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mthca.inx             Tue Aug 31 11:59:17 2010
@@ -122,36 +122,24 @@

 [HCA.DeviceSection.ntx86]
 %MT23108.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A44
-%MT23109.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A45
 %MT25208.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6278
-%MT25209.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6279
 %MT25218.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6282
 %MT24204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8C
-%MT24205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8D
 %MT25204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6274
-%MT25205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6275

 [HCA.DeviceSection.ntamd64]
 %MT23108.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A44
-%MT23109.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A45
 %MT25208.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6278
-%MT25209.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6279
 %MT25218.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6282
 %MT24204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8C
-%MT24205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8D
 %MT25204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6274
-%MT25205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6275

 [HCA.DeviceSection.ntia64]
 %MT23108.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A44
-%MT23109.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5A45
 %MT25208.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6278
-%MT25209.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6279
 %MT25218.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6282
 %MT24204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8C
-%MT24205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_5E8D
 %MT25204.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6274
-%MT25205.DeviceDesc%=MTHCA.DDInstall, PCI\VEN_15B3&DEV_6275

 [MTHCA.DDInstall.ntx86]
 CopyFiles = MTHCA.CopyFiles
@@ -449,14 +437,10 @@
 MTL="Mellanox Technologies Ltd."
 MTHCA.ServiceDesc = "Driver for Mellanox InfiniHost Devices"
 MT23108.DeviceDesc="InfiniHost (MT23108) - Mellanox InfiniBand HCA"
-MT23109.DeviceDesc="InfiniHost (MT23109) - Mellanox InfiniBand HCA (burner device)"
 MT25208.DeviceDesc="InfiniHost (MT25208) - Mellanox InfiniBand HCA for PCI Express"
-MT25209.DeviceDesc="InfiniHost (MT25209) - Mellanox InfiniBand HCA for PCI Express (burner device)"
 MT25218.DeviceDesc="InfiniHost III Ex (MT25218) - Mellanox InfiniBand HCA for PCI Express"
 MT24204.DeviceDesc="InfiniHost III Lx (MT24204) - Mellanox InfiniBand HCA for PCI Express"
-MT24205.DeviceDesc="InfiniHost III Lx (MT24205) - Mellanox InfiniBand HCA for PCI Express (burner device)"
 MT25204.DeviceDesc="InfiniHost III Lx (MT25204) - Mellanox InfiniBand HCA for PCI Express"
-MT25205.DeviceDesc="InfiniHost III Lx (MT25205) - Mellanox InfiniBand HCA for PCI Express (burner device)"
 DiskId = "Mellanox InfiniBand HCA installation disk"
 Ibbus.ServiceDesc = "InfiniBand Bus/AL (Filter Driver)"
 WinVerbs.ServiceDesc = "WinVerbs Service"
--- hw/mthca/kernel/mthca_dev.h         Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mthca_dev.h      Mon Jun 28 10:52:26 2010
@@ -34,7 +34,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: mthca_dev.h 1942 2009-02-11 10:49:02Z tzachid $
+ * $Id: mthca_dev.h 5526 2010-02-03 10:10:56Z leonid $
  */

 #ifndef MTHCA_DEV_H
@@ -64,7 +64,6 @@
                MTHCA_FLAG_MEMFREE    = 1 << 7,
                MTHCA_FLAG_PCIE          = 1 << 8,
                MTHCA_FLAG_SINAI_OPT  = 1 << 9,
-              MTHCA_FLAG_LIVEFISH   = 1 << 10
 };

 enum {
@@ -594,15 +593,6 @@
                ULONG pi_nDataItems,
                ...
                );
-
-
-static inline int mthca_is_livefish(struct mthca_dev *mdev)
-{
-              if(mdev == NULL) {
-                              return TRUE;
-              }
-              return mdev->mthca_flags & MTHCA_FLAG_LIVEFISH;
-}

 void mthca_get_av_params(     struct mthca_ah *ah_p, u8 *port_num, __be16 *dlid, u8 *sr, u8 *path_bits );

--- hw/mthca/kernel/mthca_main.c       Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mthca_main.c    Mon Jun 28 10:52:26 2010
@@ -31,7 +31,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: mthca_main.c 2142 2009-05-03 09:32:01Z leonidk $
+ * $Id: mthca_main.c 5526 2010-02-03 10:10:56Z leonid $
  */

 #include "mthca_dev.h"
@@ -69,8 +69,7 @@
                TAVOR,                                                /* MT23108                        */
                ARBEL_COMPAT,                             /* MT25208 in Tavor compat mode   */
                ARBEL_NATIVE,                                /* MT25218 with extended features */
-              SINAI,                                   /* MT25204 */
-              LIVEFISH                              /* a burning device */
+             SINAI                                     /* MT25204 */
 };

 #define MTHCA_FW_VER(major, minor, subminor) \
@@ -85,8 +84,7 @@
                { MTHCA_FW_VER(3, 3, 2), MTHCA_FW_VER(3, 5, 0), 0, 0 },         /* TAVOR */
                { MTHCA_FW_VER(4, 7, 0), MTHCA_FW_VER(4, 8, 200), 0, 1 },    /* ARBEL_COMPAT */
                { MTHCA_FW_VER(5, 1, 0), MTHCA_FW_VER(5, 3, 0), 1, 1 },         /* ARBEL_NATIVE */
-              { MTHCA_FW_VER(1, 0, 800), MTHCA_FW_VER(1, 2, 0), 1, 1 },    /* SINAI */
-              { MTHCA_FW_VER(0, 0, 0), MTHCA_FW_VER(0, 0, 0), 0, 0 }                          /* LIVEFISH */
+             { MTHCA_FW_VER(1, 0, 800), MTHCA_FW_VER(1, 2, 0), 1, 1 }      /* SINAI */
 };


@@ -108,15 +106,6 @@
                HCA(TOPSPIN,  ARBEL,      ARBEL_NATIVE),
                HCA(TOPSPIN,  SINAI_OLD,    SINAI),
                HCA(TOPSPIN,  SINAI,        SINAI),
-              // live fishes
-              HCA(MELLANOX, TAVOR_BD,    LIVEFISH),
-              HCA(MELLANOX, ARBEL_BD,                      LIVEFISH),
-              HCA(MELLANOX, SINAI_OLD_BD,            LIVEFISH),
-              HCA(MELLANOX, SINAI_BD,                       LIVEFISH),
-              HCA(TOPSPIN, TAVOR_BD,                         LIVEFISH),
-              HCA(TOPSPIN, ARBEL_BD,                           LIVEFISH),
-              HCA(TOPSPIN, SINAI_OLD_BD, LIVEFISH),
-              HCA(TOPSPIN, SINAI_BD,                            LIVEFISH),
 };
 #define MTHCA_PCI_TABLE_SIZE (sizeof(mthca_pci_table)/sizeof(struct pci_device_id))

@@ -967,7 +956,6 @@
                InitializeListHead(&ext->hca.hob.event_list);
                KeInitializeSpinLock(&ext->hca.hob.event_list_lock);

-run_as_livefish:
                /* allocate mdev structure */
                mdev = kzalloc(sizeof *mdev, GFP_KERNEL);
                if (!mdev) {
@@ -982,10 +970,6 @@
                mdev->ext = ext;                             /* pointer to DEVICE OBJECT extension */
                mdev->hca_type = p_id->driver_data;
                mdev->ib_dev.mdev = mdev;
-              if (p_id->driver_data == LIVEFISH)
-                              mdev->mthca_flags |= MTHCA_FLAG_LIVEFISH;
-              if (mthca_is_livefish(mdev))
-                              goto done;
                if (ext->hca_hidden)
                                mdev->mthca_flags |= MTHCA_FLAG_DDR_HIDDEN;
                if (mthca_hca_table[p_id->driver_data].is_memfree)
@@ -1042,7 +1026,6 @@
                                goto err_cleanup;
                }

-              done:
                ext->hca.mdev = mdev;
                mdev->state = MTHCA_DEV_INITIALIZED;
                return 0;
@@ -1071,20 +1054,6 @@
 err_free_dev:
                kfree(mdev);

-              /* we failed device initialization - try to simulate "livefish" device to facilitate using FW burning tools */
-              {
-                              USHORT dev_id = ext->hcaConfig.DeviceID;
-
-                              if (dev_id == PCI_DEVICE_ID_MELLANOX_ARBEL)
-                                              dev_id = PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT;
-                              p_id = mthca_find_pci_dev( (unsigned)ext->hcaConfig.VendorID, dev_id + 1 );
-                              if (p_id == NULL) {
-                                              status = STATUS_NO_SUCH_DEVICE;
-                                              goto end;
-                              }
-                              goto run_as_livefish;
-              }
-
 end:
                return status;
 }
@@ -1098,8 +1067,6 @@
                ext->hca.mdev = NULL;
                if (mdev) {
                                mdev->state = MTHCA_DEV_UNINITIALIZED;
-                              if (mthca_is_livefish(mdev))
-                                              goto done;
                                mthca_unregister_device(mdev);

                                for (p = 1; p <= mdev->limits.num_ports; ++p)
@@ -1120,7 +1087,6 @@
                                mthca_cleanup_uar_table(mdev);
                                mthca_close_hca(mdev);
                                mthca_cmd_cleanup(mdev);
-done:
                                kfree(mdev);
                }
 }
--- hw/mthca/kernel/mthca_provider.c                Tue Apr 27 18:49:06 2010
+++ hw/mthca/kernel/mthca_provider.c             Mon Jun 28 10:52:26 2010
@@ -31,7 +31,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: mthca_provider.c 2033 2009-03-17 16:05:55Z stansmith $
+ * $Id: mthca_provider.c 5526 2010-02-03 10:10:56Z leonid $
  */

 #include <ib_smi.h>
@@ -69,15 +69,6 @@

                RtlZeroMemory(props, sizeof *props);

-              if (mthca_is_livefish(mdev)) {
-                              props->max_pd = 1;
-                              if ( !mdev || !mdev->ext )
-                                              return err;
-                              props->vendor_id = mdev->ext->hcaConfig.VendorID;
-                              props->vendor_part_id = mdev->ext->hcaConfig.DeviceID;
-                              return 0;
-              }
-
                in_mad  = kzalloc(sizeof *in_mad, GFP_KERNEL);
                out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
                if (!in_mad || !out_mad)
@@ -354,9 +345,6 @@
                                goto err_nomem;
                }

-              if (mthca_is_livefish(to_mdev(ibdev)))
-                              goto done;
-
                err = mthca_uar_alloc(to_mdev(ibdev), &context->uar);
                if (err)
                                goto err_uar_alloc;
@@ -399,7 +387,6 @@
                                goto err_init_user;
                }

-done:
                err = ib_copy_to_umv_buf(p_umv_buf, &uresp, sizeof uresp);
                if (err)
                                goto err_copy_to_umv_buf;
@@ -428,17 +415,14 @@

  int mthca_dealloc_ucontext(struct ib_ucontext *context)
 {
-              struct mthca_ucontext                 *mucontext = to_mucontext(context);
+             struct mthca_ucontext                  *mucontext = to_mucontext(context);

-              if (mthca_is_livefish(to_mdev(context->device)))
-                              goto done;
                mthca_cleanup_user_db_tab(to_mdev(context->device), &mucontext->uar,
-                                                                mucontext->db_tab);
+                             mucontext->db_tab);
                MmUnmapLockedPages( mucontext->ibucontext.user_uar, mucontext->mdl );
                IoFreeMdl(mucontext->mdl);
                iounmap(mucontext->kva, PAGE_SIZE);
                mthca_uar_free(to_mdev(context->device), &mucontext->uar);
-done:
                kfree(mucontext);

                return 0;
@@ -466,15 +450,11 @@
                                goto err_mem;
                }

-              if (mthca_is_livefish(to_mdev(ibdev)))
-                              goto done;
-
                err = mthca_pd_alloc(to_mdev(ibdev), !context, pd);
                if (err) {
                                goto err_pd_alloc;
                }

-done:
                if (p_umv_buf && p_umv_buf->command) {
                                resp.pd_handle = (u64)(UINT_PTR)pd;
                                resp.pdn = pd->pd_num;
@@ -497,12 +477,7 @@

 int mthca_dealloc_pd(struct ib_pd *pd)
 {
-              if (mthca_is_livefish(to_mdev(pd->device)))
-                              goto done;
-
                mthca_pd_free(to_mdev(pd->device), to_mpd(pd));
-
-done:
                kfree(pd);
                return 0;
 }
--- hw/mthca/user/mlnx_uvp.c                Tue Apr 27 18:49:27 2010
+++ hw/mthca/user/mlnx_uvp.c             Mon Jun 28 10:52:27 2010
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: mlnx_uvp.c 593 2007-02-15 07:39:49Z sleybo $
+ * $Id: mlnx_uvp.c 5526 2010-02-03 10:10:56Z leonid $
  */

 #include "mt_l2w.h"
@@ -71,23 +71,6 @@
 #define PCI_VENDOR_ID_TOPSPIN                                       0x1867
 #endif

-/* live fishes */
-#ifndef PCI_DEVICE_ID_MELLANOX_TAVOR_BD
-#define PCI_DEVICE_ID_MELLANOX_TAVOR_BD                           0x5a45
-#endif
-
-#ifndef PCI_DEVICE_ID_MELLANOX_ARBEL_BD
-#define PCI_DEVICE_ID_MELLANOX_ARBEL_BD                             0x6279
-#endif
-
-#ifndef PCI_DEVICE_ID_MELLANOX_SINAI_OLD_BD
-#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD_BD   0x5e8d
-#endif
-
-#ifndef PCI_DEVICE_ID_MELLANOX_SINAI_BD
-#define PCI_DEVICE_ID_MELLANOX_SINAI_BD                              0x6275
-#endif
-

 #define HCA(v, d, t) \
                { PCI_VENDOR_ID_##v,                PCI_DEVICE_ID_MELLANOX_##d, MTHCA_##t }
@@ -107,15 +90,6 @@
                HCA( TOPSPIN,                                 ARBEL,                                                                  ARBEL),
                HCA( TOPSPIN,                                 SINAI_OLD,                                        ARBEL),
                HCA( TOPSPIN,                                 SINAI,                                                                   ARBEL),
-              // live fishes
-              HCA(MELLANOX, TAVOR_BD, LIVEFISH),
-              HCA(MELLANOX, ARBEL_BD,      LIVEFISH),
-              HCA(MELLANOX, SINAI_OLD_BD, LIVEFISH),
-              HCA(MELLANOX, SINAI_BD,       LIVEFISH),
-              HCA(TOPSPIN, TAVOR_BD,                         LIVEFISH),
-              HCA(TOPSPIN, ARBEL_BD,                           LIVEFISH),
-              HCA(TOPSPIN, SINAI_OLD_BD, LIVEFISH),
-              HCA(TOPSPIN, SINAI_BD,                            LIVEFISH),
 };

 static struct ibv_context_ops mthca_ctx_ops = {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100831/72d84b20/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mthca_livefish.diff
Type: application/octet-stream
Size: 23759 bytes
Desc: mthca_livefish.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100831/72d84b20/attachment.obj>


More information about the ofw mailing list