@@ -171,9 +171,14 @@ static int efx_devlink_info_nvram_partition(struct efx_nic *efx,
171
171
172
172
rc = efx_mcdi_nvram_metadata (efx , partition_type , NULL , version , NULL ,
173
173
0 );
174
+
175
+ /* If the partition does not exist, that is not an error. */
176
+ if (rc == - ENOENT )
177
+ return 0 ;
178
+
174
179
if (rc ) {
175
- netif_err (efx , drv , efx -> net_dev , "mcdi nvram %s: failed\n" ,
176
- version_name );
180
+ netif_err (efx , drv , efx -> net_dev , "mcdi nvram %s: failed (rc=%d) \n" ,
181
+ version_name , rc );
177
182
return rc ;
178
183
}
179
184
@@ -187,36 +192,33 @@ static int efx_devlink_info_nvram_partition(struct efx_nic *efx,
187
192
static int efx_devlink_info_stored_versions (struct efx_nic * efx ,
188
193
struct devlink_info_req * req )
189
194
{
190
- int rc ;
191
-
192
- rc = efx_devlink_info_nvram_partition (efx , req ,
193
- NVRAM_PARTITION_TYPE_BUNDLE ,
194
- DEVLINK_INFO_VERSION_GENERIC_FW_BUNDLE_ID );
195
- if (rc )
196
- return rc ;
197
-
198
- rc = efx_devlink_info_nvram_partition (efx , req ,
199
- NVRAM_PARTITION_TYPE_MC_FIRMWARE ,
200
- DEVLINK_INFO_VERSION_GENERIC_FW_MGMT );
201
- if (rc )
202
- return rc ;
203
-
204
- rc = efx_devlink_info_nvram_partition (efx , req ,
205
- NVRAM_PARTITION_TYPE_SUC_FIRMWARE ,
206
- EFX_DEVLINK_INFO_VERSION_FW_MGMT_SUC );
207
- if (rc )
208
- return rc ;
209
-
210
- rc = efx_devlink_info_nvram_partition (efx , req ,
211
- NVRAM_PARTITION_TYPE_EXPANSION_ROM ,
212
- EFX_DEVLINK_INFO_VERSION_FW_EXPROM );
213
- if (rc )
214
- return rc ;
195
+ int err ;
215
196
216
- rc = efx_devlink_info_nvram_partition (efx , req ,
217
- NVRAM_PARTITION_TYPE_EXPANSION_UEFI ,
218
- EFX_DEVLINK_INFO_VERSION_FW_UEFI );
219
- return rc ;
197
+ /* We do not care here about the specific error but just if an error
198
+ * happened. The specific error will be reported inside the call
199
+ * through system messages, and if any error happened in any call
200
+ * below, we report it through extack.
201
+ */
202
+ err = efx_devlink_info_nvram_partition (efx , req ,
203
+ NVRAM_PARTITION_TYPE_BUNDLE ,
204
+ DEVLINK_INFO_VERSION_GENERIC_FW_BUNDLE_ID );
205
+
206
+ err |= efx_devlink_info_nvram_partition (efx , req ,
207
+ NVRAM_PARTITION_TYPE_MC_FIRMWARE ,
208
+ DEVLINK_INFO_VERSION_GENERIC_FW_MGMT );
209
+
210
+ err |= efx_devlink_info_nvram_partition (efx , req ,
211
+ NVRAM_PARTITION_TYPE_SUC_FIRMWARE ,
212
+ EFX_DEVLINK_INFO_VERSION_FW_MGMT_SUC );
213
+
214
+ err |= efx_devlink_info_nvram_partition (efx , req ,
215
+ NVRAM_PARTITION_TYPE_EXPANSION_ROM ,
216
+ EFX_DEVLINK_INFO_VERSION_FW_EXPROM );
217
+
218
+ err |= efx_devlink_info_nvram_partition (efx , req ,
219
+ NVRAM_PARTITION_TYPE_EXPANSION_UEFI ,
220
+ EFX_DEVLINK_INFO_VERSION_FW_UEFI );
221
+ return err ;
220
222
}
221
223
222
224
#define EFX_VER_FLAG (_f ) \
@@ -587,27 +589,20 @@ static int efx_devlink_info_get(struct devlink *devlink,
587
589
{
588
590
struct efx_devlink * devlink_private = devlink_priv (devlink );
589
591
struct efx_nic * efx = devlink_private -> efx ;
590
- int rc ;
592
+ int err ;
591
593
592
- /* Several different MCDI commands are used. We report first error
593
- * through extack returning at that point . Specific error
594
- * information via system messages .
594
+ /* Several different MCDI commands are used. We report if errors
595
+ * happened through extack. Specific error information via system
596
+ * messages inside the calls .
595
597
*/
596
- rc = efx_devlink_info_board_cfg (efx , req );
597
- if (rc ) {
598
- NL_SET_ERR_MSG_MOD (extack , "Getting board info failed" );
599
- return rc ;
600
- }
601
- rc = efx_devlink_info_stored_versions (efx , req );
602
- if (rc ) {
603
- NL_SET_ERR_MSG_MOD (extack , "Getting stored versions failed" );
604
- return rc ;
605
- }
606
- rc = efx_devlink_info_running_versions (efx , req );
607
- if (rc ) {
608
- NL_SET_ERR_MSG_MOD (extack , "Getting running versions failed" );
609
- return rc ;
610
- }
598
+ err = efx_devlink_info_board_cfg (efx , req );
599
+
600
+ err |= efx_devlink_info_stored_versions (efx , req );
601
+
602
+ err |= efx_devlink_info_running_versions (efx , req );
603
+
604
+ if (err )
605
+ NL_SET_ERR_MSG_MOD (extack , "Errors when getting device info. Check system messages" );
611
606
612
607
return 0 ;
613
608
}
0 commit comments