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

Function rte_latencystats_uninit

dpdk/lib/latencystats/rte_latencystats.c:310–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310int
311rte_latencystats_uninit(void)
312{
313 uint16_t pid;
314 uint16_t qid;
315 int ret = 0;
316 struct rxtx_cbs *cbs = NULL;
317 const struct rte_memzone *mz = NULL;
318
319 /** De register Rx/Tx callbacks */
320 RTE_ETH_FOREACH_DEV(pid) {
321 struct rte_eth_dev_info dev_info;
322
323 ret = rte_eth_dev_info_get(pid, &dev_info);
324 if (ret != 0) {
325 RTE_LOG(INFO, LATENCY_STATS,
326 "Error during getting device (port %u) info: %s\n",
327 pid, strerror(-ret));
328
329 continue;
330 }
331
332 for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
333 cbs = &rx_cbs[pid][qid];
334 ret = rte_eth_remove_rx_callback(pid, qid, cbs->cb);
335 if (ret)
336 RTE_LOG(INFO, LATENCY_STATS, "failed to "
337 "remove Rx callback for pid=%d, "
338 "qid=%d\n", pid, qid);
339 }
340 for (qid = 0; qid < dev_info.nb_tx_queues; qid++) {
341 cbs = &tx_cbs[pid][qid];
342 ret = rte_eth_remove_tx_callback(pid, qid, cbs->cb);
343 if (ret)
344 RTE_LOG(INFO, LATENCY_STATS, "failed to "
345 "remove Tx callback for pid=%d, "
346 "qid=%d\n", pid, qid);
347 }
348 }
349
350 /* free up the memzone */
351 mz = rte_memzone_lookup(MZ_RTE_LATENCY_STATS);
352 if (mz)
353 rte_memzone_free(mz);
354
355 return 0;
356}
357
358int
359rte_latencystats_get_names(struct rte_metric_name *names, uint16_t size)

Callers 2

test_latency_uninitFunction · 0.85
mainFunction · 0.85

Calls 5

rte_eth_dev_info_getFunction · 0.85
rte_memzone_lookupFunction · 0.85
rte_memzone_freeFunction · 0.85

Tested by 2

test_latency_uninitFunction · 0.68
mainFunction · 0.68