@@ -210,6 +210,18 @@ static const struct hclge_hw_error hclge_qcn_ecc_rint[] = {
210
210
{ /* sentinel */ }
211
211
};
212
212
213
+ static const struct hclge_hw_error hclge_mac_afifo_tnl_int [] = {
214
+ { .int_msk = BIT (0 ), .msg = "egu_cge_afifo_ecc_1bit_err" },
215
+ { .int_msk = BIT (1 ), .msg = "egu_cge_afifo_ecc_mbit_err" },
216
+ { .int_msk = BIT (2 ), .msg = "egu_lge_afifo_ecc_1bit_err" },
217
+ { .int_msk = BIT (3 ), .msg = "egu_lge_afifo_ecc_mbit_err" },
218
+ { .int_msk = BIT (4 ), .msg = "cge_igu_afifo_ecc_1bit_err" },
219
+ { .int_msk = BIT (5 ), .msg = "cge_igu_afifo_ecc_mbit_err" },
220
+ { .int_msk = BIT (6 ), .msg = "lge_igu_afifo_ecc_1bit_err" },
221
+ { .int_msk = BIT (7 ), .msg = "lge_igu_afifo_ecc_mbit_err" },
222
+ { /* sentinel */ }
223
+ };
224
+
213
225
static void hclge_log_error (struct device * dev , char * reg ,
214
226
const struct hclge_hw_error * err ,
215
227
u32 err_sts )
@@ -452,6 +464,27 @@ static int hclge_config_tm_hw_err_int(struct hclge_dev *hdev, bool en)
452
464
return ret ;
453
465
}
454
466
467
+ static int hclge_config_mac_err_int (struct hclge_dev * hdev , bool en )
468
+ {
469
+ struct device * dev = & hdev -> pdev -> dev ;
470
+ struct hclge_desc desc ;
471
+ int ret ;
472
+
473
+ /* configure MAC common error interrupts */
474
+ hclge_cmd_setup_basic_desc (& desc , HCLGE_MAC_COMMON_INT_EN , false);
475
+ if (en )
476
+ desc .data [0 ] = cpu_to_le32 (HCLGE_MAC_COMMON_ERR_INT_EN );
477
+
478
+ desc .data [1 ] = cpu_to_le32 (HCLGE_MAC_COMMON_ERR_INT_EN_MASK );
479
+
480
+ ret = hclge_cmd_send (& hdev -> hw , & desc , 1 );
481
+ if (ret )
482
+ dev_err (dev ,
483
+ "fail(%d) to configure MAC COMMON error intr\n" , ret );
484
+
485
+ return ret ;
486
+ }
487
+
455
488
#define HCLGE_SET_DEFAULT_RESET_REQUEST (reset_type ) \
456
489
do { \
457
490
if (ae_dev->ops->set_default_reset_request) \
@@ -688,6 +721,10 @@ static const struct hclge_hw_blk hw_blk[] = {
688
721
.msk = BIT (5 ), .name = "COMMON" ,
689
722
.config_err_int = hclge_config_common_hw_err_int ,
690
723
},
724
+ {
725
+ .msk = BIT (8 ), .name = "MAC" ,
726
+ .config_err_int = hclge_config_mac_err_int ,
727
+ },
691
728
{ /* sentinel */ }
692
729
};
693
730
@@ -735,7 +772,9 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
735
772
u32 mpf_bd_num , pf_bd_num , bd_num ;
736
773
struct hclge_desc desc_bd ;
737
774
struct hclge_desc * desc ;
775
+ __le32 * desc_data ;
738
776
int ret = 0 ;
777
+ u32 status ;
739
778
740
779
/* set default handling */
741
780
set_bit (HNAE3_FUNC_RESET , reset_requests );
@@ -774,6 +813,15 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
774
813
goto msi_error ;
775
814
}
776
815
816
+ /* log MAC errors */
817
+ desc_data = (__le32 * )& desc [1 ];
818
+ status = le32_to_cpu (* desc_data );
819
+ if (status ) {
820
+ hclge_log_error (dev , "MAC_AFIFO_TNL_INT_R" ,
821
+ & hclge_mac_afifo_tnl_int [0 ], status );
822
+ set_bit (HNAE3_GLOBAL_RESET , reset_requests );
823
+ }
824
+
777
825
/* clear all main PF MSIx errors */
778
826
hclge_cmd_reuse_desc (& desc [0 ], false);
779
827
desc [0 ].flag |= cpu_to_le16 (HCLGE_CMD_FLAG_NEXT );
0 commit comments