From: ftillier Date: Mon, 20 Jun 2005 22:45:00 +0000 (+0000) Subject: Fix to support Indirect Data Buffer Descriptors in SRP. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=238e3e5b3ff3592b8d3fcc8a20fa8bf27a6f931f;p=~shefty%2Frdma-win.git Fix to support Indirect Data Buffer Descriptors in SRP. git-svn-id: svn://openib.tc.cornell.edu/gen1@20 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/srp/kernel/ib_srp.inf b/trunk/ulp/srp/kernel/ib_srp.inf index 3388a6af..197f5375 100644 --- a/trunk/ulp/srp/kernel/ib_srp.inf +++ b/trunk/ulp/srp/kernel/ib_srp.inf @@ -7,7 +7,7 @@ Class=SCSIAdapter ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Provider=%SST% CatalogFile=ibsrp.cat -DriverVer=05/10/2005,3.0.0031.0 +DriverVer=06/20/2005,3.0.0033.0 ; ================= Device Install section ===================== diff --git a/trunk/ulp/srp/kernel/srp.h b/trunk/ulp/srp/kernel/srp.h index cfb50905..d8c74f99 100644 --- a/trunk/ulp/srp/kernel/srp.h +++ b/trunk/ulp/srp/kernel/srp.h @@ -49,7 +49,7 @@ #define SRP_EXTENSION_ID_LENGTH 16 /* Service name extension ID length */ #define SRP_MIN_IU_SIZE 64 -#define SRP_MAX_IU_SIZE 320 +#define SRP_MAX_IU_SIZE 340 #define SRP_MIN_INI_TO_TGT_IU 64 // Minimum initiator message size #define SRP_MIN_TGT_TO_INI_IU 56 // Minimum target message size @@ -251,6 +251,12 @@ typedef struct _srp_memory_descriptor uint32_t data_length; } PACK_SUFFIX srp_memory_descriptor_t; +typedef struct _srp_memory_table_descriptor +{ + srp_memory_descriptor_t descriptor; + uint32_t total_length; +} PACK_SUFFIX srp_memory_table_descriptor_t; + typedef struct _srp_cmd { uint8_t type; diff --git a/trunk/ulp/srp/kernel/srp_cmd.h b/trunk/ulp/srp/kernel/srp_cmd.h index 5dbc82af..3c1e76e3 100644 --- a/trunk/ulp/srp/kernel/srp_cmd.h +++ b/trunk/ulp/srp/kernel/srp_cmd.h @@ -491,11 +491,40 @@ uint32_t get_srp_command_length( IN srp_cmd_t *p_information_unit ) { - /* do not include additional cdb field in the sizeof the IU. add it's length and data out/in buffer desc counts to the structure size */ - return( ( sizeof( *p_information_unit ) - sizeof( p_information_unit->additional_cdb ) ) + - ( get_srp_command_additional_cdb_length( p_information_unit ) * 4 ) + - ( get_srp_command_data_out_buffer_desc_count( p_information_unit ) * sizeof( srp_memory_descriptor_t ) ) + - ( get_srp_command_data_in_buffer_desc_count( p_information_unit ) * sizeof( srp_memory_descriptor_t ) ) ); + int buffer_desc_count; + uint32_t srp_cmd_length = ( sizeof( *p_information_unit ) - sizeof( p_information_unit->additional_cdb ) ) + + ( get_srp_command_additional_cdb_length( p_information_unit ) * 4 ); + + switch ( get_srp_command_data_out_buffer_desc_fmt ( p_information_unit )) + { + case DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR: + buffer_desc_count = get_srp_command_data_out_buffer_desc_count( p_information_unit ); + srp_cmd_length += ( buffer_desc_count == 0)? sizeof(srp_memory_descriptor_t): + ( buffer_desc_count * sizeof(srp_memory_descriptor_t )); + break; + case DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS: + buffer_desc_count = get_srp_command_data_out_buffer_desc_count( p_information_unit ); + srp_cmd_length += sizeof(srp_memory_table_descriptor_t) + ( buffer_desc_count * sizeof(srp_memory_descriptor_t)); + break; + default: + break; + } + + switch ( get_srp_command_data_in_buffer_desc_fmt ( p_information_unit )) + { + case DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR: + buffer_desc_count = get_srp_command_data_in_buffer_desc_count( p_information_unit ); + srp_cmd_length += ( buffer_desc_count == 0)? sizeof(srp_memory_descriptor_t): + ( buffer_desc_count * sizeof(srp_memory_descriptor_t )); + break; + case DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS: + buffer_desc_count = get_srp_command_data_in_buffer_desc_count( p_information_unit ); + srp_cmd_length += sizeof(srp_memory_table_descriptor_t) + ( buffer_desc_count * sizeof(srp_memory_descriptor_t)); + break; + default: + break; + } + return ( srp_cmd_length ); } /* set_srp_command_from_host_to_network */ @@ -513,8 +542,8 @@ set_srp_command_from_host_to_network( IN OUT srp_cmd_t *p_information_unit ) { srp_memory_descriptor_t *p_memory_descriptor; - int buffer_desc_count = get_srp_command_data_in_buffer_desc_count( p_information_unit ) + - get_srp_command_data_out_buffer_desc_count( p_information_unit ); + srp_memory_table_descriptor_t *p_table_descriptor; + int buffer_desc_count; int i; set_srp_information_unit_from_host_to_network( ( srp_information_unit_t* ) p_information_unit ); @@ -522,10 +551,80 @@ set_srp_command_from_host_to_network( p_memory_descriptor = get_srp_command_buffer_desc( p_information_unit ); - for( i = 0; i < buffer_desc_count; i++, p_memory_descriptor++ ) + switch (get_srp_command_data_out_buffer_desc_fmt(p_information_unit) ) + { + case DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR: + buffer_desc_count = get_srp_command_data_out_buffer_desc_count( p_information_unit ); + if ( p_memory_descriptor != NULL ) + { + for ( i=0; i < buffer_desc_count; i++) + { + p_memory_descriptor->virtual_address = cl_hton64( p_memory_descriptor->virtual_address ); + p_memory_descriptor->data_length = cl_hton32 ( p_memory_descriptor->data_length ); + p_memory_descriptor++; + } + } + break; + case DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS: + buffer_desc_count = get_srp_command_data_out_buffer_desc_count( p_information_unit ); + if ( p_memory_descriptor != NULL ) + { + p_table_descriptor = ( srp_memory_table_descriptor_t *)p_memory_descriptor; + p_memory_descriptor = ( srp_memory_descriptor_t *)( p_table_descriptor + 1); + + p_table_descriptor->descriptor.virtual_address = cl_hton64( p_table_descriptor->descriptor.virtual_address ); + p_table_descriptor->descriptor.data_length = cl_hton32( p_table_descriptor->descriptor.data_length ); + p_table_descriptor->total_length = cl_hton32( p_table_descriptor->total_length ); + + for ( i=0; i < buffer_desc_count; i++) + { + p_memory_descriptor->virtual_address = cl_hton64( p_memory_descriptor->virtual_address ); + p_memory_descriptor->data_length = cl_hton32( p_memory_descriptor->data_length ); + p_memory_descriptor++; + } + } + break; + case DBDF_NO_DATA_BUFFER_DESCRIPTOR_PRESENT: + default: + break; + } + + switch (get_srp_command_data_in_buffer_desc_fmt(p_information_unit) ) { - p_memory_descriptor->virtual_address = cl_hton64( p_memory_descriptor->virtual_address ); - p_memory_descriptor->data_length = cl_hton32( p_memory_descriptor->data_length ); + case DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR: + buffer_desc_count = get_srp_command_data_in_buffer_desc_count( p_information_unit ); + if ( p_memory_descriptor != NULL ) + { + for ( i=0; i < buffer_desc_count; i++) + { + p_memory_descriptor->virtual_address = cl_hton64( p_memory_descriptor->virtual_address ); + p_memory_descriptor->data_length = cl_hton32 ( p_memory_descriptor->data_length ); + p_memory_descriptor++; + } + } + break; + case DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS: + buffer_desc_count = get_srp_command_data_in_buffer_desc_count( p_information_unit ); + if ( p_memory_descriptor != NULL ) + { + p_table_descriptor = ( srp_memory_table_descriptor_t *)p_memory_descriptor; + p_memory_descriptor = ( srp_memory_descriptor_t *)( p_table_descriptor + 1); + + p_table_descriptor->descriptor.virtual_address = cl_hton64( p_table_descriptor->descriptor.virtual_address ); + p_table_descriptor->descriptor.data_length = cl_hton32( p_table_descriptor->descriptor.data_length ); + p_table_descriptor->total_length = cl_hton32( p_table_descriptor->total_length ); + + for ( i=0; i < buffer_desc_count; i++) + { + p_memory_descriptor->virtual_address = cl_hton64( p_memory_descriptor->virtual_address ); + p_memory_descriptor->data_length = cl_hton32( p_memory_descriptor->data_length ); + p_memory_descriptor++; + } + } + break; + case DBDF_NO_DATA_BUFFER_DESCRIPTOR_PRESENT: + default: + break; } } diff --git a/trunk/ulp/srp/kernel/srp_connection.c b/trunk/ulp/srp/kernel/srp_connection.c index 6e3b75aa..821aa93a 100644 --- a/trunk/ulp/srp/kernel/srp_connection.c +++ b/trunk/ulp/srp/kernel/srp_connection.c @@ -424,6 +424,7 @@ __srp_cm_reply_cb( p_connection = &p_srp_session->connection; set_srp_login_response_from_network_to_host( p_srp_login_rsp ); + p_connection->descriptor_format = get_srp_login_response_supported_data_buffer_formats( p_srp_login_rsp ); p_connection->request_limit = MIN( get_srp_login_response_request_limit_delta( p_srp_login_rsp ), SRP_DEFAULT_RECV_Q_DEPTH ); @@ -433,9 +434,23 @@ __srp_cm_reply_cb( p_connection->targ_to_init_iu_sz = get_srp_login_response_max_targ_to_init_iu( p_srp_login_rsp ); p_connection->signaled_send_completion_count = p_connection->send_queue_depth / 2; - p_connection->max_scatter_gather_entries = - (p_connection->init_to_targ_iu_sz - offsetof( srp_cmd_t, additional_cdb )) / sizeof( srp_memory_descriptor_t ); - + + if (( p_connection->descriptor_format & DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS ) == DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS ) + { + p_connection->max_scatter_gather_entries = + ( MAX( SRP_MAX_IU_SIZE, p_connection->init_to_targ_iu_sz ) - offsetof( srp_cmd_t, additional_cdb )- sizeof(srp_memory_table_descriptor_t)) / sizeof( srp_memory_descriptor_t ); + } + else if (( p_connection->descriptor_format & DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR ) == DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR ) + { + p_connection->max_scatter_gather_entries = + (p_connection->init_to_targ_iu_sz - offsetof( srp_cmd_t, additional_cdb ))/ sizeof( srp_memory_descriptor_t ); + } + else /* not reported any descriptor format */ + { + SRP_TRACE( SRP_DBG_DEBUG,(" Target does not support valid descriptor formats\n") ); + p_connection->state = SRP_CONNECT_FAILURE; + goto exit; + } SRP_TRACE( SRP_DBG_DEBUG, ("Request Limit = %d, SendQ Depth = %d, RecvQDepth = %d, ItoT size = %d, TtoI size = %d, Max S/G = %d\n", p_connection->request_limit, @@ -570,11 +585,25 @@ __srp_cm_rej_cb( if( p_srp_login_rej ) { set_srp_login_reject_from_network_to_host( p_srp_login_rej ); // <-- Is this coming back NULL? + p_connection->reject_reason = get_srp_login_reject_reason( p_srp_login_rej ); SRP_TRACE( SRP_DBG_ERROR, ("Login Rejected. IBT Code = 0x%x, SRP Code = 0x%x\n", - p_cm_reject->rej_status, - get_srp_login_reject_reason( p_srp_login_rej ) ) ); + p_cm_reject->rej_status, p_connection->reject_reason ) ); + switch( p_connection->reject_reason ) + { + case LIREJ_INIT_TO_TARG_IU_LENGTH_TOO_LARGE: + SRP_TRACE( SRP_DBG_ERROR, ("REQUESTED IU_SIZE %d\n", p_connection->req_max_iu_msg_size )); + break; + case LIREJ_UNSUPPORTED_DATA_BUFFER_DESCRIPTOR_FORMAT: + SRP_TRACE( SRP_DBG_ERROR, ("REQUESTED DESC FORMAT: %#x, SUPPORTED FORMAT %#x\n", + p_connection->descriptor_format, + get_srp_login_reject_supported_data_buffer_formats(p_srp_login_rej) )); + __srp_issue_session_login( p_connection, (srp_hca_t *)&p_srp_session->hca, p_connection->ioc_max_send_msg_depth ); + return; + default: + break; + } } else { @@ -620,14 +649,30 @@ __srp_issue_session_login( cm_req.flags = 0; // event used instead of IB_FLAGS_SYNC cm_req.max_cm_retries = 8; cm_req.p_primary_path = p_connection->p_path_rec; - + + /*already tried to login before and failed ? */ + if ( !p_connection->reject_reason ) + { + p_connection->descriptor_format = DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR | DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS; + } + else if ( p_connection->reject_reason == LIREJ_UNSUPPORTED_DATA_BUFFER_DESCRIPTOR_FORMAT ) + { + p_connection->descriptor_format = DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR; + } + else + { + p_connection->state = SRP_CONNECT_FAILURE; + status = IB_ERROR; + goto exit; + } + p_connection->req_max_iu_msg_size = ( p_connection->ioc_max_send_msg_size >= SRP_MAX_IU_SIZE )? SRP_MAX_IU_SIZE: p_connection->ioc_max_send_msg_size; /* Build SRP Login request */ setup_srp_login_request( &login_req, 0, /* tag */ - SRP_MAX_IU_SIZE, - DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR, + p_connection->req_max_iu_msg_size, + p_connection->descriptor_format, MCA_TERMINATE_EXISTING, &p_connection->init_port_id, &p_connection->targ_port_id ); @@ -745,6 +790,9 @@ srp_connect( p_connection->init_port_id.guid = p_hca->ca_guid; p_connection->init_port_id.id_extension = initiator_extension; + p_connection->ioc_max_send_msg_size = cl_ntoh32 (p_session->p_hba->ioc_info.profile.send_msg_size); + p_connection->ioc_max_send_msg_depth = send_msg_depth; + p_connection->reject_reason = 0; status = __srp_create_cqs( p_connection, p_hca, p_session ); if ( status != IB_SUCCESS ) diff --git a/trunk/ulp/srp/kernel/srp_connection.h b/trunk/ulp/srp/kernel/srp_connection.h index 9159831d..3108fabc 100644 --- a/trunk/ulp/srp/kernel/srp_connection.h +++ b/trunk/ulp/srp/kernel/srp_connection.h @@ -88,8 +88,12 @@ typedef struct _srp_connection uint32_t signaled_send_completion_count; uint32_t max_scatter_gather_entries; - + uint32_t ioc_max_send_msg_size; + uint32_t req_max_iu_msg_size; cl_event_t conn_req_event; + DATA_BUFFER_DESCRIPTOR_FORMAT descriptor_format; + LOGIN_REJECT_CODE reject_reason; + uint8_t ioc_max_send_msg_depth; } srp_connection_t; ib_api_status_t @@ -110,5 +114,11 @@ srp_connect( void srp_free_connection( IN srp_connection_t *p_srp_connection ); +static +ib_api_status_t +__srp_issue_session_login( + IN OUT srp_connection_t *p_connection, + IN srp_hca_t *p_hca, + IN uint8_t send_msg_depth ); #endif /* _SRP_CONNECTION_H_ */ diff --git a/trunk/ulp/srp/kernel/srp_data_path.c b/trunk/ulp/srp/kernel/srp_data_path.c index 59900221..56364d3d 100644 --- a/trunk/ulp/srp/kernel/srp_data_path.c +++ b/trunk/ulp/srp/kernel/srp_data_path.c @@ -536,8 +536,11 @@ __srp_build_cmd( PSTOR_SCATTER_GATHER_LIST p_scatter_gather_list = NULL; uint8_t scatter_gather_count = 0; srp_memory_descriptor_t *p_memory_descriptor = NULL; + srp_memory_table_descriptor_t *p_table_descriptor = NULL; uint32_t i; - + ULONG scsi_direction = p_srb->SrbFlags & ( SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT ); + DATA_BUFFER_DESCRIPTOR_FORMAT format = p_srp_conn_info->descriptor_format & DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS; + ULONG length; SRP_ENTER( SRP_DBG_FUNC ); SRP_TRACE( SRP_DBG_VERBOSE, @@ -566,56 +569,84 @@ __srp_build_cmd( SRP_TRACE( SRP_DBG_VERBOSE, ("%0.2x", p_srb->Cdb[i]) ); } SRP_TRACE( SRP_DBG_VERBOSE, ("\n.") ); + + if ( !format ) + { + format = DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR; + } - if ( (p_srb->SrbFlags & SRB_FLAGS_DATA_IN) == SRB_FLAGS_DATA_IN ) + if ( scsi_direction ) { p_scatter_gather_list = StorPortGetScatterGatherList( p_dev_ext, p_srb ); CL_ASSERT( p_scatter_gather_list != NULL ); - scatter_gather_count = (uint8_t)p_scatter_gather_list->NumberOfElements; + CL_ASSERT( scatter_gather_count <= p_srp_conn_info->max_scatter_gather_entries ); + } - set_srp_command_data_in_buffer_desc_fmt( p_srp_cmd, DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR ); + if ( scsi_direction == SRB_FLAGS_DATA_IN ) + { + set_srp_command_data_in_buffer_desc_fmt( p_srp_cmd, format ); set_srp_command_data_in_buffer_desc_count( p_srp_cmd, scatter_gather_count ); p_memory_descriptor = get_srp_command_data_in_buffer_desc( p_srp_cmd ); } - else - { - if ( (p_srb->SrbFlags & SRB_FLAGS_DATA_OUT) == SRB_FLAGS_DATA_OUT ) - { - p_scatter_gather_list = StorPortGetScatterGatherList( p_dev_ext, p_srb ); - CL_ASSERT( p_scatter_gather_list != NULL ); - scatter_gather_count = (uint8_t)p_scatter_gather_list->NumberOfElements; - - set_srp_command_data_out_buffer_desc_fmt( p_srp_cmd, DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR ); - set_srp_command_data_out_buffer_desc_count( p_srp_cmd, scatter_gather_count ); - p_memory_descriptor = get_srp_command_data_out_buffer_desc( p_srp_cmd ); - } + else if ( scsi_direction == SRB_FLAGS_DATA_OUT ) + { + set_srp_command_data_out_buffer_desc_fmt( p_srp_cmd, format ); + set_srp_command_data_out_buffer_desc_count( p_srp_cmd, scatter_gather_count ); + p_memory_descriptor = get_srp_command_data_out_buffer_desc( p_srp_cmd ); } if ( p_memory_descriptor != NULL ) { PSTOR_SCATTER_GATHER_ELEMENT p_sg_element; - - CL_ASSERT( scatter_gather_count <= p_srp_conn_info->max_scatter_gather_entries ); - - for ( i = 0, p_sg_element = p_scatter_gather_list->List; - i < scatter_gather_count; - i++, p_memory_descriptor++, p_sg_element++ ) + uint32_t totalLength; + uint64_t buf_addr; + if ( format == DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS ) { - p_memory_descriptor->virtual_address = p_srp_conn_info->vaddr + p_sg_element->PhysicalAddress.QuadPart; - p_memory_descriptor->memory_handle = p_srp_conn_info->rkey; - p_memory_descriptor->data_length = p_sg_element->Length; - - SRP_TRACE( SRP_DBG_VERBOSE, ("virtual_address[%d] = 0x%"PRIx64".\n", i, p_memory_descriptor->virtual_address) ); - SRP_TRACE( SRP_DBG_VERBOSE, ("memory_handle[%d] = 0x%x.\n", i, p_memory_descriptor->memory_handle) ); - SRP_TRACE( SRP_DBG_VERBOSE, ("data_length[%d] = %d.\n", i, p_memory_descriptor->data_length) ); + p_table_descriptor = (srp_memory_table_descriptor_t *)p_memory_descriptor; + p_memory_descriptor = ( srp_memory_descriptor_t *)(p_table_descriptor + 1 ); + + buf_addr = (StorPortGetPhysicalAddress( p_dev_ext,p_srb, p_memory_descriptor, &length)).QuadPart; + + /* we don't swap rkey - it is already in network order*/ + p_table_descriptor->descriptor.virtual_address = cl_hton64( buf_addr ); + p_table_descriptor->descriptor.memory_handle = p_srp_conn_info->rkey; + p_table_descriptor->descriptor.data_length = cl_hton32( sizeof(srp_memory_descriptor_t) * scatter_gather_count ); + + for ( i = 0, totalLength = 0, p_sg_element = p_scatter_gather_list->List; + i < scatter_gather_count; i++, p_memory_descriptor++, p_sg_element++ ) + { + buf_addr = p_srp_conn_info->vaddr + p_sg_element->PhysicalAddress.QuadPart; + + p_memory_descriptor->virtual_address = cl_hton64( buf_addr ); + p_memory_descriptor->memory_handle = p_srp_conn_info->rkey; + p_memory_descriptor->data_length = cl_hton32( p_sg_element->Length ); + totalLength += p_sg_element->Length; + } + p_table_descriptor->total_length = cl_hton32( totalLength ); + } + else if ( format == DBDF_DIRECT_DATA_BUFFER_DESCRIPTOR ) + { + for ( i = 0, p_sg_element = p_scatter_gather_list->List; + i < scatter_gather_count; i++, p_memory_descriptor++, p_sg_element++ ) + { + buf_addr = p_srp_conn_info->vaddr + p_sg_element->PhysicalAddress.QuadPart; + p_memory_descriptor->virtual_address = cl_hton64( buf_addr ); + p_memory_descriptor->memory_handle = p_srp_conn_info->rkey; + p_memory_descriptor->data_length = cl_hton32( p_sg_element->Length ); + + SRP_TRACE( SRP_DBG_VERBOSE, ("virtual_address[%d] = 0x%"PRIx64".\n", i, cl_ntoh64(p_memory_descriptor->virtual_address) ) ); + SRP_TRACE( SRP_DBG_VERBOSE, ("memory_handle[%d] = 0x%x.\n", i, cl_ntoh32( p_memory_descriptor->memory_handle) ) ); + SRP_TRACE( SRP_DBG_VERBOSE, ("data_length[%d] = %d.\n", i, cl_ntoh32( p_memory_descriptor->data_length) ) ); + } } - SRP_TRACE( SRP_DBG_VERBOSE, ("scatter/gather count = %d.\n", scatter_gather_count)); } - set_srp_command_from_host_to_network( p_srp_cmd ); + p_srp_cmd->logical_unit_number = cl_hton64( p_srp_cmd->logical_unit_number ); + + //set_srp_command_from_host_to_network( p_srp_cmd ); SRP_EXIT( SRP_DBG_FUNC ); } @@ -659,7 +690,7 @@ srp_format_io_request( srp_conn_info.vaddr = p_srp_session->hca.vaddr; srp_conn_info.lkey = p_srp_session->hca.lkey; srp_conn_info.rkey = p_srp_session->hca.rkey; - + srp_conn_info.descriptor_format = p_srp_session->connection.descriptor_format; srp_conn_info.init_to_targ_iu_sz = p_srp_session->connection.init_to_targ_iu_sz; srp_conn_info.max_scatter_gather_entries = p_srp_session->connection.max_scatter_gather_entries; srp_conn_info.tag = cl_atomic_inc( &p_srp_session->connection.tag ); diff --git a/trunk/ulp/srp/kernel/srp_data_path.h b/trunk/ulp/srp/kernel/srp_data_path.h index b3385a0f..4bdbae1a 100644 --- a/trunk/ulp/srp/kernel/srp_data_path.h +++ b/trunk/ulp/srp/kernel/srp_data_path.h @@ -37,6 +37,7 @@ #include #include +#include "srp.h" #include "srp_data.h" typedef struct _srp_conn_info @@ -48,6 +49,7 @@ typedef struct _srp_conn_info uint64_t tag; uint32_t max_scatter_gather_entries; BOOLEAN signal_send_completion; + DATA_BUFFER_DESCRIPTOR_FORMAT descriptor_format; } srp_conn_info_t; void diff --git a/trunk/ulp/srp/kernel/srp_driver.c b/trunk/ulp/srp/kernel/srp_driver.c index 064b83b1..448da385 100644 --- a/trunk/ulp/srp/kernel/srp_driver.c +++ b/trunk/ulp/srp/kernel/srp_driver.c @@ -408,8 +408,8 @@ srp_find_adapter( return SP_RETURN_ERROR; } - p_config->SrbExtensionSize = p_ext->p_hba->max_srb_ext_sz; - CL_ASSERT( p_config->SrbExtensionSize >= sizeof( srp_send_descriptor_t ) ); + p_config->SrbExtensionSize = MAX( p_ext->p_hba->max_srb_ext_sz, sizeof( srp_send_descriptor_t )); + //CL_ASSERT( p_config->SrbExtensionSize >= sizeof( srp_send_descriptor_t ) ); p_config->MaximumTransferLength = SCSI_MAXIMUM_TRANSFER_SIZE; p_config->AlignmentMask = 0; /* byte alignment */