@@ -877,6 +877,7 @@ static void fdls_send_fabric_flogi(struct fnic_iport_s *iport)
877877 oxid );
878878
879879 fnic_send_fcoe_frame (iport , frame , frame_size );
880+ atomic64_inc (& iport -> iport_stats .fabric_flogi_sent );
880881err_out :
881882 /* Even if fnic_send_fcoe_frame() fails we want to retry after timeout */
882883 fdls_start_fabric_timer (iport , 2 * iport -> e_d_tov );
@@ -919,6 +920,7 @@ static void fdls_send_fabric_plogi(struct fnic_iport_s *iport)
919920 oxid );
920921
921922 fnic_send_fcoe_frame (iport , frame , frame_size );
923+ atomic64_inc (& iport -> iport_stats .fabric_plogi_sent );
922924
923925err_out :
924926 /* Even if fnic_send_fcoe_frame() fails we want to retry after timeout */
@@ -1080,6 +1082,7 @@ static void fdls_send_scr(struct fnic_iport_s *iport)
10801082 oxid );
10811083
10821084 fnic_send_fcoe_frame (iport , frame , frame_size );
1085+ atomic64_inc (& iport -> iport_stats .fabric_scr_sent );
10831086
10841087err_out :
10851088 /* Even if fnic_send_fcoe_frame() fails we want to retry after timeout */
@@ -1201,6 +1204,8 @@ fdls_send_tgt_adisc(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
12011204 "0x%x: FDLS send ADISC to tgt fcid: 0x%x" ,
12021205 iport -> fcid , tport -> fcid );
12031206
1207+ atomic64_inc (& iport -> iport_stats .tport_adisc_sent );
1208+
12041209 fnic_send_fcoe_frame (iport , frame , frame_size );
12051210
12061211err_out :
@@ -1310,6 +1315,7 @@ fdls_send_tgt_plogi(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
13101315 iport -> fcid , tport -> fcid , oxid );
13111316
13121317 fnic_send_fcoe_frame (iport , frame , frame_size );
1318+ atomic64_inc (& iport -> iport_stats .tport_plogi_sent );
13131319
13141320err_out :
13151321 timeout = max (2 * iport -> e_d_tov , iport -> plogi_timeout );
@@ -1515,6 +1521,7 @@ fdls_send_tgt_prli(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
15151521 iport -> fcid , tport -> fcid , oxid );
15161522
15171523 fnic_send_fcoe_frame (iport , frame , frame_size );
1524+ atomic64_inc (& iport -> iport_stats .tport_prli_sent );
15181525
15191526err_out :
15201527 timeout = max (2 * iport -> e_d_tov , iport -> plogi_timeout );
@@ -1626,6 +1633,8 @@ void fdls_tgt_logout(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
16261633 iport -> fcid , oxid );
16271634
16281635 fnic_send_fcoe_frame (iport , frame , frame_size );
1636+
1637+ atomic64_inc (& iport -> iport_stats .tport_logo_sent );
16291638}
16301639
16311640static void fdls_tgt_discovery_start (struct fnic_iport_s * iport )
@@ -2515,6 +2524,7 @@ fdls_process_tgt_adisc_rsp(struct fnic_iport_s *iport,
25152524
25162525 switch (adisc_rsp -> els .adisc_cmd ) {
25172526 case ELS_LS_ACC :
2527+ atomic64_inc (& iport -> iport_stats .tport_adisc_ls_accepts );
25182528 if (tport -> timer_pending ) {
25192529 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
25202530 "tport 0x%p Canceling fabric disc timer\n" ,
@@ -2537,6 +2547,7 @@ fdls_process_tgt_adisc_rsp(struct fnic_iport_s *iport,
25372547 break ;
25382548
25392549 case ELS_LS_RJT :
2550+ atomic64_inc (& iport -> iport_stats .tport_adisc_ls_rejects );
25402551 if (((els_rjt -> rej .er_reason == ELS_RJT_BUSY )
25412552 || (els_rjt -> rej .er_reason == ELS_RJT_UNAB ))
25422553 && (tport -> retry_counter < FDLS_RETRY_COUNT )) {
@@ -2608,11 +2619,13 @@ fdls_process_tgt_plogi_rsp(struct fnic_iport_s *iport,
26082619
26092620 switch (plogi_rsp -> els .fl_cmd ) {
26102621 case ELS_LS_ACC :
2622+ atomic64_inc (& iport -> iport_stats .tport_plogi_ls_accepts );
26112623 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
26122624 "PLOGI accepted by target: 0x%x" , tgt_fcid );
26132625 break ;
26142626
26152627 case ELS_LS_RJT :
2628+ atomic64_inc (& iport -> iport_stats .tport_plogi_ls_rejects );
26162629 if (((els_rjt -> rej .er_reason == ELS_RJT_BUSY )
26172630 || (els_rjt -> rej .er_reason == ELS_RJT_UNAB ))
26182631 && (tport -> retry_counter < iport -> max_plogi_retries )) {
@@ -2630,6 +2643,7 @@ fdls_process_tgt_plogi_rsp(struct fnic_iport_s *iport,
26302643 return ;
26312644
26322645 default :
2646+ atomic64_inc (& iport -> iport_stats .tport_plogi_misc_rejects );
26332647 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
26342648 "PLOGI not accepted from target fcid: 0x%x" ,
26352649 tgt_fcid );
@@ -2733,6 +2747,7 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport,
27332747
27342748 switch (prli_rsp -> els_prli .prli_cmd ) {
27352749 case ELS_LS_ACC :
2750+ atomic64_inc (& iport -> iport_stats .tport_prli_ls_accepts );
27362751 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
27372752 "PRLI accepted from target: 0x%x" , tgt_fcid );
27382753
@@ -2749,6 +2764,7 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport,
27492764 }
27502765 break ;
27512766 case ELS_LS_RJT :
2767+ atomic64_inc (& iport -> iport_stats .tport_prli_ls_rejects );
27522768 if (((els_rjt -> rej .er_reason == ELS_RJT_BUSY )
27532769 || (els_rjt -> rej .er_reason == ELS_RJT_UNAB ))
27542770 && (tport -> retry_counter < FDLS_RETRY_COUNT )) {
@@ -2772,6 +2788,7 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport,
27722788 break ;
27732789
27742790 default :
2791+ atomic64_inc (& iport -> iport_stats .tport_prli_misc_rejects );
27752792 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
27762793 "PRLI not accepted from target: 0x%x" , tgt_fcid );
27772794 return ;
@@ -3075,6 +3092,7 @@ fdls_process_scr_rsp(struct fnic_iport_s *iport,
30753092
30763093 switch (scr_rsp -> scr .scr_cmd ) {
30773094 case ELS_LS_ACC :
3095+ atomic64_inc (& iport -> iport_stats .fabric_scr_ls_accepts );
30783096 if (iport -> fabric .timer_pending ) {
30793097 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
30803098 "Canceling fabric disc timer %p\n" , iport );
@@ -3086,7 +3104,7 @@ fdls_process_scr_rsp(struct fnic_iport_s *iport,
30863104 break ;
30873105
30883106 case ELS_LS_RJT :
3089-
3107+ atomic64_inc ( & iport -> iport_stats . fabric_scr_ls_rejects );
30903108 if (((els_rjt -> rej .er_reason == ELS_RJT_BUSY )
30913109 || (els_rjt -> rej .er_reason == ELS_RJT_UNAB ))
30923110 && (fdls -> retry_counter < FDLS_RETRY_COUNT )) {
@@ -3111,6 +3129,7 @@ fdls_process_scr_rsp(struct fnic_iport_s *iport,
31113129 break ;
31123130
31133131 default :
3132+ atomic64_inc (& iport -> iport_stats .fabric_scr_misc_rejects );
31143133 break ;
31153134 }
31163135}
@@ -3434,6 +3453,7 @@ fdls_process_flogi_rsp(struct fnic_iport_s *iport,
34343453
34353454 switch (flogi_rsp -> els .fl_cmd ) {
34363455 case ELS_LS_ACC :
3456+ atomic64_inc (& iport -> iport_stats .fabric_flogi_ls_accepts );
34373457 if (iport -> fabric .timer_pending ) {
34383458 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
34393459 "iport fcid: 0x%x Canceling fabric disc timer\n" ,
@@ -3507,6 +3527,7 @@ fdls_process_flogi_rsp(struct fnic_iport_s *iport,
35073527 break ;
35083528
35093529 case ELS_LS_RJT :
3530+ atomic64_inc (& iport -> iport_stats .fabric_flogi_ls_rejects );
35103531 if (fabric -> retry_counter < iport -> max_flogi_retries ) {
35113532 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
35123533 "FLOGI returned ELS_LS_RJT BUSY. Retry from timer routine %p" ,
@@ -3534,6 +3555,7 @@ fdls_process_flogi_rsp(struct fnic_iport_s *iport,
35343555 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
35353556 "FLOGI response not accepted: 0x%x" ,
35363557 flogi_rsp -> els .fl_cmd );
3558+ atomic64_inc (& iport -> iport_stats .fabric_flogi_misc_rejects );
35373559 break ;
35383560 }
35393561}
@@ -3564,6 +3586,7 @@ fdls_process_fabric_plogi_rsp(struct fnic_iport_s *iport,
35643586
35653587 switch (plogi_rsp -> els .fl_cmd ) {
35663588 case ELS_LS_ACC :
3589+ atomic64_inc (& iport -> iport_stats .fabric_plogi_ls_accepts );
35673590 if (iport -> fabric .timer_pending ) {
35683591 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
35693592 "iport fcid: 0x%x fabric PLOGI response: Accepted\n" ,
@@ -3576,7 +3599,7 @@ fdls_process_fabric_plogi_rsp(struct fnic_iport_s *iport,
35763599 fdls_send_rpn_id (iport );
35773600 break ;
35783601 case ELS_LS_RJT :
3579-
3602+ atomic64_inc ( & iport -> iport_stats . fabric_plogi_ls_rejects );
35803603 if (((els_rjt -> rej .er_reason == ELS_RJT_BUSY )
35813604 || (els_rjt -> rej .er_reason == ELS_RJT_UNAB ))
35823605 && (iport -> fabric .retry_counter < iport -> max_plogi_retries )) {
@@ -3602,6 +3625,7 @@ fdls_process_fabric_plogi_rsp(struct fnic_iport_s *iport,
36023625 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
36033626 "PLOGI response not accepted: 0x%x" ,
36043627 plogi_rsp -> els .fl_cmd );
3628+ atomic64_inc (& iport -> iport_stats .fabric_plogi_misc_rejects );
36053629 break ;
36063630 }
36073631}
@@ -3945,6 +3969,7 @@ fdls_process_unsupported_els_req(struct fnic_iport_s *iport,
39453969 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
39463970 "Dropping unsupported ELS with illegal frame bits 0x%x\n" ,
39473971 d_id );
3972+ atomic64_inc (& iport -> iport_stats .unsupported_frames_dropped );
39483973 return ;
39493974 }
39503975
@@ -3953,6 +3978,7 @@ fdls_process_unsupported_els_req(struct fnic_iport_s *iport,
39533978 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
39543979 "Dropping unsupported ELS request in iport state: %d" ,
39553980 iport -> state );
3981+ atomic64_inc (& iport -> iport_stats .unsupported_frames_dropped );
39563982 return ;
39573983 }
39583984
@@ -4381,6 +4407,8 @@ fdls_process_rscn(struct fnic_iport_s *iport, struct fc_frame_header *fchdr)
43814407 struct fnic * fnic = iport -> fnic ;
43824408 uint16_t rscn_payload_len ;
43834409
4410+ atomic64_inc (& iport -> iport_stats .num_rscns );
4411+
43844412 FNIC_FCS_DBG (KERN_INFO , fnic -> lport -> host , fnic -> fnic_num ,
43854413 "FDLS process RSCN %p" , iport );
43864414
0 commit comments