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

Function sfc_hw_switch_id_init

dpdk/drivers/net/sfc/sfc.c:1420–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1418};
1419
1420int
1421sfc_hw_switch_id_init(struct sfc_adapter *sa,
1422 struct sfc_hw_switch_id **idp)
1423{
1424 efx_nic_board_info_t board_info;
1425 struct sfc_hw_switch_id *id;
1426 int rc;
1427
1428 if (idp == NULL)
1429 return EINVAL;
1430
1431 id = rte_zmalloc("sfc_hw_switch_id", sizeof(*id), 0);
1432 if (id == NULL)
1433 return ENOMEM;
1434
1435 rc = efx_nic_get_board_info(sa->nic, &board_info);
1436 if (rc != 0)
1437 return rc;
1438
1439 memcpy(id->board_sn, board_info.enbi_serial, sizeof(id->board_sn));
1440
1441 *idp = id;
1442
1443 return 0;
1444}
1445
1446void
1447sfc_hw_switch_id_fini(__rte_unused struct sfc_adapter *sa,

Callers 1

Calls 3

rte_zmallocFunction · 0.85
efx_nic_get_board_infoFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected