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

Function rte_bbdev_release

dpdk/lib/bbdev/rte_bbdev.c:232–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232int
233rte_bbdev_release(struct rte_bbdev *bbdev)
234{
235 uint16_t dev_id;
236 struct rte_bbdev_callback *cb, *next;
237
238 if (bbdev == NULL) {
239 rte_bbdev_log(ERR, "NULL bbdev");
240 return -ENODEV;
241 }
242 dev_id = bbdev->data->dev_id;
243
244 /* free all callbacks from the device's list */
245 for (cb = TAILQ_FIRST(&bbdev->list_cbs); cb != NULL; cb = next) {
246
247 next = TAILQ_NEXT(cb, next);
248 TAILQ_REMOVE(&(bbdev->list_cbs), cb, next);
249 rte_free(cb);
250 }
251
252 /* clear shared BBDev Data if no process is using the device anymore */
253 if (rte_atomic_fetch_sub_explicit(&bbdev->data->process_cnt, 1,
254 rte_memory_order_relaxed) - 1 == 0)
255 memset(bbdev->data, 0, sizeof(*bbdev->data));
256
257 memset(bbdev, 0, sizeof(*bbdev));
258 num_devs--;
259 bbdev->state = RTE_BBDEV_UNUSED;
260
261 rte_bbdev_log_debug(
262 "Un-initialised device id = %u. Num devices = %u",
263 dev_id, num_devs);
264 return 0;
265}
266
267struct rte_bbdev *
268rte_bbdev_get_named_dev(const char *name)

Callers 15

turbo_sw_bbdev_createFunction · 0.85
turbo_sw_bbdev_removeFunction · 0.85
null_bbdev_createFunction · 0.85
null_bbdev_removeFunction · 0.85
la12xx_bbdev_createFunction · 0.85
la12xx_bbdev_removeFunction · 0.85
fpga_5gnr_fec_probeFunction · 0.85
fpga_5gnr_fec_removeFunction · 0.85
fpga_lte_fec_probeFunction · 0.85
fpga_lte_fec_removeFunction · 0.85
acc100_pci_probeFunction · 0.85
acc_pci_removeFunction · 0.85

Calls 2

rte_freeFunction · 0.85
memsetFunction · 0.85

Tested by 3

test_bbdev_driver_initFunction · 0.68
test_bbdev_callbackFunction · 0.68
test_bbdev_get_named_devFunction · 0.68