MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sfc_nic_probe

Function sfc_nic_probe

dpdk/drivers/net/sfc/sfc.c:1230–1276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1228}
1229
1230static int
1231sfc_nic_probe(struct sfc_adapter *sa)
1232{
1233 efx_nic_t *enp = sa->nic;
1234 efx_fw_variant_t preferred_efv;
1235 efx_fw_variant_t efv;
1236 int rc;
1237
1238 preferred_efv = EFX_FW_VARIANT_DONT_CARE;
1239 rc = sfc_kvargs_process(sa, SFC_KVARG_FW_VARIANT,
1240 sfc_kvarg_fv_variant_handler,
1241 &preferred_efv);
1242 if (rc != 0) {
1243 sfc_err(sa, "invalid %s parameter value", SFC_KVARG_FW_VARIANT);
1244 return rc;
1245 }
1246
1247 rc = sfc_kvarg_rxd_wait_timeout_ns(sa);
1248 if (rc != 0)
1249 return rc;
1250
1251 rc = efx_nic_probe(enp, preferred_efv);
1252 if (rc == EACCES) {
1253 /* Unprivileged functions cannot set FW variant */
1254 rc = efx_nic_probe(enp, EFX_FW_VARIANT_DONT_CARE);
1255 }
1256 if (rc != 0)
1257 return rc;
1258
1259 rc = sfc_get_fw_variant(sa, &efv);
1260 if (rc == ENOTSUP) {
1261 sfc_warn(sa, "FW variant can not be obtained");
1262 return 0;
1263 }
1264 if (rc != 0)
1265 return rc;
1266
1267 /* Check that firmware variant was changed to the requested one */
1268 if (preferred_efv != EFX_FW_VARIANT_DONT_CARE && preferred_efv != efv) {
1269 sfc_warn(sa, "FW variant has not changed to the requested %s",
1270 sfc_fw_variant2str(preferred_efv));
1271 }
1272
1273 sfc_notice(sa, "running FW variant is %s", sfc_fw_variant2str(efv));
1274
1275 return 0;
1276}
1277
1278int
1279sfc_probe(struct sfc_adapter *sa)

Callers 1

sfc_probeFunction · 0.85

Calls 5

sfc_kvargs_processFunction · 0.85
efx_nic_probeFunction · 0.85
sfc_get_fw_variantFunction · 0.85
sfc_fw_variant2strFunction · 0.85

Tested by

no test coverage detected