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

Function cpfl_find_adapter_ext

dpdk/drivers/net/cpfl/cpfl_ethdev.c:2592–2614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2590};
2591
2592static struct cpfl_adapter_ext *
2593cpfl_find_adapter_ext(struct rte_pci_device *pci_dev)
2594{
2595 struct cpfl_adapter_ext *adapter;
2596 int found = 0;
2597
2598 if (pci_dev == NULL)
2599 return NULL;
2600
2601 rte_spinlock_lock(&cpfl_adapter_lock);
2602 TAILQ_FOREACH(adapter, &cpfl_adapter_list, next) {
2603 if (strncmp(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE) == 0) {
2604 found = 1;
2605 break;
2606 }
2607 }
2608 rte_spinlock_unlock(&cpfl_adapter_lock);
2609
2610 if (found == 0)
2611 return NULL;
2612
2613 return adapter;
2614}
2615
2616static void
2617cpfl_adapter_ext_deinit(struct cpfl_adapter_ext *adapter)

Callers 2

cpfl_pci_probeFunction · 0.85
cpfl_pci_removeFunction · 0.85

Calls 3

strncmpFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected