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

Function sfc_probe

dpdk/drivers/net/sfc/sfc.c:1278–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1276}
1277
1278int
1279sfc_probe(struct sfc_adapter *sa)
1280{
1281 efx_bar_region_t mem_ebrp;
1282 struct rte_eth_dev *eth_dev = sa->eth_dev;
1283 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
1284 efx_nic_t *enp;
1285 int rc;
1286
1287 sfc_log_init(sa, "entry");
1288
1289 SFC_ASSERT(sfc_adapter_is_locked(sa));
1290
1291 sa->socket_id = rte_socket_id();
1292 rte_atomic32_init(&sa->restart_required);
1293
1294 sfc_log_init(sa, "get family");
1295 rc = sfc_efx_family(pci_dev, &mem_ebrp, &sa->family);
1296
1297 if (rc != 0)
1298 goto fail_family;
1299 sfc_log_init(sa,
1300 "family is %u, membar is %u, function control window offset is %lu",
1301 sa->family, mem_ebrp.ebr_index, mem_ebrp.ebr_offset);
1302
1303 sfc_log_init(sa, "init mem bar");
1304 rc = sfc_mem_bar_init(sa, &mem_ebrp);
1305 if (rc != 0)
1306 goto fail_mem_bar_init;
1307
1308 sfc_log_init(sa, "create nic");
1309 rte_spinlock_init(&sa->nic_lock);
1310 rc = efx_nic_create(sa->family, (efsys_identifier_t *)sa,
1311 &sa->mem_bar, mem_ebrp.ebr_offset,
1312 &sa->nic_lock, &enp);
1313 if (rc != 0)
1314 goto fail_nic_create;
1315 sa->nic = enp;
1316
1317 rc = sfc_mcdi_init(sa);
1318 if (rc != 0)
1319 goto fail_mcdi_init;
1320
1321 sfc_log_init(sa, "probe nic");
1322 rc = sfc_nic_probe(sa);
1323 if (rc != 0)
1324 goto fail_nic_probe;
1325
1326 sfc_log_init(sa, "done");
1327 return 0;
1328
1329fail_nic_probe:
1330 sfc_mcdi_fini(sa);
1331
1332fail_mcdi_init:
1333 sfc_log_init(sa, "destroy nic");
1334 sa->nic = NULL;
1335 efx_nic_destroy(enp);

Callers 1

sfc_eth_dev_initFunction · 0.85

Calls 11

rte_socket_idFunction · 0.85
rte_atomic32_initFunction · 0.85
sfc_efx_familyFunction · 0.85
sfc_mem_bar_initFunction · 0.85
rte_spinlock_initFunction · 0.85
efx_nic_createFunction · 0.85
sfc_mcdi_initFunction · 0.85
sfc_nic_probeFunction · 0.85
sfc_mcdi_finiFunction · 0.85
efx_nic_destroyFunction · 0.85
sfc_mem_bar_finiFunction · 0.85

Tested by

no test coverage detected