[IPoIB, IBBUS] Report port number in IPoIB parameters
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 14 Dec 2005 19:51:03 +0000 (19:51 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 14 Dec 2005 19:51:03 +0000 (19:51 +0000)
rather than extracting from port GUID.

Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
Signed-off-by: Fab Tillier (ftillie@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@204 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_port_mgr.c
inc/kernel/iba/ipoib_ifc.h
ulp/ipoib/kernel/ipoib_adapter.c
ulp/ipoib/kernel/ipoib_adapter.h
ulp/ipoib/kernel/ipoib_driver.c

index 14a3729..9e276e0 100644 (file)
@@ -1187,6 +1187,7 @@ port_query_ipoib_ifc(
 \r
        p_ipoib_data->ca_guid = p_ext->pdo.h_ca->obj.p_ci_ca->verbs.guid;\r
        p_ipoib_data->port_guid = p_ext->port_guid;\r
+       p_ipoib_data->port_num = (uint8_t)p_ext->n_port;\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
        return STATUS_SUCCESS;\r
index d723b82..f680f77 100644 (file)
@@ -51,7 +51,7 @@
 *********/\r
 \r
 \r
-#define IPOIB_INTERFACE_DATA_VERSION           (4)\r
+#define IPOIB_INTERFACE_DATA_VERSION           (5)\r
 \r
 \r
 /* Interface definitions */\r
@@ -60,6 +60,7 @@ typedef struct _ipoib_ifc_data
        /* HCA and Port GUID */\r
        net64_t                                         ca_guid;\r
        net64_t                                         port_guid;\r
+       uint8_t                                         port_num;\r
 \r
 }      ipoib_ifc_data_t;\r
 \r
index e2f4bc4..ca07bcc 100644 (file)
@@ -125,7 +125,6 @@ ipoib_create_adapter(
        ipoib_adapter_t         *p_adapter;\r
        ib_api_status_t         status;\r
        cl_status_t                     cl_status;\r
-       uint8_t                         port_num;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
@@ -162,10 +161,10 @@ ipoib_create_adapter(
                return status;\r
        }\r
 \r
-       port_num = IPOIB_GET_PORT_NUM_FROM_GUID(p_adapter->guids.port_guid);\r
-\r
-       IPOIB_TRACE( IPOIB_DBG_INFO, \r
-                       ("Port %d initializing\n", port_num) );\r
+       IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+                       ("Port %016I64x (CA %016I64x port %d) initializing\n",\r
+                       p_adapter->guids.port_guid, p_adapter->guids.ca_guid,\r
+                       p_adapter->guids.port_num) );\r
 \r
        /* Read configuration parameters. */\r
        status = ipoib_get_adapter_params( wrapper_config_context,\r
index a913585..8e63fe3 100644 (file)
@@ -58,8 +58,6 @@
 /*\r
  * Macros\r
  */\r
-#define IPOIB_GET_PORT_NUM_FROM_GUID( __guid__ ) ( ((uint8_t *)&(__guid__))[PORT_NUM_INDEX_IN_GUID] + 1 )\r
-#define IPOIB_ADAPTER_GET_PORT_NUM(__p_adapter__) ( IPOIB_GET_PORT_NUM_FROM_GUID( (__p_adapter__)->guids.port_guid ) )\r
 \r
 \r
 typedef struct _ipoib_params\r
index 7283bbc..2cf6367 100644 (file)
@@ -665,8 +665,10 @@ ipoib_halt(
        CL_ASSERT( adapter_context );\r
        p_adapter = (ipoib_adapter_t*)adapter_context;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_INFO,\r
-               ("Port %d halting\n", IPOIB_ADAPTER_GET_PORT_NUM(p_adapter)) );\r
+       IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+                       ("Port %016I64x (CA %016I64x port %d) halting\n",\r
+                       p_adapter->guids.port_guid, p_adapter->guids.ca_guid,\r
+                       p_adapter->guids.port_num) );\r
 \r
        ipoib_destroy_adapter( p_adapter );\r
 \r
@@ -744,7 +746,7 @@ ipoib_query_info(
        src_buf = &info;\r
        buf_len = sizeof(info);\r
 \r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter);\r
+       port_num = p_adapter->guids.port_num;\r
 \r
        switch( oid )\r
        {\r
@@ -1248,13 +1250,11 @@ __ipoib_get_tcp_task_offload(
        NDIS_TASK_OFFLOAD_HEADER        *p_offload_hdr;\r
        NDIS_TASK_OFFLOAD                       *p_offload_task;\r
        NDIS_TASK_TCP_IP_CHECKSUM       *p_offload_chksum;\r
-       uint8_t                                         port_num;\r
        ULONG                                           buf_len;\r
 \r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter);\r
-\r
        IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
-               ("Port %d received query for OID_TCP_TASK_OFFLOAD\n", port_num) );\r
+               ("Port %d received query for OID_TCP_TASK_OFFLOAD\n",\r
+               p_adapter->guids.port_num) );\r
 \r
        buf_len = sizeof(NDIS_TASK_OFFLOAD_HEADER) +\r
                sizeof(NDIS_TASK_OFFLOAD) +\r
@@ -1409,7 +1409,7 @@ ipoib_set_info(
        *p_bytes_needed = 0;\r
        buf_len = sizeof(ULONG);\r
 \r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter);\r
+       port_num = p_adapter->guids.port_num;\r
 \r
        switch( oid )\r
        {\r
@@ -1865,7 +1865,7 @@ __ipoib_set_net_addr(
        IPOIB_ENTER( IPOIB_DBG_OID );\r
 \r
        status = NDIS_STATUS_SUCCESS;\r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter);\r
+       port_num = p_adapter->guids.port_num;\r
 \r
        IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
                ("Port %d received set for OID_GEN_NETWORK_LAYER_ADDRESSES\n",\r
@@ -2146,7 +2146,7 @@ ipoib_reg_addrs(
 \r
        IPOIB_ENTER( IPOIB_DBG_OID );\r
 \r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM( p_adapter );\r
+       port_num = p_adapter->guids.port_num;\r
 \r
        /* Setup our service call with things common to all calls */\r
        cl_memset( &ib_service, 0, sizeof(ib_service) );\r
@@ -2298,7 +2298,7 @@ __ipoib_ats_reg_cb(
        CL_ASSERT( p_reg_svc_rec->svc_context );\r
 \r
        p_reg = (ats_reg_t* __ptr64)p_reg_svc_rec->svc_context;\r
-       port_num = IPOIB_ADAPTER_GET_PORT_NUM( p_reg->p_adapter );\r
+       port_num = p_reg->p_adapter->guids.port_num;\r
 \r
        cl_obj_lock( &p_reg->p_adapter->obj );\r
 \r