📄 cippd_error.c
字号:
if(( scsbp = ( *pccb->Remove_dg )( pccb ))) { ( void )( *pccb->Dealloc_dg )( pccb, scsbp ); } } if(( dealloc = pccb->Dealloc_buf )) { ( void )( *dealloc )( pb ); } if(( sb = pb->sb )) { ( void )scs_dealloc_sb( sb ); } Remove_entry( pb->flink ) Unlock_pb( pb ) ( void )scs_dealloc_pb( pccb, pb ); if( --pccb->lpinfo.Nform_paths == 0 && pccb->Fsmstatus.cleanup && pccb->lpinfo.Npaths == 0 ) { Pccb_fork( pccb, pccb->Init_port, PPDPANIC_PCCBFB ) } Unlock_pccb( pccb ) ( void )splx( save_ipl );}/* Name: cippd_clean_pb - Clean up CI PPD Path Following Path Failure * * Abstract: This routine cleans up established paths which have failed due * to either errors or failure of the local port to which they are * associated. It is always invoked through forking. * * Asynchronous invocation of this routine marks the completion of * path disablement and the beginning of path clean. This routine * initiates path clean by notifying SCS of the occurrence of path * failure and allowing it to direct clean up of the failed path. * * NOTE: The appropriate port drivers are always responsible for * the removal and deallocation of all free datagram and * message buffers associated with failed local ports. The * CI PPD must never attempt to dispose of such buffers. * * Inputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * pb - Path Block pointer * pinfo.state - PS_PATH_FAILURE * ppd.cippd - CI PPD specific PB fields * fsmpstatus.fkip - 1 * * Outputs: * * IPL_SCS - Interrupt processor level * * SMP: The PB is locked during synchronization to its semaphore. It * is unlocked prior to SCS notification of path failure. PB * address validity is guaranteed both by single threading of path * clean up and by incrementing the PB semaphore prior to * scheduling of the asynchronous invocation of this routine. The * former should be sufficient to guarantee validity, but the * latter is done anyway as additional protection and to detect * errors in error recovery logic. * * PB semaphores are synchronized to before SCS notification of * path failure occurs because occasions exist elsewhere within * the CI PPD when PBs must be unlocked and yet temporarily * protected against the premature deletion which this SCS * notification eventually results in. PB semaphores are also * used to guarantee PB validity on entry to this routine. */voidcippd_clean_pb( pb ) register PB *pb;{ register u_long save_ipl = Splscs(); /* Clean up of failed established paths includes: * * 1. Locking the PB. * 2. Synchronizing to the PB semaphore. * 3. Unlocking the PB. * 4. Notifying SCS of failure of the specified path. * * Once SCS is notified of path failure( Step 4 ), it takes over * responsibility for directing PB clean up including clean up of all SCS * connections associated with the failed path. Clean up of the last * connection triggers SCS invocation of cippd_remove_pb(). It is this CI * PPD routine which removes the PB from from all system-wide databases, * decrements its semaphore, deallocates it, and also schedules port * initialization through forking whenever there are no longer any paths * originating at the port and port clean up is currently in progress. * * SCS requires the PB address to be guaranteed at the time it is notified * of path failure and the same mechanisms used to guarantee PB address * validity on entry to this routine are employed. These are single * threading of path clean up so that no other thread can possibly delete * the PB and incrementing the PB semaphore. The former mechanism should * be all that is necessary to protect the PB, but the latter is utilized * as further protection and to detect errors in error recovery logic. * * Synchronization to the PB semaphore( Step 2 ) is important in a SMP * environment for the following reason. Occasions exist within the CI * PPD which require threads to temporarily release all locks, including PB * locks, while still protecting PBs from deletion. PB semaphores are the * mechanism chosen to meet this requirement. A thread wishing to * temporarily protect a PB, increments its semaphore prior to releasing * all locks. The semaphore is decremented only after all locks have been * re-obtained and the need for protecting the PB in this fashion has * passed. In the interim, any thread desiring to clean up and deallocate * this PB must first synchronize to its semaphore before proceeding. * * One final note. Once PB removal and deallocation completes, the CI PPD * is free to attempt establishment of a new path incarnation. Such * attempts do not occur until after the path is re-discovered through * polling. New path incarnations are fully subject to crashing on * encountering of sufficient serious errors. */ Lock_pb( pb ) Pb_fork_done( pb, PPDPANIC_PBFB ) Decr_pb_sem( pb ) while( Test_pb_sem( pb )) { Incr_pb_sem( pb ) Unlock_pb( pb ) Lock_pb( pb ) Decr_pb_sem( pb ) } Incr_pb_sem( pb ) Unlock_pb( pb ) ( void )scs_path_crash( pb ); ( void )splx( save_ipl );}/* Name: cippd_conlog - Log CI PPD Events to Console Terminal * * Abstract: This routine logs CI PPD events to the console terminal. The * event is always one of the following types: * * PATH_EVENT - Path specific event * SYSTEM_EVENT - System specific event * RPORT_EVENT - Remote port specific event * * Explicit formatting information must be provided for each * event. This requires updating of the following tables each * time a new event is defined: * * 1. The appropriate entry within the CI PPD console logging * table( cippd_cltab[][] ) must be updated to reflect the new * maximum code represented within the associated format table. * * 2. The associated format table itself( cippd_cli[], * cippd_clw[], cippd_clre[], cippd_cle[], cippd_clse[], * cippd_clscse[], cippd_clscsse[] ) must be updated with both * the class of variable information and exact text to be * displayed. However, the appropriate table should be updated * with a NULL entry when the CI PPD is specifically NOT to log * the new event. This applies to cippd_clse[] when a new CI * PPD severe error event is to be specifically logged by the * appropriate port drivers only. It also applies to * cippd_clscse[] or cippd_clscsse[] when a new SCS event of * severity error( ES_E ) or severe error( ES_SE ) respectively * is to be logged only by SCS and not by the CI PPD. * * NOTE: Console logging of events is bypassed whenever the event * severity does not warrant console logging according to * the current CI PPD severity level( cippd_severity ). * Such bypassing is overridden when the ECLAWAYS bit is * set in the event code indicating that the event is always * to be logged regardless of the current severity level. * * NOTE: This routine does NOT log events arising external to the * CI PPD with the exception of those SCS error and severe * error events which are candidates for application of the * path crash severity modifier( ESM_PC ). It also does NOT * currently log any CI PPD local port specific events( * LPORT_EVENT ), all of which are candidates for * application of the local port crash severity modifier( * ESM_LPC ). Such events( the latter ones ) have NULL * entries in the appropriate console logging format table. * * Inputs: * * IPL_SCS - Interrupt processor level * cippd_cltab - CI PPD Console logging formatting table * cippd_severity - CI PPD console logging severity level * event - Event logging code * event_type - PATH_EVENT, SYSTEM_EVENT, RPORT_EVENT * pb - Path Block pointer( OPTIONAL ) * sb - System Block pointer( OPTIONAL ) * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * elogopt.dbcoll - Database collision event information * elogopt.port_num - Remote port number( when PB == NULL ) * elogopt.protocol - CI PPD protocol information * elogopt.rswtype - Remote system software type * elogopt.sysapname - Name of local SYSAP * * Outputs: * * IPL_SCS - Interrupt processor level * * SMP: The PCCB is locked( EXTERNALLY ) to synchronize access and * prevent premature PB deletion when a PB is provided. * * PBs do NOT require locking when provided because only static * fields are accessed and they are prevented from deletion by * EXTERNAL PCCB locks. SBs NEVER require locking. */voidcippd_conlog( pccb, pb, sb, event, event_type ) register PCCB *pccb; register PB *pb; register SB *sb; register u_long event; register u_long event_type;{ register u_long severity = Eseverity( event ); /* Events are logged according to the class of variable information they * display. The following classes of variable information currently exist: * * 1. Remote system name. * 2. Database conflict system node names and path specific information. * 3. Remote system name and system software type. * 4. Local SYSAP name. * 5. Local port name. * 6. Remote port station address. * * Certain events may also be logged without displaying any variable * information. * * Console messages for path specific events( SCS and CI PPD ) always * display the local port name, local and remote port station addresses and * remote system name by default. Console messages for system specific * events( CI PPD only ) always display the remote system name by default. * Console messages for remote port specific events( CI PPD only ) do NOT * display any information by default. * * A panic occurs whenever the CI PPD is not prepared to log the event due * to detection of any of the following circumstances: * * 1. The event type is unknown. * 2. The event is a port driver specific event. * 3. The severity level of the event is invalid. * 4. The code of the event exceeds the current maximum known code for the * class( SCS or CI PPD ) and severity level of the event. * 5. The event is not represented within the appropriate console logging * formatting table( indicating that the CI PPD should never have been * asked to log it in the first place ). * 6. The class of variable information associated with the event is * unknown. * * None of these circumstances should ever occur. * * NOTE: Currently, all SCS error and severe error events are candidates * for application of the path crash severity modifier( ESM_PC ) and * are logged by the CI PPD( and other individual port drivers ). * There are no SCS error and severe error events logged only by SCS. * * NOTE: Events represented within console logging format tables by NULL * entries are events which are always to be logged only by * individual port drivers and never by the CI PPD. Currently, only * local port specific CI PPD severe error events fall into this * category. */ if( event_type > RPORT_EVENT || Test_pd_event( event ) || severity > ES_SE || Ecode( event ) > Cippd_clmaxcode( cippd_cltab, event ) || Cippd_cltabmsg( cippd_cltab, event ) == NULL ) { ( void )panic( PPDPANIC_UNKCOD ); } else if( Cippd_cltabcode( cippd_cltab, event ) > CF_RPORT ) { ( void )panic( PPDPANIC_UNKCF ); } else if( cippd_severity > severity && !Test_cloverride( event )) { return; } ( void )cprintf( "ci ppd\t- " ); switch( event_type ) { case SYSTEM_EVENT: ( void )cprintf( "%s( remote system: ", Cippd_cltabmsg( cippd_cltab, event )); if( sb ) { ( void )cprintf( "%8s )", sb->sinfo.node_name ); } else { ( void )cprintf( "? )" ); } break; case PATH_EVENT: if( Test_pc_event( event )) { cprintf( "path closing( local( %4s )/remote port: %u/%u", &pccb->lpinfo.name, Scaaddr_low( pccb->lpinfo.addr ), (( pb ) ? Scaaddr_low( pb->pinfo.rport_addr ) : pccb->Elogopt.port_num )); if( sb ) { ( void )cprintf( ", remote system: %8s )\n\t- ", sb->sinfo.node_name ); } else { ( void )cprintf( ", remote system: ? )\n\t- " ); } } ( void )cprintf( "%s", Cippd_cltabmsg( cippd_cltab, event )); if( !Test_pc_event( event )) { cprintf( "\n\t- path( local( %4s )/remote port: %u/%u", &pccb->lpinfo.name, Scaaddr_low( pccb->lpinfo.addr ), (( pb ) ? Scaaddr_low( pb->pinfo.rport_addr ) : pccb->Elogopt.port_num )); if( sb ) { ( void )cprintf( ", remote system: %8s )", sb->sinfo.node_name ); } else { ( void )cprintf( ", remote system: ? )" ); } } break; case RPORT_EVENT: ( void )cprintf( "%s", Cippd_cltabmsg( cippd_cltab, event )); break; } switch( Cippd_cltabcode( cippd_cltab, event )) { case CF_NONE: ( void )cprintf( "\n" ); break; case CF_DBCONFLICT: ( void )cprintf( "\n\t- known system: %8s, ", pccb->Elogopt.dbcoll.cippd_kname ); ( void )cprintf( "on path( local/remote port: %u/%u )", Scaaddr_low( *pccb->Elogopt.dbcoll.cippd_klsaddr ), Scaaddr_low( *pccb->Elogopt.dbcoll.cippd_krsaddr )); if( sb ) { ( void )cprintf( "\n\t- remote system: %8s, ", sb->sinfo.node_name ); } else { ( void )cprintf( "\n\t- remote system: ?, " ); } ( void )cprintf( "on path( local/remote port: %u/", Scaaddr_low( pccb->lpinfo.addr )); if( pb ) { ( void )cprintf( "%u )\n",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -