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

Function ntb_destroy

dpdk/drivers/raw/ntb/ntb.c:1498–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1496}
1497
1498static int
1499ntb_destroy(struct rte_pci_device *pci_dev)
1500{
1501 char name[RTE_RAWDEV_NAME_MAX_LEN];
1502 struct rte_rawdev *rawdev;
1503 int ret;
1504
1505 if (pci_dev == NULL) {
1506 NTB_LOG(ERR, "Invalid pci_dev.");
1507 ret = -EINVAL;
1508 return ret;
1509 }
1510
1511 memset(name, 0, sizeof(name));
1512 snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "NTB:%x:%02x.%x",
1513 pci_dev->addr.bus, pci_dev->addr.devid,
1514 pci_dev->addr.function);
1515
1516 NTB_LOG(INFO, "Closing %s on NUMA node %d", name, rte_socket_id());
1517
1518 rawdev = rte_rawdev_pmd_get_named_dev(name);
1519 if (rawdev == NULL) {
1520 NTB_LOG(ERR, "Invalid device name (%s)", name);
1521 ret = -EINVAL;
1522 return ret;
1523 }
1524
1525 ret = rte_rawdev_pmd_release(rawdev);
1526 if (ret)
1527 NTB_LOG(ERR, "Failed to destroy ntb rawdev.");
1528
1529 return ret;
1530}
1531
1532static int
1533ntb_probe(struct rte_pci_driver *pci_drv __rte_unused,

Callers 1

ntb_removeFunction · 0.85

Calls 5

memsetFunction · 0.85
snprintfFunction · 0.85
rte_socket_idFunction · 0.85
rte_rawdev_pmd_releaseFunction · 0.85

Tested by

no test coverage detected