@@ -71,9 +71,9 @@ static int bnxt_hwrm_remote_dev_reset_set(struct bnxt *bp, bool remote_reset)
71
71
return hwrm_req_send (bp , req );
72
72
}
73
73
74
- static int bnxt_fw_reporter_diagnose (struct devlink_health_reporter * reporter ,
75
- struct devlink_fmsg * fmsg ,
76
- struct netlink_ext_ack * extack )
74
+ static int bnxt_fw_diagnose (struct devlink_health_reporter * reporter ,
75
+ struct devlink_fmsg * fmsg ,
76
+ struct netlink_ext_ack * extack )
77
77
{
78
78
struct bnxt * bp = devlink_health_reporter_priv (reporter );
79
79
u32 val ;
@@ -110,14 +110,9 @@ static int bnxt_fw_reporter_diagnose(struct devlink_health_reporter *reporter,
110
110
return 0 ;
111
111
}
112
112
113
- static const struct devlink_health_reporter_ops bnxt_dl_fw_reporter_ops = {
114
- .name = "fw" ,
115
- .diagnose = bnxt_fw_reporter_diagnose ,
116
- };
117
-
118
- static int bnxt_fw_fatal_recover (struct devlink_health_reporter * reporter ,
119
- void * priv_ctx ,
120
- struct netlink_ext_ack * extack )
113
+ static int bnxt_fw_recover (struct devlink_health_reporter * reporter ,
114
+ void * priv_ctx ,
115
+ struct netlink_ext_ack * extack )
121
116
{
122
117
struct bnxt * bp = devlink_health_reporter_priv (reporter );
123
118
@@ -127,43 +122,26 @@ static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
127
122
return - EINPROGRESS ;
128
123
}
129
124
130
- static const
131
- struct devlink_health_reporter_ops bnxt_dl_fw_fatal_reporter_ops = {
132
- .name = "fw_fatal" ,
133
- .recover = bnxt_fw_fatal_recover ,
125
+ static const struct devlink_health_reporter_ops bnxt_dl_fw_reporter_ops = {
126
+ . name = "fw" ,
127
+ .diagnose = bnxt_fw_diagnose ,
128
+ .recover = bnxt_fw_recover ,
134
129
};
135
130
136
131
void bnxt_dl_fw_reporters_create (struct bnxt * bp )
137
132
{
138
133
struct bnxt_fw_health * health = bp -> fw_health ;
139
134
140
- if (!health )
135
+ if (!health || health -> fw_reporter )
141
136
return ;
142
137
143
- if (!health -> fw_reporter ) {
144
- health -> fw_reporter =
145
- devlink_health_reporter_create (bp -> dl ,
146
- & bnxt_dl_fw_reporter_ops ,
147
- 0 , bp );
148
- if (IS_ERR (health -> fw_reporter )) {
149
- netdev_warn (bp -> dev , "Failed to create FW health reporter, rc = %ld\n" ,
150
- PTR_ERR (health -> fw_reporter ));
151
- health -> fw_reporter = NULL ;
152
- return ;
153
- }
154
- }
155
-
156
- if (health -> fw_fatal_reporter )
157
- return ;
158
-
159
- health -> fw_fatal_reporter =
160
- devlink_health_reporter_create (bp -> dl ,
161
- & bnxt_dl_fw_fatal_reporter_ops ,
138
+ health -> fw_reporter =
139
+ devlink_health_reporter_create (bp -> dl , & bnxt_dl_fw_reporter_ops ,
162
140
0 , bp );
163
- if (IS_ERR (health -> fw_fatal_reporter )) {
164
- netdev_warn (bp -> dev , "Failed to create FW fatal health reporter, rc = %ld\n" ,
165
- PTR_ERR (health -> fw_fatal_reporter ));
166
- health -> fw_fatal_reporter = NULL ;
141
+ if (IS_ERR (health -> fw_reporter )) {
142
+ netdev_warn (bp -> dev , "Failed to create FW health reporter, rc = %ld\n" ,
143
+ PTR_ERR (health -> fw_reporter ));
144
+ health -> fw_reporter = NULL ;
167
145
bp -> fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY ;
168
146
}
169
147
}
@@ -182,11 +160,6 @@ void bnxt_dl_fw_reporters_destroy(struct bnxt *bp, bool all)
182
160
devlink_health_reporter_destroy (health -> fw_reporter );
183
161
health -> fw_reporter = NULL ;
184
162
}
185
-
186
- if (health -> fw_fatal_reporter ) {
187
- devlink_health_reporter_destroy (health -> fw_fatal_reporter );
188
- health -> fw_fatal_reporter = NULL ;
189
- }
190
163
}
191
164
192
165
void bnxt_devlink_health_fw_report (struct bnxt * bp )
@@ -196,13 +169,12 @@ void bnxt_devlink_health_fw_report(struct bnxt *bp)
196
169
if (!fw_health )
197
170
return ;
198
171
199
- if (!fw_health -> fw_fatal_reporter ) {
172
+ if (!fw_health -> fw_reporter ) {
200
173
__bnxt_fw_recover (bp );
201
174
return ;
202
175
}
203
176
204
- devlink_health_report (fw_health -> fw_fatal_reporter ,
205
- "FW fatal error reported" , NULL );
177
+ devlink_health_report (fw_health -> fw_reporter , "FW error reported" , NULL );
206
178
}
207
179
208
180
void bnxt_dl_health_fw_status_update (struct bnxt * bp , bool healthy )
@@ -215,15 +187,14 @@ void bnxt_dl_health_fw_status_update(struct bnxt *bp, bool healthy)
215
187
else
216
188
state = DEVLINK_HEALTH_REPORTER_STATE_ERROR ;
217
189
218
- devlink_health_reporter_state_update (health -> fw_fatal_reporter , state );
190
+ devlink_health_reporter_state_update (health -> fw_reporter , state );
219
191
}
220
192
221
193
void bnxt_dl_health_fw_recovery_done (struct bnxt * bp )
222
194
{
223
- struct bnxt_fw_health * hlth = bp -> fw_health ;
224
195
struct bnxt_dl * dl = devlink_priv (bp -> dl );
225
196
226
- devlink_health_reporter_recovery_done (hlth -> fw_fatal_reporter );
197
+ devlink_health_reporter_recovery_done (bp -> fw_health -> fw_reporter );
227
198
bnxt_hwrm_remote_dev_reset_set (bp , dl -> remote_reset );
228
199
}
229
200
0 commit comments